oracle.anilpassi

121
Basics Of Oracle Apps Training Material (Step by Step Learning of Oracle Apps) What happens when you login to Oracle Apps? Why is it called apps? What is a profile option? What is org_id. Why is it important. Relationship between Applications and Modules Where to find/deploy the code (Forms tier/Middle tier or DB Tier) The testing cycle in Oracle Apps Difference between forms and form functions and menu What is a Concurrent Program What is concurrent Manager What is a Value set What is a lookup in oracle apps How does lookup differ from Value Sets Descriptive Flex field Basics in Oracle Apps How to make context sensitive descriptive flexfields ( step by step) Key Flex fields Basics Setting up your PC for development environment Your first custom form from scratch Your first pl/sql concurrent program from scratch Oracle FNDLOAD Script Examples Restart or Bounce Apache in Oracle Apps 11i Playing with CUSTOM.pll Read Only Schema in Oracle APPS 11i Create Oracle FND_USER with System Administrator ( Using Script ) A New Custom Form in Oracle Apps Forms Customization Steps in Oracle Applications Reports Customization Steps in Oracle Applications Your first Migration program in Apps. Migrate Customers FNDLOAD for Oracle Web ADI API to Update FND_USER and Add Responsibility Forms Personalization Example 1 1

Upload: api-27048744

Post on 11-Apr-2015

4.466 views

Category:

Documents


1 download

DESCRIPTION

all the stuff of oracle apps technical by anil passi forum

TRANSCRIPT

Page 1: Oracle.anilpassi

Basics Of Oracle Apps Training Material (Step by Step Learning of Oracle Apps)

What happens when you login to Oracle Apps?

Why is it called apps?

What is a profile option?

What is org_id. Why is it important.

Relationship between Applications and Modules

Where to find/deploy the code (Forms tier/Middle tier or DB Tier)

The testing cycle in Oracle Apps

Difference between forms and form functions and menu

What is a Concurrent Program

What is concurrent Manager

What is a Value set

What is a lookup in oracle apps

How does lookup differ from Value Sets

Descriptive Flex field Basics in Oracle Apps

How to make context sensitive descriptive flexfields ( step by step)

Key Flex fields Basics

Setting up your PC for development environment

Your first custom form from scratch

Your first pl/sql concurrent program from scratch

Oracle FNDLOAD Script Examples

Restart or Bounce Apache in Oracle Apps 11i

Playing with CUSTOM.pll

Read Only Schema in Oracle APPS 11i

Create Oracle FND_USER with System Administrator ( Using Script ) 

A New Custom Form in Oracle Apps

Forms Customization Steps in Oracle Applications

Reports Customization Steps in Oracle Applications

Your first Migration program in Apps. Migrate Customers

FNDLOAD for Oracle Web ADI

API to Update FND_USER and Add Responsibility

Forms Personalization Example 1

Various Examples of Forms Personalization’s [ Everything that you wanted to know about FP ]

Oracle Fusion Development Tools

Debugging In Oracle Applications

XML Publisher Concurrent Program Report

Audit Trail in Oracle Apps

Hierarchy Profile Options in Oracle Apps

1

Page 2: Oracle.anilpassi

Design and Development of Open Interfaces in Oracle Apps

Customization of Reports in Oracle Apps

How to find the Request Group for Concurrent program

Smart Descriptive Flex fields

Using XML Publisher with Pre-Printed Stationary  

Procure to Pay, Order to Cash, End to End Cycle Functional Documents

What happens when you login to Apps?

Firstly and surely there is a URL for oracle applications that is structured possibly in below format, although it can vary from version of apps.http://machinename:portnumber/OA_HTML/US/ICXINDEX.htmhttp://machinename:portnumber /oa_servlets/AppsLoginWhen you join an Oracle Apps development team for an employer, you will first be given URL of the development environment.

In any Oracle Apps implementation project (assuming it has gone live), there are minimum of three environments, each with different URL's and different database instances.

These are:----------------Development environmentTesting environmentProduction environment

You will most probably, as a techie, be given url,username ad password of the development environment.

What happens when you login(no advanced info here):---------------------------------------A. Your login gets authenticated against a table named fnd_user for your username and password. The screen below is where username and password defined. This screen is called user definition screen. Only system administrators have access to this screen.

B. As you can see above, this username xxpassi is attached to two responsibilities (this will be discussed in details in latter training lesson). It is this assignment to the responsibility that controls what a logged in person can do and can't do. In layman’s words, a responsibility is a group of menu.

2

Page 3: Oracle.anilpassi

C. When you successfully login you will see below screens.

This screen below will prompt you to change your password, to a value different than that assigned by System Administrator.

Click on either of the above Responsibility Names, will initiate Oracle Apps( Note: You might be prompted to install jinitiator…..just keep clicking OK…OK for all Jinitiator messages). Effectively, what I mean to say is that you do not need to download jinitiator from anywhere; Oracle will do this automatically (provided your DBA’s got this cofig’ed) for you during your first logon attempt from the PC. Once your jInitiator gets installed

3

Page 4: Oracle.anilpassi

Hurray, we have logged into apps.

Some notes on advanced info (beginners may ignore this):Oracle internally uses a login named GUEST, prior to invoking validation of actual username. Some people regard this as a security threat, but it isn’t. Your DBA’s can change the “guest” password from its default value after installation.

Oracle uses a DB User account named applsyspub to which it first connects during validation of LOGIN. This user account has very restricted privileges and has access to below objects (primarily for authentication purposes):-FND_APPLICATIONFND_UNSUCCESSFUL_LOGINSFND_SESSIONSFND_PRODUCT_INSTALLATIONSFND_PRODUCT_GROUPSFND_MESSAGES

4

Page 5: Oracle.anilpassi

FND_LANGUAGES_TLFND_APPLICATION_TLFND_APPLICATION_VLFND_LANGUAGES_VLFND_SIGNONFND_PUB_MESSAGEFND_WEBFILEPUBFND_DISCONNECTEDFND_MESSAGEFND_SECURITY_PKGFND_LOOKUPS

Why call it Apps and not Oracle ERP ?

Ever wondered why is Oracle’s eBusiness Suite nicknamed apps?

Is it just the short name of Oracle Applications? Possibly yes, however this question is an excuse for me to explain to you the evolution of APPS schema.

I started working in Oracle Financials 9 years ago. Those days each module had its own database schema(which we still have). However, a purchasing user (until version 10.6) used to connect to PO schema (by the virtue of the screen being a PO screen).

Hence, if a report or screen of AR ( Oracle Receivables ) module wanted to access a table named PO_HEADERS_ALL, they would then use notation PO.PO_HEADERS_ALL

However, now we have several database schemas(in most cases one schema per module).

The tables are still owned by their respective schema, but now we have a central schema named APPS. Oracle ERP simply connects to APPS database schema for all its operations(with a couple of exceptions that are best ignored for now).

Hence, if Oracle wants to create anew table named PO_HEADERS_ALL, they will do the following

Step 1. Connect to po/po@XX_DEVDBCreate table PO_HEADERS_ALL ( ...all columns here )

Step2. Grant all on po_headers_all to apps ;

Step 3. connect to apps/apps@XX_DEVDBCreate or replace synonym PO_HEADERS_ALL for PO.PO_HEADERS_ALL

By following the above steps, as you can see, APPS schema is able to access PO_HEADERS_ALL without the notation po.po_headers_all

In Oracle ERP, now we have 100s of schemas, example po, ar, ap, gl etc.

But the screens, reports, workflows etc in Oracle Applications connect to APPS schema only. Just like saying, ALL ROADS LEAD TO ROME. Here, all schema lead to APPS.

Hence if you have a pseudo report that joins ap_invoices_all table( in AP schema) to PO_HEADERS_ALL table( in AP schema), you will simply need to do the below once connected to APPS.

Selelct 'x’ from po_headers_all p, ap_invoices_all a where a.po_Id = p.po_Id

Note, prior to version 10.6(of Oracle ERP –not database version), one had to do

5

Page 6: Oracle.anilpassi

Selelct 'x’ from PO.po_headers_all p, AP.ap_invoices_all a where a.po_Id = p.po_Id

Note: To keep matters simple, I haven’t considered org_Id in this example.Org_Id will be covered in one of the following chapters ( have a look at index).

Moral of the Story is:- All the pl/sql packages will be created in APPS SchemaAll the views will be created in APPS SchemaFor each table in individual schema, there will exist one synonym in APPS schemaTables are not created in APPS schema.Every implementation has at least 1 custom schema, where custom tables are created.For each custom table created by you, you will need to create a Synonym in APPS schemaAs a developer, you will either connect to APPS Schema or to the custom schema where you will create new tables.

Some notes:-Custom tables are generally required in Oracle ERP because:-1. You wish to create a custom screens ( your own screen to capture some info) for a functionality that is not delivered by Oracle2. Pre-Interface tables ( Interface will certainly be discussed in one of the latter chapters)3. Temp processing4. Staging of data for third party extract interfaces….and much more

What are Profile Options in Oracle Apps ?

Profile Options provide flexibility to Oracle Apps. They are a key component of Oracle Applications, hence these much be understood properly. I will be taking multiple examples here to explain what profile options mean. I will also try to explain by stepping into Oracle shoes "How will you design a program that is flexible", by using Profile Options.

Following that, if you still have questions regarding profile options, then leave a comment and I promise to respond. For the learners of Oracle Apps, understanding profile options is mandatory.

What is profile option?The profile option acts like a Global Variable in Oracle.

Why does Oracle provide profile options?These are provided to keep the application flexible. The business rules in various countries and various companies can be different. Hence the profile options are delivered by Oracle in such a manner to avoid hard-coding of logic, and to let the implementation team at site decide the values of those variables.

Enough definitions, give me some scenarios where profile options are used by Oracle....1. There are profile options which can turn the debugging on, to generate debug messages. Say one of 1000 users reports a problem, and hence you wish to enable debugging against just that specific user. In this case you can “Turn On” the debugging profile option "again that specific user".2. There are profile options that control which user can give discount to their customers at the time of data entry. You can set profile option "Discount Allowed" to a value of either Yes or No against each Order Entry user.3. Lets assume an Organization has department D1 and D2. Managers of both the Departments have "HRMS Employee View" responsibility. But you do not want Manager of D2 to be able to see the list of Employees in Organization D1. Hence you can set a profile option against the username of each of these users. The value assigned to such profile option will be "Name of the Organization" for which they can see the employees. Of course, the SQL in screen that displays list of employees will filter off the data based on “logged in users profile option value”.

6

Page 7: Oracle.anilpassi

Let’s take an example. Let’s assume you are a developer in Oracle Corporation building a screen in ERP. Let us further assume that you are developing an Order Entry screen.Assume that business requirements for your development work is:-1. Screen should be flexible to ensure that different users of the screen can give different levels of discounts. For example, a clerk Order Entry User can give no more than 5% discount. But Sales Manager can enter an Order with 15% discount.2. There should not be any hard-coding regarding the maximum permissible discount.3. In the screen there will be a discount field.4. When the discount value is entered in discount field, an error will be raised if user violates the maximum permissible discount.

Here is how Oracle will code this screen1. They will define a profile option named "OEPASSI Maximum Discount Allowed".2. The short name of this profile option is "OEPASSI_MAX_DISCOUNT"2. In the when-validate-item of the discount field(assuming Oracle Forms), following code will be writtenIF :oe_line_block.discount_value > fnd_profile.value('OEPASSI_MAX_DISCOUNT') THENmessage( 'You can’t give discount more than ' || fnd_profile.value('OEPASSI_MAX_DISCOUNT') || '%' ) ;raise form_trigger_failure ;-- I mean raise error after showing messageEND IF ;

Here is how, the client implementing Oracle Order Entry will configure their system.1. Navigate to System administration and click on system profile menu.2. For Clerk User(JOHN), set value of profile "OEPASSI Maximum Discount Allowed" to 5For Sales Manager User(SMITH), set value of profile "OEPASSI Maximum Discount Allowed" to 15

Question: This sounds good, but what if you have 500 Order Entry Clerks and 100 Order Entry Sales Managers? Do we have to assign profile option values to each 600 users?Answer : Well, in this case, each Clerk will be assigned Responsibility named say “XX Order Entry Clerk Responsibility”Each Sales Manager will be assigned Responsibility named say “XX Order Entry Sales Manager Responsibility”In this case, you can assign a profile option value to both these responsibilities.“XX Order Entry Clerk Responsibility” will have a value 5% assigned against it. However, “XX Order Entry Sales Manager Responsibility” will have a profile option value of 15% assigned.In the when-validate-item of the discount field, following code will then be writtenIF :oe_line_block.discount_value > fnd_profile.value('OEPASSI_MAX_DISCOUNT') THENmessage( 'You can’t give discount more than ' || fnd_profile.value('OEPASSI_MAX_DISCOUNT') || '%' ) ;raise form_trigger_failure ;-- I mean raise error after showing messageEND IF ;

Please note that our coding style does not change even though the profile option is now being assigned against responsibility. The reason is that API fnd_profile.value will follow logic similar to below.Does Profile option value exist against User?--Yes: Use the profile option value defined against the user.--No: Does Profile option value exist against Responsibility-----Yes: Use the profile option value defined against the current responsibility in which user has logged into.-----No: Use the profile option value defined against Site level.

7

Page 8: Oracle.anilpassi

Profile Options Examples Screenshots

You have reached this page from Profile Options Training Article

Firstly, lets define the responsibility for Clerk, as we discussed in Article.

Next, lets define the sales manager responsibility, as we discussed in Article.

Lets define user JOHN, that is Clerk

8

Page 9: Oracle.anilpassi

And also, lets define user SMITH ( Sales manager )

Now, we need to define the profile option for discount, hence go to responsibility "Application Developer"

When you click on menu "Profile" above, you will then see below screen for defining profile option. Please note that the "Name" field is the short name of profile option, and it is this name used in API call to FND_PROFILE.value

Now, after having defined a profile option, its time to assign these to JOHN & SMITH.

9

Page 10: Oracle.anilpassi

Hence go to responsibility "System Administrator"

Click on Menu Profile/System, as below

The profile option assignment screen looks like below. Enter JOHN in USER, OEPASSI% in Profile, to select profile named "OEPASSI Maximum Discount Allowed"

Assign a value of 5 to the user.

Click on torch, to return to search screen as below

10

Page 11: Oracle.anilpassi

and this time we will assign value of 15 against user SMITH.

OK, what if we have too many clerks, we can also simply assign profile value to Responsibility of Clerk. Doing so, all the users that use this responsibility, will inherit profile option value against Responsibility.

Assign 5% max discount for Clerks

Now, lets sel ect Sales Manager responsibility in profile screen

11

Page 12: Oracle.anilpassi

Search on this...as below......

Assign value 15% to Sales Manager responsibility.

That's it for setup.Any questions? leave your question by click on link Leave Comment for this article

ThanksAnil Passi<!--[if !vml]--><!--[endif]-->

ORG_ID and Multi Org In Oracle Apps

In this Oracle Apps training article, we will learn about org_id. I hope that you have read and understood the significance of profile options that we discussed in the earlier chapter.

Before I tell you what is org_id, lets do some questions & answers:-

Why do we need org_idIn any global company, there will be different company locations that are autonomous in their back office operations. For example, lets take the example of a gaming company named GameGold Inc that has operations in both UK and France.

Please note the following carefully:-1. This company(GameGold Inc) has offices in both London and Paris2. UK has different taxation rules that France, and hence different tax codes are defined for these countries.3.GameGold Inc has implemented Oracle Apps in single instance(one common Oracle Apps database for both UK & France).4. When "UK order entry" or "UK Payables" user logs into Oracle Apps, they do not wish to see tax codes for their French sister company. This is important because French tax codes are not applicable to UK business.5. Given the single database instance of GameGold Inc, there is just one table that holds list of taxes. Lets assume that the name of the Oracle table is ap_tax_codes_all6. Lets assume there are two records in this table.Record 1 tax code -"FRVAT"Record 2 tax code - "UKVAT"7. Lets further assume that there are two responsibilitiesResponsibility 1 - "French order entry".Responsibility 2 - "UK order entry"

12

Page 13: Oracle.anilpassi

8. Now, users in France are assigned responsibility 1 - "French order entry"9. Users in UK will be using responsibility named "UK order entry"10. In the Order Entry screen, there is a field named Tax Code(or VAT Code).11. To the French user, from the vat field in screen, in list of values UKVAT must not be visible.12. Also, the "French order entry" user should only be able to select "FRVAT" in the tax field.13. Similarly, UK order entry user, that uses responsibility "UK Order Entry", only "UKVAT" should be pickable.

How can all this be achieved, without any hard coding in the screen.Well....the answer is org_id

ORG_ID/Multi-Org/Operating Unit are the terminologies that get used interchangeably.

In brief steps, first the setup required to support this....The screenshots are at the bottom of the article1. You will be defining two organizations in apps named "French operations" and "UK Operations". This can be done by using organization definition screen.2. In Oracle Apps, an organization can be classified as HRMS Org, or Inventory Warehouse Org, or Business Group, Operating Unit Org or much more types. Remember, Organization type is just a mean of tagging a flag to an organization definition.3. The two organizations we define here will be of type operating unit. I will be using words org_Id & operating unit interchangeably.4. Lets say, uk org has an internal organization_I'd =101And french org has orgid =102.

Qns: How will you establish a relation betwee uk responsibility and uk organization.Ans: By setting profile option MO : Operating unit to a value of UK Org, against uk order entry responsibility

Qns: How will the system know that UKVAT belongs to uk org?Ans: In VAT code entry screen(where Tax Codes will be entered), following insert will be doneInsert into ap_vat_codes_all values(:screenblock.vatfield, fnd_profile.value('org_id').Alternately, use USERENV('CLIENT_INFO')

Next question, when displaying VAT Codes in LOV, will oracle do: select * from ap_vat_codes_all where org_id=fnd_profile.value('ORG_ID')?Answer: almost yes.

Oracle will do the following1. At the tme of inserting data into multi-org table, it will do insert into (vatcode,org_id) ....2. Creates a view in apps as belowCreate or replace view ap_vat_codes as Select * from ap_vat_codes_all where org_id = fnd_profile.value('ORG_ID')3. In the lov, select * from ap_vat_codes ,

If the above doesn't make sense, then keep reading.

May be quick revesion is necessary:_1. In multi org environment(like uk + france in one db), each Multi-Org Table will have a column named org_id. Tables like invoices are org sensitive, because UK has no purpose to see and modify french invoices. Hence a invoice table is a candidate for ORG_ID column.By doing so, UK Responsibities will filter just UK Invoices. This is possible because in Apps, Invoice screens will use ap_invoices in their query and not AP_INVOICES_ALL.2. Vendor Sites/Locations are partitined too, because UK will place its ordersfrom dell.co.uk whereas france will raise orders from dell.co.fr. These are called vendor sites in Oracle Terminology. 3. Any table that is mutli-org (has column named org_id), then such table name will end with _all4. For each _all table , Oracle provides a correspondong view without _all. For examples create or replace view xx_invoices as select * from xx_invoices_all where org_id=fnd

13

Page 14: Oracle.anilpassi

_profile.value('org_id').5. At the time of inserting records in such table, org_id column will always be populated.6. If you ever wish to report across all operating units, then select from _all table.7. _all object in APPS will be a synonym to the corresponding _all table in actual schema. For example po_headers_all in apps schema is a synonym for po_headers_all in PO schema.8. When you connect to SQL*Plus do the belowconnect apps/apps@dbapps ;--assuming 101 is French Org Idexecute dbms_application_info.set_client_info ( 101 );select tax_code from ap_tax_codes ;---Returns FRVAT

--assuming 102 is UKOrg Idexecute dbms_application_info.set_client_info ( 102 );select tax_code from ap_tax_codes ;---Returns UKVAT

Now some screenshots

14

Page 16: Oracle.anilpassi

In this training chapter I will explain what Application means, in Oracles context.

As a thumbrule, for one module there is one single application.

Uptill 8 years ago, it was mandatory for each table to be registered against an Application in Oracle Financials; but now such a relation no longer exist.

Oracle is a mixture of various applications like Payables, General Ledger, Payroll, Human Resources, manufacturing. You can call these modules, but officially these are called applications. Hence the name Oracle Applications(i think)

Is there a relation between application and table:-Indirectly/logically there is, as the table is owned by a specific schema, and then a schema is related to an Application( though logically, as this relation is not enforced by the System).

What precautions do I take when creating a new table in oracle apps:-Ans: Find out from DBA's the schema in which your custom tables are meant to be created. Create the desired table in custom schema. Note: If your custom table will support multi-org, then its name must finish with _all and also it must have a integer column named org_id

Qns: For an Oracle Apps developer, what else must be the consideration with respect to Application.Ans: I will jump the training ship to explain this. In case you do not understand, then wait for the training lesson on concurrent programs.a. Each program has an executable. For example reports have rdf, sql*plus has .sql file, forms has .fmx, Unix Shell Script has .prog(in apps) & D2k libraries have .plxb. When you register an executable with Oracle Apps, you must then register this against an Application.c. Each application is mapped to a specific path,say to a directory in unix box. For example, Applicaton XXPO (that holds PO Customizations) may map to /home/oracle/apps/appl/pod. Say you have developed/customized a report for PO Module. Assume your report executable name is XXPOPRINT.rdf . If you register this executable with XXPO applicaton, then this rdf must be copied/ftp'ed to /home/oracle/apps/appl/poe. When running this report in Oracle Apps, oracle will ask below series of questions to itselfI see that user is running XXPOPRINT.rdf, which applicaton is this report registered against? Oh well, it is XXPO application, then where is the directory location where I can expect to find this file? Oh ok, application definition of XXPO is mapped to /home/oracle/apps/appl/po (as per application definition), hence lets pick the rdf from /home/oracle/apps/appl/po/reports/USHere lies the significance of applicaton in oracle apps.

Now some notes:-1. Profile options can be defined at application level too.2. All the Forms & Reports are attached to an Application.3. Each application has a base path, which effectively is also the Environment variable on operating system.

The below image can be clicked to see how applications are defined in Oracle Apps. One needs to navigate to System Administrator responsibilotu. and select Menu /Application/Register.As a developer, it is not your responsibility to define this, however I suggest that you understand this well.

16

Page 17: Oracle.anilpassi

Oracle Apps Deployment Training

When you are a fresh new Oracle Apps developer, your fundamental question is...where to find the piece of code that you are being asked to customize?Before I begin to explain you this, first some fundamentals.

1. You will most likely find that any implementation of oracle apps will involve at least two machines, i.e. Database tier and then at least one web tier.

2. Oracle thought very logically to decide which executable runs on database tier and which on web/forms tier(also known as mid-tier).Any executable that has intense database operations is stored at database tier. To give you some examples.... sql files, oracle report java concurrent programs, sql*loader are all deployed in database tier of Oracle Applications.

3. Any executable that has intense UI operations is deployed at forms tier. Examples are Oracle Forms fmx files, jsp files, pll/plx etc.

Qns: The above sounds good in most cases, but what if you have to build a form that has intense database processing.Ans: Well the form will still be deployed in the mid-tier, otherwise your form will never be run. However, for such forms, you must handle most of the database processing within pl/sql packages. The api's that you build in pl/sql must have well defined parameters.I am saddened to see that some apps programmers write tons of sql code/DMLs inside the oracle forms triggers. In this era of high speed networks, such aproach may be justified to an extent, but what if some other developer desires to use validations developed for your form in other areas of apps.? Hence building pl/sql api's is the preferred approach.

Qns: Why do we have multiple middle tiers for one database.Ans: Most implementations install multiple mid-tiers to distribute the user load. The user requests are first sent to a load balancer switch, this switch the decides which middle tier to use. Hence, if one server has 1000 user cpacity, then you can have 5mid tiers to handle 5000 concurrent users.

Qns: That's fine for the theory, but how do multiple mid-tiers impact my forms deployment?Ans: You will need to deploy your forms file to each middle tier machine (unles shared APPL_TOP) has been implemented.

Qns: Where do I pick the fmb files delivered by oracle?Ans: These are picked from $AU_TOP/forms/us

Qns: Where do I deploy the fmx file on mid tier, assuming a purchasing screen has been customized.Ans: This will be deployed at $XXPO_TOP/forms/usBasically by deployment I mean that fmx file will be copied to xxpo_top/forms/us

17

Page 18: Oracle.anilpassi

Have you read the previous article on applications?

Qns: Where do I deploy a pl/sql package?Ans: All of the pl/sql packages are installed in apps schema.This includes your custom packages and also oracle delivered packages.

Qns: Ehere do we create the database views?Ans: Views will be created in apps schema too.

Qns: How do I generate fmx, should this be done on pc or on the mid tier?Ans: This must always be done on the mid tierFor example use below stepsStep 1FORMS60_PATH=$FORMS60_PATH:$AU_TOP/forms/US

Step 2export FORMS60_PATH

Step 3cd $XXPO_TOP/forms/US

Step 4 ----Below in one single linef60gen module=XXPOSCREEN.fmb userid=apps/apps module_type=form batch=no compile_all=special

Qns:I have deployed the form at $XXPO_TOP but I can't run it,I get message can not find formAns: Firstly find out the application to which this form is registered against. In reality the forms are attached to form functions and it is the form function that is attached to an application

Qns: How can I generate CUSTOM.pll or any other Forms LibraryAns:----Below statements in one single linecd $AU_TOP/resourcef60gen module=$AU_TOP/resource/CUSTOM.pll userid=apps/apps output_file=./CUSTOM.plx module_type=LIBRARY

f60gen module=$AU_TOP/resource/XX_POENT.pll userid=apps/apps output_file=./XX_POENT.plx module_type=LIBRARY

Qns: All the above sounds good, but how on earth do I connect to Mid Tier to generate formsAns: For Mid-Tier server, you will be provided with a Unix Username & Password. Before you start moaning, let me clarify that I assume that hosting o/s will be Unix. As soon as you logon to your mid-tier, your environment should automatically be setup based on scripts within .profile file. To know whether your environment has been setup on Unix box, do the below:echo $FND_TOPIf the above returns blank, then it means you need to contact your DBAs to find out why environment variables are not being populated on your sign-on to Unix...Ditto for DB Tier

Please let me know if you have any questions.

Oracle Apps Training Testing Environments

In every implementation, there are always more than one environments in Oracle Apps.

18

Page 19: Oracle.anilpassi

The rule of thumb states that below environment are a must:-1. Development environment, where developers usually have System Administrator responsibility and also the apps password. If not System Administrator then at least they should have access to "Application Developer" responsibility.

2. Testing environmentDevelopers usually do not and must not have apps password to this environment . This is where users sign-off customizations or even setup changes.

3. Production environmentThis is where the business runs

Optional environments:-

CRP environmentConference room pilot environment is where usually implementation team gets buying to their product offering from user community, during implementation. This environment is usually used for sign off during new implementations.

Patching environmentThis is where all new Oracle Patches are sanity tested.

Support environmentThis environment is exclusive to support staff. This environment is usually the most frequently cloned environment in Oracle Apps site that has gone live. Frequent cloning helps the Oracle Applications support staff to reproduce production issues

Migration EnvironmentThis is where repeated data migration can take place before migration code gets frozen and ready for UAT.

User Training EnvironmentSome clients mix this with the CRP itself. But post-goLive of APPS, when rolling out new module, an environment like this comes handy.

You as a developer do not need to worry about these environments, as your focus will be on Development Environment only.

Now some notes:-1. There can be more than one development environment at any implementation site, when different big modules are being implemented, all having different timelines. However, the changes to each environment are UAT'ed on a common Test environment.2. The development to production cycle is.... Developer does development & unit testing on Development Environment, and their code gets promoted to User Testing environment. Following this, the changes get applied to Production environment.3. The changes done to "development environment" must be scripted in all cases where possible. As a thumb rule, everything except for Functional Configuration can be scripted. You may be intersted in FNDLOAD Link

Oracle Forms Functions Menus and their relationship

Every screen we develop delivers a business functionality of sorts. Notice the word functionality.Hence the word function or call it "Form Function" is related to Oracle Forms.

You all know that a form is nothing but a screen from where users can enter or retrieve(query) existing data.

19

Page 20: Oracle.anilpassi

Qns: In Oracle why do we have a form and then also a Form Function? Isn't just having a Screen/Form just good enough?Ans: What if, for the same form, you wish to provide slightly different functionalities depending upon which menu is clicked to invoke that form??

Question: Are there any examples?Answer: Lets assume the following

There are two responsibilities------------------------------Payables Manager responsibilityPayables clerk responsibility

There is one form for invoices------------------------------Payables invoice screen

Our requirement-------------------------------If invoice screen is invoked from Payables Manager Responsibility, then at startup of the screen we want to provide a "Search Window", so that manager can search for the invoices to review

If the invoice screen is invoked from "Payables Clerk Responsibility", then at startup of the screen we want to provide "Invoice Data Entry window", so that clerk can begin entering the invoices.

The form will have following code within it in when-new-form-instance.If :parameter.invoice_mode='MANAGER' thenGo_block(lfind_invoices')Elsif :parameter.invoice_mode='CLERK' thenGO_BLOCK('invoice_header'),End if;

Question: From above example it appears that form function will be passing parameter named invoice_mode to the form?Answer. Correct in this case.So that we understand how things hang together.Invoice form is attached to a Form Function, when defining the Form Function we pass parameters to it. Then this Form Function is attached to the Menu, and it is the Menu that gets attached to responsibility.

Question : Oh dear,are the form functions all about parameters?Answer: Parameters is the main feature of Form Functions. But there are others too.As you know from previous training lessons, each form will be located in a specific directory on Unix box. For example, Purchasing Form executables will be in $PO_TOP/foms/USAnd account payables form executables will be located in $AP_TOP/forms/US.

Did you wonder how Oracle will know to look for a payables form executable in AP_TOP and not in PO_TOP??Oracle will think like this...hmm user clicked on a menu, what is the form function for this menu...hmm it is InvoiceReview....ok...what is the application assigned to the for form function...oh...its ap(account payables) application...right....what is the base path for this application...rite..it is AP_TOP...lets then run the fmx file from ap_top/forms/us

Screenshots for examplesA. Go to application developer click on menu /application/formDefine you form...remember, oracle will expect an executable of .fmx for this name

20

Page 21: Oracle.anilpassi

Click on menu /application/functionDefine your two functions, invoice review, invoice entry, pass them parameters as below.

Login to Oracle Apps , and select responsibility "Application Developer"

Navigate the menu "Form"

Define the Form as below

Now, lets define the function

21

Page 22: Oracle.anilpassi

Do you wish to know the name of form that has approx 600 functions defined in oracle apps? To find the answer, click on interview questions link.

Concurrent Programs in Oracle Apps An article on very basics of Concurrent Program, for beginners that follow http://getappstraining.blogspot.com.

Lets first discuss the below scenario

Being a developer, you have just developed a SQL script or a PL/SQL package procedure. The end user wants to be able to run this script ad-hoc or they wish to schedule this to run every night.

Question : How can an end-user be given control to run a script developed by a developer, given that an end user will never have access to apps password(and rightly so)?Answer: This script can be attached to a Concurrent Program via a concurrent program executable. The user will then be given access to this Concurrent Program.

Question : But how will the end user or Oracle Apps make this script run every 10hours daily?Answer : A concurrent program can be scheduled to run at desired intervals. The schedule is defined at the time of submission.

Question: What are the different types of scripts/programs that can be attached to concurrent programs?Answer : A sql scriptA Sql*Loader programJava programOracle ReportPl/SQL program ( or call it a stored procedure/package procedure)Host script, like a unix shell scriptPro*C/SpawnedPerl

Question: What are the basic steps when defining a concurrent program.Answer: Broadly speaking there are three steps when developing a concurrent program in Oracle AppsStep 1. Make Oracle Apps identify the executableStep 2. Provide a handle to the executable by means of defining a concurrent programStep 3. Make this concurrent program accesible to selected users via their responsibility.

Question: Please can you describe the above steps in detailAnswer: Step 1. Make Oracle Apps identify the executableIn Oracle Apps we have something called as concurrent program executable. Concurrent program executable is defined to register a script or a procedure for its usage within oracle

22

Page 23: Oracle.anilpassi

apps.

Step 2. Provide a handle to the executable by means of defining a Concurrent Program.We need to define a concurrent program and attach that to the executable defined in above step.

Step 3. Make this concurrent program accesible to selected users via their responsibility.We do this by adding the concurrent program to something called as request group. The request group is either associated with a responsibility or is passed in as a parameter to the function request form function. Don't worry if you do not understand this step, I will be writing a dedicated article to explain this step.

Question : Please explain the steps for defining a pl/sql concurrent program, with screenshots and with almost real life example?Answer: 1. Create a table and a stored procedure in pl/sqlcreate table xx_hello_world_tab( message_text VARCHAR2(100) ,creation_date DATE) ;

CREATE OR REPLACE PROCEDURE xx_register_user_prc(errbuf      OUT VARCHAR2,retcode     OUT VARCHAR2) ISBEGIN  INSERT INTO xx_hello_world_tab VALUES ('Hello World' ,SYSDATE);END xx_register_user_prc;

SELECT * FROM xx_hello_world_tab ;--Zero records will be returned here

2. Note the two parameters, namely errbuff and retcodeThese parameters for used for the interaction between the concurrent program and the pl/sql Program. I suggest to the beginners not to spend much time on these parameters.

3. Define an executable attached to this procedure.This can be done by navigating to the responsibility “Application Developer”, and selecting the menu /Concurrent/Executable

4. Define the concurrent programThis can be done by navigating to responsibility “Application Developer” and then selecting

23

Page 24: Oracle.anilpassi

menu /Concurrent/Program

5. Attach this program to a report group.Go to System Administrator responsibility, and select/Security/Responsibility/Request

Now, we can navigate to the Receivables Manager and submit the concurrent request.

24

Page 25: Oracle.anilpassi

After the completion of the request, we check the table

Concurrent manager in Oracle Apps Lets discuss the very basics of Concurrent Managers, again the very basics for the beginners that read http://getappstraining.blogspot.com Two things are obvious:-1. Concurrent Manager is related to Concurrent  Programs2. Concurrent manager manages the concurrent(oops I mean parallel) execution of concurrent programs.

So what's left to explain?.....Well nothing much, but I gave a commitment to one of my readers that I shall write something about concurrent managers today. And now when I begin to write, I realize it is worth writing something in plain English on this topic.

Lets explain this with some Q&AQuestion : How to run a concurrent program?Answer: In oracle apps you have a concurrent program submission screen. You can submit the concurrent program from that screen.

Question: What happens when you submit a concurrent program?Answer: There is something known as Concurrent Manager that runs in the background all the time. This background process, called Concurrent Manager ideally will be running 24x7.As the name suggests, purpose of a concurrent manager is to manage the submitted concurrent programs.

Question: When I submit a concurrent program( or call it concurrent request), how does

25

Page 26: Oracle.anilpassi

concurrent manager pick this up?Answer: Concurrent manager will be running in the background waiting for a concurrent program to be submitted. As soon as a concurrent program is submitted, it then gets put in an execution queue by concurrent manager.

Question: Why does the Concurrent manager put a concurrent program into a queue? Why doesn't the manager simply let the program run?Answer: Because at any given point in time a concurrent manager can run no more than say 10 programs concurrently. This figure of 10 is configurable of course. First the manager puts a submitted program into a queue, next the manager checks if there is a slot available (i.e. Less than 10 programs are currently running). If a slot is found available, the concurrent manager then runs the program, or else it keeps the concurrent program in a queue with status Pending.

Question: If we have two concurrent programs, that must never run in parallel(oops I mean concurrently)....can concurrent manager manage such scenarios?Answer: Of course it can. When you define a concurrent program, you can specify if there are any incompatible programs. If incompatible concurrent programs exist, then concurrent manager will wait for the incompatible program to complete.

Question: Is that all what concurrent manager does?Answer: Much more, if interested, then read on….

Concurrent manager is responsible for below things too…..

Managing the printer:-An Oracle Report is registered as a concurrent program too. During submission or during the definition of concurrent program, we can specify the printer where report gets printed. Concurrent manager will send the output of the program to that printer.

Managing the programs completion status-For example a pl/sql concurrent program can set retcode=2 to make a program complete with warning. Hence concurrent manager not just executes the program, but it manages the completion status of the program too.

Classpath of a java program:-A concurrent program can be of type java too. If for this specific concurrent program you wish to use a set of java libraries, then you can specify the path of that library in concurrent program definition. Concurrent manager will amend the CLASSPATH to reflect the path of the java library.

Interaction with host concurrent program-When running a host concurrent program, the concurrent manager passes the apps password as a parameter to the unix script

Tracing a concurrent programConcurrent manager enable the session trace for the concurrent program, if enable trace checkbox is checked in program definition. You can then go to user dump directory and do tkprof on the file.

Optimization options:-The concurrent program definition provides an option to specify optimization mode, like choose, fist rows,all rows, rule based etc. The concurrent manager will alter the optimization mode of the session before the submission of the program. Obviously this option has no relevance to Host type concurrent program.

More? ...well I am bored with concurrent managers now, I guess you too are by now....

Value set basics in Oracle Apps An article on Value Sets, for beginners that follow http://getappstraining.blogspot.com Question: What is value set?

26

Page 27: Oracle.anilpassi

Answer: It is a set of values

Question: Why do we need value sets?Answer: You do not always want a user to enter junk free text into all the fields. Hence, Oracle Apps uses value set to validate that correct data is being entered in the fields in screen.

Question: Is value set attached to all the fields that require validations?Answer : A big NO

Question: Then where lies the usage of value sets?Answer: Broadly speaking, value sets are attached to segments in Flexfields. You can argue that value sets are also attached to parameters of concurrent program(but in reality oracle treats parameters as Descriptive Flexfields)

Question: This is insane, flexfields haven’t been covered in http://getappstraining.blogspot.com as yet?Answer: Agreed, hence let’s restrict value set explanation to their usage in concurrent program parameters.

Question: Any examples?Answer: For the namesake, lets add a Parameter to the concurrent program that we defined in “Concurrent Program Training Lesson link”. Lets add a parameter named “cost centre”, the values to this parameter must be restricted to one of the three values, i.e. HR, SEC, IT.

At the time of submission of the concurrent program the user should be able to pick a cost centre from a list. This is where value set gets used.

Lets now define a simple value set as described above.

Step 1. Go to Application Developer, and select menu /Validation/Set

Step 2. Now define a value set of type Independent. We will cover the other most widely used Type “Table” latter.

27

Page 28: Oracle.anilpassi

Step 3. Now, lets add three independent values to the value set for this Cost Centre list. Hence click on menu Values within Validation

Step 4. Here we add the values for IT, HR, SEC to this independent value set.

“CONTROL-S” to save the data

Step 5. Now let us go back to Concurrent Program that we created in earlier training lesson and Click on Parameters

28

Page 29: Oracle.anilpassi

Step 6. Now lets create a parameter, and attach the value set that we created to this parameter.

Step 7.Now to test this, lets go to receivables manager and click on Requests.

29

Page 30: Oracle.anilpassi

Click on Request,

Step 8.Submit New Request, and then click on OK.

Step 9 Now, we can see the values defined in the value set here.

Lookup Types and Lookup codes in Oracle Apps

30

Page 31: Oracle.anilpassi

An article on Lookups, for beginners that follow http://getappstraining.blogspot.com Question : What is a lookup in Oracle AppsAnswer: It is a set of codes and their meanings.

Question: Any examples?Answer: The simplest example is say a lookup type of Gender.This will have definitions as belowCode    Meaning------        -------------M            MaleF             FemaleU            Unknown

Question: But where is it used, any examples of its usages?Answer: Let us say that there is a table for employees, and this table named PER_PEOPLE_F & has following columns----FIRST_NAMELAST_NAMEDATE_OF_BIRTHGENDER

Question: Will the gender column in above table hold the value of M or F or U?Answer: Correct, and the screen that displays people details will in reality display the meaning of those respective codes (i.e. Male, Female, Unknown etc) instead of displaying the code of M or F or U

Question: hmmm...so are lookups used to save the bytes space on database machine?Answer: Noooo. Imagine a situation as belowa. There are 30,000 records in people table of which 2000 records have gender value = U. In the screen, their Gender is being displayed as "Unknown". Now let’s say you want this to be changed to "Undisclosed". To implement this change, all you have to do is to change the meaning of the lookup codes for lookup type GENDER. Hence it will look likeCode    Meaning------    -------------M         MaleF          FemaleU         Undisclosed

Here lies the beauty of lookups, you do not need to modify 2000 odd records in this case.

Question : Any other usage of lookups?Answer : Sure, lets take another example. In HRMS, there is a field named Ethnicity. By default Oracle ERO delivers the below valuesLookup code        lookup meaning----------------        ---------------------AS            AsianEU            European

Now, if your client wants to track Ethnicity at a granular level, they can amend the Oracle delivered lookup definition as below

Lookup code        lookup meaning----------------        ---------------------ASI            Asian-IndianASP            Asian-PakistaniEU            European

Hence these values will then be available in the list of values for Ethnicity field.

31

Page 32: Oracle.anilpassi

Question: Are we saying that all the lookups delivered by oracle can be modified?Answer: Depends. If oracle has a lookup called termination status, and if based on the termination status code Oracle has some rules defined within Payroll Engine....!! Surely Oracle  Payroll Engine will not like it if you end date an existing status code or add a new status code to termination. For this very reason, Oracle flags some lookups as System lookups, and the lookup entry screen will not let you modify those lookup codes.

Question: OK, what if I do not wish to modify existing Lookup codes, but only wish to add new Lookup codes to an existing Oracle delivered Lookup Type?Answer: You can do so, provided the Oracle delivered Lookup Type is flagged as Extensible. Please see the screenshot

Question: Can we add our own new lookup types?Answer: Yes you can, for this you will first define a lookup type and will then define a set of lookup codes against the Lookup Type. In our example above, GENDER is the LOOKUP_TYPE

Question: Does a LOOKUP_TYPE get attached to a Descriptive Flexfield…just like Value Sets?Answer: Not really. There is no direct relation between lookup and Descriptive Flexfield.

Now, the screenshots. Click on the menu as below to invoke Lookup Screen.

Once in the screen, you can define your lookup type and lookup codes as below.

32

Page 33: Oracle.anilpassi

Difference between Lookups and Value Sets

I hope you have read the previous articles on Value Sets and also on Lookups.

It is important for the learners to read things in Sequence. Hence you may decide to browse through the Training Index Page.

Difference 1Value sets can be attached to parameters of a concurrent program, whereas Lookups can't.

Difference 2Certain types of Lookups are maintainable by the users too, for example HR Users will maintain "Ethnic Minority" lookups. Value Sets are almost never maintained by end users, with the exception of GL Flexfield codes. Value sets are usually maintained by System Administrators.

Difference 3Value sets can contain values that are a result of an SQL Statement.Hence it is possible to make Value Set list of values dynamic.On the contrary, Lookup Codes are Static list of values.

Here comes the end of another simple article...

Descriptive Flexfield Basics in Oracle Apps

An article on basics of Descriptive flexfields, for beginners that follow http://getappstraining.blogspot.com A training article on Descriptive flexfields, also refered as DFFFirst some basic Question and answers, and then we will do screenshots detailing how flexfields are configured.

Question: What does DFF mean?Answer: DFF is a mechanism that lets us create new fields in screens that are delivered by Oracle.

Question: Oh good, but can these new fields be added without modifying/customization of the screen?.Answer: Yes, certainly. Only some setup is needed, but no programmatic change is needed to setup DFF.

Question: Why the word Descriptive in Name DFF?Answer: I think Oracle used this terminology because by means of setup...you are describing the structure of these new fields. Or may be Oracle simply used a silly word to distinguish DFF from KFF(discussed in latter training lesson).

Question: Are these DFF's flexible?Answer: A little flexible, for example, depending upon the value in a field, we can make  either Field1 or Field2  to appear in DFF.

Question: So we create new fields in existing screen, but why the need of doing so?Answer: Oracle delivers a standard set of fields for each screen, but different customers have different needs, hence Oracle lets us create new fields to the screen.

Question: Are these new fields that get created as a result of DFF free text?I mean, can end user enter any junk into the new fields that are added via DFF?Answer: If you attach a value set to the field(at time of setup of dff), then field will no longer be free text. The entered value in the field will be validated, also a list of valid values will be provided in LOV.

Question : Will the values that get entered by the user in dff fields be updated to database?Answer: Indeed, this happens because for each field that you create using DFF will be mapped to  a column in Oracle Applications.

33

Page 34: Oracle.anilpassi

Question: Can I create a DFF on any database column?Answer: Not really. Oracle delivers a predefined list of columns for each table that are meant for DFF usage. Only those columns can be mapped to DFF segments. These columns are named similar to ATTRIBUTE1, ATTRIBUTE2, ATTRIBUTE3 ETC. Usually Oracle provides upto 15 columns, but this number can vary. 

Question: Can I add hundreds of fields to a given screen?Answer: This depends on the number of attribute columns in the table that screen uses. Also, those columns must be flagged as DFF enabled in DFF Registration screen. Don't need to worry much about this because all the ATTRIBUTE columns are by default flagged for their DFF usage.

Question: Hmmm, I can see that DFFs are related to table and columns...Answer: Yes correct. Each DFF is mapped to one table. And also each segment(or call it field) is mapped to one of the attribute columns in that table.

Question: I want these fields to appear in screen only when certain conditions are met. Is it possible?Answer: Yes, we have something known as Context Sensitive Descriptive Flexfields.

In Order to do this, we will follow the below steps(screenshots will follow) :- 1.    Navigate to the DFF Registration screen in Oracle Apps and query on Table AP_BANK_BRANCES. Now click on Reference Field2.    Navigate to DFF Segments screen and query on the Title of the “Bank Branch” and Unfreeze the Flexfield and add segments as to Section "GLOBAL Data Elements" as shown in screenshots.

Here are the screenshots......The descriptions are embedded within the screenshots.

We are in "Bank Branches screen" below, that is available in Payables responsibility. We need to add a new field as below.

Once having noted down the table, we try to find the Title of the DFF for that Table. We go to Flexfield/Register

34

Page 35: Oracle.anilpassi

Here we pick the Title of the respective DFF

Query on that DFF Title from Descriptive Flexfield Segment Screen

Add a new segment under "Global Data Elements"

35

Page 36: Oracle.anilpassi

The options for making mandatory or enabling validations for the new field.

Once you finalize the changes, you will be prompted to Freeze the DFF definition. Click on OK

36

Page 37: Oracle.anilpassi

Now, we see the fruits of our configuration

Context Sensitive Descriptive Flexfields

An article on Context Sensitive Descriptive Flexfields, for beginners that follow http://getappstraining.blogspot.com A training article on Context Sensitive Descriptive flexfields.IMPORTANT:- You must read Basics Flexfield article . This article is an extension to the work that we did for a simple flexfields.  First some basic Question and answers, and then we will do screenshots detailing how flexfields are configured.

Question: I want these Flex fields to appear in screen only when certain conditions are met. Is it possible?Answer: Yes, you can. Lets take an Example. You have a "Bank Branch" screen where you enter the Bank names and their branches . There is a field named Branch Type in that screen. You wish to show & capture following new fields:-a.    Banks Country of Origin Field ( regardless of bank branch type, we must show this new field). As we configured in earlier training chapter.b.    If user entered a value of SWIFT in Branch type, then display a new DFF segment "SWIFT Partner field".c.    If Branch type CHIPS is selected by the user, then display a DFF segment "Chip ID" field.

In Order to do this, we will follow the below steps(screenshots will follow) :- 1.    Navigate to the DFF Registration screen in Oracle Apps and query on Table AP_BANK_BRANCES. Now click on Reference Field, and ensure that “BANK_BRANCH_TYPE” field can be used as a context switch. In our case we add this field as a reference field.2.    Navigate to DFF Segments screen and query on the Title of the “Bank Branch” and Unfreeze the Flexfield and add segments as in screenshot below. Register the BANK_BRANCH_TYPE field as a reference item.3. Create the contexts for each possible value of Bank Branch Type field(for which you want conditional display of fields)....

Hmmmm not clear yet, see the the screenshots and you will surely understand......

Find out the table name for Bank Branch screen, this will enable us to find the DFF that is available for

37

Page 38: Oracle.anilpassi

Bank Branch

The Bank Branch can have one of the following values.

Given that our DFF will be sensitive to what we enter in Bank Branch, we must find out name of the field(not the display name). This can be done by using examine as shown

We can see that internal name of the Branch Type is "BANK_BRANCH_TYPE". We need to ensure that a DFF can be made sensitive to the value in BANK_BRANCH_TYPE

38

Page 39: Oracle.anilpassi

Lets navigate to DFF registration screen, and using the table name, we query DFF for AP_BANK_BRANCHES.

Alternately you can query using DFF title too.

39

Page 40: Oracle.anilpassi

Now lets add BANK_BRANCH_TYPE as a REFERENCE Field, by clicking on Button Reference

Now we need to define the new fields(segments). This screen is accessed via menu /Descriptive/Segments . In this screen, lets make BANK_BRANCH_TYPE as the context/reference. This means that DFF will become sensitive to values in Branch Type field

IMPORTANT: If your requirement is not to have any conditiional logic, then no need for all the "Reference Field" blaaa. All you need to do is to add your segment to Global Data Elements

40

Page 41: Oracle.anilpassi

41

Page 42: Oracle.anilpassi

When the user selects Type=SWIFT, we see the relevant SWIFT field appear in Flexfield window

42

Page 43: Oracle.anilpassi

When user selects Type=CHIPS, we see CHIP Id field appearing in Flexfield window.

Here we now see that value entered in DFF field gets stored in the database column,

 

43

Page 44: Oracle.anilpassi

Key Flexfields Basics

Please find an article on the very basics of Key Flexfields.Question : We have already covered Descriptive Flexfield in detail in previous article, should we still bother learning key flexfield?Answer : Indeed we must learn this. When I myself learnt Oracle Apps, all I had was the cryptic definitions in Oracle Manual, and it took me weeks to get my head around the differences between Key Flexfields and Descriptive Flexfields. Now I hope you can learn this crystal clear in minutes.

Question: Key Flexfields help us capture additional fields, and so does descriptive flexfield too? What is the deal here?Answer: Ok, let’s assume for a minute that there is no such thing as a key flexfield. All we have is a descriptive flex (lets assume).Requirement is this:-Your client wants to capture values in following additional fields for a purchase order transaction and invoices...Company name: GMCost Centre: ITProject: OFP --means Oracle Fusion ProjectExpense Type: OCC  -- Oracle Consultant Cost

In a DFF ONLY WORLD, when your client raises Purchase Order to IT Consulting Company, in PO_DISTRIBUTIONS_ALL table record you will store ATTRIBUTE1 :- GMATTRIBUTE2 :- ITATTRIBUTE3 :- OFPATTRIBUTE4 :- OCC

When an invoice is received from consulting company, the Payables clerk will capture the Invoice Line accounting as below in AP_INVOICE_DISTRIBUTIONS_ALLATTRIBUTE1 :- GMATTRIBUTE2 :- ITATTRIBUTE3 :- OFPATTRIBUTE4 :- OCCThese 4 text values for fields(above) are physically being duplicated in each module, for the related/unrelated transactions.

Imagine further when this transaction flows to Oracle General Ledger, would you again expect oracle to physically store the 4 columns into table GL_JE_LINES? If so your table GL_JE_LINES will have following values in its DFF (Descriptive Flex) columns....ATTRIBUTE1 :- GMATTRIBUTE2 :- ITATTRIBUTE3 :- OFPATTRIBUTE4 :- OCC

Surely, such design using a descriptive flexfield will be flawed, as it causes duplication of data at various places.Now that you understand why Descriptive flexfield does not fit into this design, lets consider a new scenario.

Consider an alternate approach.( using KFF )Let’s have a table named gl_code_combinations with following columns.CODE_COMBINATION_IDSEGMENT1SEGMENT2SEGMENT3SEGMENT4

44

Page 45: Oracle.anilpassi

Let’s capture A SINGLE record in this table as below:-CODE_COMBINATION_ID : 10902 SEGMENT1 : GMSEGMENT2 : ITSEGMENT3 : OFPSEGMENT4 : OCC

Note the above combination of 4 fields can be uniquely identified by 10902(CODE_COMBINATION_ID).

In PO_DISTRIBUTIONS_ALL table, we will have below column with valueCODE_COMBINATION_ID : 10902 NOTE: Now we are not storing all four columns here in PO Dist table, as we store the Unique ID of the record in Key Flexfield table.

Again, in Account Payables, even though the clerk will enter in screen values for four columns (four each segment), the database will only store value 10902 in column CODE_COMBINATION_ID of payables distributions table.Ditto for the entry in GL_JE_LINES table in oracle general ledger, only the ID that references those 4 columns will be stored.

Hence all the tables(PO Dist, AP Dist, GL JE Lines) will reference just the CODE_COMBINATION_ID.

Now some Q & A below

Question: Does this mean, for each key flexfield, there will be a dedicated table? And such table will hold the unique combination of field values that can be reused?Answer: correct. For gl accounting key flexfield, there is a table named gl_code_combinations. Other examples are grades in oracle human resources. A grade can be defined as a combination of say Clerk + Senior or Clerk + Junior. These combinations will be stored in per_grades table.

Question: do all the tables which are used for storing key Flexfields have columns named segment1,segment2...segmentx?Answer : Correct, it is a standard practice used by oracle. Thee segments columns are generic columns so that each client can call them by whatever name as they desire.

Question: Does Oracle deliver Key-Flexfields out of the box, which will pop-up a window with relevant fields, as configured during setup. Answer : Yes, and if value sets are attached, the fields can be validated too.

Question : Is there a step by step example of setting up key flexfield.Answer : Have a look at article for Setting up Special Information Types in HRMS using Key FlexField .For change in perspective, I have covered a HRMS Key Flexfield, named Special Information Types.

Install tools for Oracle Apps Development

This article is for setting up the PC for Oracle Apps development, for the readers of http://getappstraining.blogspot.com

9i/10g Oracle Client---------------------------This will install     Workflow Builder    SQL*PlusOnce installed, you must then try to connect to the apps schema of your development database.

45

Page 46: Oracle.anilpassi

D2K, with forms version 6i---------------------------This will install    Oracle Forms    Oracle ReportsNext, you need to upgrade the default version of installed Forms 6i by downloading and applying patch 3596539 from Metalink.

Once installed, ensure that you can connect to apps schema from Oracle Forms and Oracle Reports.

A Unix client---------------------------A unix shell program like ssh or putty or any others, that  a. Lets you do ftp or sftp with your servers  b. Lets you logon to your middle tier or the database tier to Unix Prompt Note: I am assuming a Unix install for Oracle Applications.

Oracle jDeveloper for OAF ( Optional:- Only needed if developing extensions to OAF).Download patch 4045639 from Metalink. Please note that this patch comes bundled with jDeveloper and all the Apps related libraries.

46

Page 47: Oracle.anilpassi

Oracle IDE---------------------------A rapid pl/sql development tool like TOAD or PL/SQL developer or Golden or SQL*navigator. Note this is optional, but I suggest you get used to one of these. My personal favorite is Pl/SQL developer from http://www.allroundautomations.com/plsqldev.html

Workflows--------------I suggest you create a directory similar to c:\oracle\wfNext you need to ensure that you are able to connect to apps schema from the workflow builder. Once connected, open workflow named Standard, and save this as WFSTD.wft.

Click on File/Open in Workflows Builder

Connect to database to apps schema

47

Page 48: Oracle.anilpassi

Open workflow Standard and save it as WFSTD.wft. You will require this wft file for building all new Workflows.

Next we need to do the following:-1. Ensure that you are able to connect to apps schema from all the above tools.2. FTP any given Oracle delivered report to your PC. Next you need to ensure that you are able to open that report. This is equivalent to sanity checking your Reports install, but is optional step.3. FTP the following files from your mid tier, to a directory named “c:\oracle\forms”            TEMPLATE.fmb            APP*.pll             FND*.pll   Note: These files are available on $AU_TOP/forms/US or from $AU_TOP/resourceAdd directory “c:\oracle\foms” to your registry path named FORMS60_PATH. In order to do this, do windows run, regedit, inside registry follow path HKEY_LOCAL_MACHINE/SOFTWARE/Oracle.You will see a variable named FORMS60_PATH.

After setting your registry path, open the forms designer, and see if you can open template.fmb without any problems. If you are prompted that any specific library is missing, then ftp that library too into your c:\oracle\forms. In case, when opening the form, you get an error like "xyz.pll is missing" and if you believe xyz.pll is already there on your pc, the you should try to open xyz.pll itself.The error might be related to some other pll being referred indirectly by xyz.pll. In simple words you need to recursively ftp all the form files, which are needed as foundation for forms development in apps.

Similarly, you need to add c:\oracle\reports to the REPORTS60_PATH in registry.

You are now ready to roll with your Oracle Apps development tasks…..

48

Page 49: Oracle.anilpassi

A New Custom Form in Oracle Apps

In this training article (for the readers of http://getappstraining.blogspot.com ), we will learn the steps needed to develop a custom Oracle Apps form from the very scratch. In the previous chapter we learnt "how to customize an existing oracle delivered form"

Question: Why bother teaching this when Oracle fusion is destined to replace oracle forms by OA Framework?Answer: Well firstly I am yet to hear an official word from Oracle in this regard, but  I agree it is highly likely that fusion will se demise of Oracle Forms. However more importantly Oracle will support current tech stack indefinitely, I.e Release 12 will be supported for foreseen time as per Apps Unlimited statement. Hence, many of the clients will keep using this technology for decades. Yes, I won't bother my kid learning Oracle form though.

Question : Ok, what are the steps for building a screen from scratch?Answer: Below steps in briefA) Open up TEMPLATE.fmb, and save this as XXHELLOAPPS.fmbB) Create a new window, by right clicking on Window/newName this window as XXHELLOAPPS,and assign it SubClass Type “WINDOW” from picklist.C) Create a new canvas and name it XXHELLOAPPS , ensuring its Sublcass Type is “Content”D) Make the windows property reference canvas XXHELLOAPPS and vice versa make the canvas reference windows XXHELLOAPPS.E) Now create a block named XXHELLOAPPS . Lets keep this a control block for simplicity.F) go to form level property, and set first navigation block to XXHELLOAPPS. G) Add a label and a field named “Hello_World” to this block.H) Generate the form on PC using Control-T keystrokes. This will ensure that nothing critical has been missed out.I)  FTP the form file to $XXPO_TOP/forms/USSurely, this XX will be replaced by the naming convention at your client/company.J)  cd to  $XXPO_TOP/forms/USAnd f60gen on XXHELLOAPPS.fmbThis will create a file executable as XXHELLOAPPS.fmxK) Go to Application Developer responsibilityMenu /applicaton/formRegister the formL) Register the Forms FunctionHave you read he article form functions[http://getappstraining.blogspot.com/2006/10/oracle-forms-functions-menus-and-their.html] yet?This forms function must be registered against application "XX Purchasing".M) Now add a menu item so that this forms function becomes available to specific responsibility.

Thats it, you will be able to open up this form from the responsibility.

Now some important notes:-1. If you have a table based block, and if that block has some description type fields, then try not to fetch them from post query trigger. Instead, develop a view in apps schema and assign that view as base tale to this block. This has a benefit that users will be able to query on the description field if need be. Indeed you will need to do dml on the actual table yourself by overriding on-insert, on-update, on-delete and on-lock triggers.2. For each block in the screen, create a form level package spec and package body. Your triggers in the block/block fields will make calls to that package.3. Try not to do to much pl/sql within the form. Always do such database intensive operations in a database level package.4. Try not using global variables, unless really needed. Give preference to the creation of form package variables.5. In a multi record block, always add a field for Current Record Indicator.

49

Page 50: Oracle.anilpassi

Steps for your first pl/sql Concurrent Program in Oracle Apps

I think this topic is already covered partially in one of the previous training lesson[ for concurrent programs], but I would like to touch base on this again.

Lets revisit some basics first

Question: What are the ingredients for a concurrent program?Answer: A concurrent executable and a program attached to that executable.

Question: Will executable for a pl/sql concurrent program be a database stored procedure?Answer: Yes, but in addition to above you can also register a procedure within a package as an executable. However, you can't make a Function to become the executable for a stored procedure.

Question: Does this stored procedure need to have some specific parameters, in order to become an executable of a concurrent program?Answer: Yes, such procedure must have at least two parameters( errbuff out VARCHAR2, retcode out NUMBER)

Question: Can we add additional parameters to such pl/sql procedures that happen to be Conc Prog Executables?Answer: Sure you can, but those parameters must be defined after the first two parameters. Effectively I mean first two parameters must always be errbuff and retcode. The sequence of the remaining parameters must match with the sequence in which parameters are registered in define concurrent program-parameters window.

Question: Can those parameters be validated or will these parameters be free text?Answer: These parameters can be attached to a value set, hence this will avoid users passing free text values.

Question: What are the possible things that a concurrent pl/sql program can do?Answer: Firstly your stored procedure would have been created in apps. This concurrent program will connect to "apps schema" from where access to all the tabes across every module will be available.You can do the following:-1. Insert records in tables(usually interface or temp tables)2. Update and delete records3. Initiate workflows4. Display messages in the output file or the log file of the concurrent program.5. Make this concurrent program complete with status Error or Warning or Normal.

Question: Please give me an example of a pl/sql concurrent program in Oracle apps in real life?Answer: Lets say you have an external application which is integrated with apps. Assume that it is Siebel application where the new customer records are created. Siebel is assumingly hosted on a Oracle database from where it has database links to your Oracle apps database.In this case, siebel inserts sales order records into your custom staging tables.You can then develop a concurrent process which will do the following:--------Loop through the records in that staging tableCheck if the customer already exists in Oracle AR TCAIf customer already exists, thencall the api to update existing customerIf this is a new customer, then update existing TCA Customer/Party record

Question: Ok, how do I do the above?Answer: Find the steps below for doing so

Step 1Connect xxschema/passwordCreate table xx_stage_siebel_customers ( customer_Id integer, customer name varchar2(400));

50

Page 51: Oracle.anilpassi

Grant all on xx_stage_siebel_customers to apps ;Step 2Connect apps/apps_passwordCreate or replace synonym xx_stage_siebel_customers for xxschema.xx_stage_siebel_customers ;Step 3 ( again in apps schema)Create or replace procedure xx_synch_siebel_cust ( errbuff out varchar2, retcode out varchar2 ) isn_ctr INTEGER := 0 ;Beginfor p_rec in ( select * from xx_synch_siebel_cust ) LOOPSelect count(*) into n_ctr from hz_parties where party_number = p_rec.customer_number;If n_ctr=0 thenHz_party_create(pass appropriate parameters here).ElseHz_party_update(pass appropriate parameters here);End if;END LOOP ;delete from xx_synch_siebel_cust ;End xx_synch_siebel_custStep 4Create concurrent program executable ( for example of screenshot, visit link )Step 5Create concurrent program for that executableStep 6Add this concurrent program to request group

Now your program is ready to roll....

Oracle FNDLOAD Script Examples

PLEASE USE THIS LINK FOR FNDLOAD ON APPS2FUSION.COM

In this article I wish to give real working examples of Oracle's FNDLOAD utility.Besides that, I have included some useful notes on FNDLOAD utility

I have used FNDLOAD successfully in past for several different entities/data types within Oracle 11i for almost all my previous clients, ever since this utility became available.Some of the examples in this FNDLOAD article include:-FNDLOAD to transfer Request GroupsFNDLOAD for moving Concurrent ProgramsFNDLOAD to download and upload Forms Personalizations ( or Personalisations depending on where you are located )

To FNDLOAD Web ADI, visit the link Web ADI FNDLOAD

Use FNDLOAD for transferring value set definitions.-->Please note that when transferring Key Flex Fields and Descriptive flex fields the respective value sets against each segment will be extracted and loaded automatically.

Also, FNDLOAD can be used to migrate Key FlexFields, Descriptive Flexfields, Responsibilities and almost every other FND entity.

Please note that the text written down here could get wrapped in the browser.Hence you may have to use \ to continue the single line command on Unix, in case you find the lines wrappingIn my case I am ensuring that $CLIENT_APPS_PWD has the apps password before running the scripts

------------------------------------------------------------------------------------------

51

Page 52: Oracle.anilpassi

##To FNDLOAD Request groupsFNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct XX_MY_REPORT_GROUP_NAME.ldt REQUEST_GROUP REQUEST_GROUP_NAME="XX_MY_REPORT_GROUP_NAME" APPLICATION_SHORT_NAME="XXGMS"##Note that##---------## <> will be your Application Shortname where request group is registered## XX_MY_REPORT_GROUP_NAMEWill be the name of your request group## ##To upload this Request Group in other environment after having transferred the ldt file

FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afcpreqg.lct

-----------------------------------------------------------------------------------------

##To FNDLOAD Concurrent ProgramsFNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_ORACLE_INTERFACE_PROG.ldt PROGRAM APPLICATION_SHORT_NAME="XXGMS" CONCURRENT_PROGRAM_NAME="XX_CUSTOM_ORACLE_INTERFACE_PROG"##Note that##---------## XXGMS will be your custom GMS Application Shortname where concurrent program is registered## XX_CUSTOM_ORACLE_INTERFACE_PROGWill be the name of your request group## XX_CUSTOM_ORACLE_INTERFACE_PROG.ldt is the file where concurrent program definition will be extracted## ##To uploadFNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_ORACLE_INTERFACE_PROG.ldt

------------------------------------------------------------------------------------------

##To FNDLOAD Oracle Descriptive Flexfields$FND_TOP/bin/FNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_PO_REQ_HEADERS_DFF.ldt DESC_FLEX APPLICATION_SHORT_NAME=PO DESCRIPTIVE_FLEXFIELD_NAME='PO_REQUISITION_HEADERS'##Note that##---------## PO is the Application Shortname against which descriptive flexfield against PO Headers is registered## PO_REQUISITION_HEADERSis the name of Descriptive Flexfield against PO Requisition Headers## Use the SQL below to find the name of DFF, rather than logging into the screen (ooops via jinitiator)########----->SELECT########----->application_id, DESCRIPTIVE_FLEXFIELD_NAME, application_table_name########----->FROM########-----> fnd_descriptive_flexs_vl########----->WHERE########-----> APPLICATION_TABLE_NAME like '%' || upper('&tab_name') || '%'########----->ORDER BY APPLICATION_TABLE_NAME########----->/## To upload into another environment$FND_TOP/bin/FNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct XX_PO_REQ_HEADERS_DFF.ldt

52

Page 53: Oracle.anilpassi

## OK another example for DFF against FND_LOOKUPSFNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_FND_COMMON_LOOKUPS_DFF.ldt DESC_FLEX APPLICATION_SHORT_NAME=FND DESCRIPTIVE_FLEXFIELD_NAME='FND_COMMON_LOOKUPS'## OK another example for DFF against Project Accounting Expenditure TypesFNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_PA_EXPENDITURE_TYPES_DESC_FLEX_DFF.ldt DESC_FLEX APPLICATION_SHORT_NAME=PA DESCRIPTIVE_FLEXFIELD_NAME='PA_EXPENDITURE_TYPES_DESC_FLEX'

------------------------------------------------------------------------------------------

##To FNDLOAD Oracle Menus$FND_TOP/bin/FNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct ICX_POR_SSP_HOME.ldt MENU MENU_NAME="ICX_POR_SSP_HOME"##Note that##---------## Oracle Menus are not attached to applications. Hence no need to include application short name## ICX_POR_SSP_HOME is the menu name. This can be validated via below SQL## select user_menu_name from fnd_menus_vl where menu_name = 'ICX_POR_SSP_HOME' ;## Also note that we do not pass in the User_menu_name in this example## OK, now to upload this file$FND_TOP/bin/FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct ICX_POR_SSP_HOME.ldt

----------------------------------------------------------------------------------------------------------------------------

## Well, now for FND Messages to download a single messageFNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct \XX_ICX_POR_LIFECYCLE_PAY_TIP.ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME='ICX' MESSAGE_NAME=XX_ICX_POR_LIFECYCLE_PAY_TIP

## Or you may as well download all the messages within an applicationFNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct \XX_ALL_GMS_MESSAGES_00.ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME='XXGMS'

## now to upload using FNDLOADFNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct XX_ICX_POR_LIFECYCLE_PAY_TIP.ldt

----------------------------------------------------------------------------------------------------------------------------

## Now it's the turn of Lookup values. Again, its not a rocket scienceFNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD aflvmlu.lct XX_TRX_BATCH_STATUS.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME ='XXGMS' LOOKUP_TYPE="XX_TRX_BATCH_STATUS"## Note that## XX_TRX_BATCH_STATUS is the name of FND Lookup Type in this example## This will download all the lookup codes within the defined lookup## To uploadFNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD aflvmlu.lct XX_TRX_BATCH_STATUS.ldt

----------------------------------------------------------------------------------------------------------------------------

## You can also move the User definitions from FND_USER FNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct ./XX_FND_USER_PASSI.ldt FND_USER USER_NAME='ANILPASSI'

53

Page 54: Oracle.anilpassi

#Do not worry about your password being extracted, it will be encrypted as below in ldt file#BEGIN FND_USER "ANILPASSI"#  OWNER = "PASSIA"#  LAST_UPDATE_DATE = "2005/10/19"#  ENCRYPTED_USER_PASSWORD = "ZGE45A8A9BE5CF4339596C625B99CAEDF136C34FEA244DC7A"#  SESSION_NUMBER = "0"To upload the FND_USER using FNDLOAD command use FNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct ./XX_FND_USER_PASSI.ldt Notes for using FNDLOAD against FND_USER:-1. After uploading using FNDLOAD, user will be promoted to change their password again during their next signon attempt.2. All the responsibilities will be extracted by FNDLOAD alongwith User Definition in FND_USER 3. In the Target Environment , make sure that you have done FNDLOAD for new responsibilities prior to running FNDLOAD on users.

----------------------------------------------------------------------------------------------------------------------------

## Now lets have a look at the profile option using oracle's FNDLOADFNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct POR_ENABLE_REQ_HEADER_CUST.ldt PROFILE PROFILE_NAME="POR_ENABLE_REQ_HEADER_CUST" APPLICATION_SHORT_NAME="ICX"## Note that## POR_ENABLE_REQ_HEADER_CUST is the short name of profile option## We aren't passing the user profile option name in this case. Validate using ...########----->select application_id, PROFILE_OPTION_NAME || '==>' || profile_option_id || '==>' ||########----->USER_PROFILE_OPTION_NAME########----->from FND_PROFILE_OPTIONS_VL########----->where PROFILE_OPTION_NAME like '%' || upper('&profile_option_name') || '%'########----->order by PROFILE_OPTION_NAME########----->/## Now to uploadFNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct POR_ENABLE_REQ_HEADER_CUST.ldt----------------------------------------------------------------------------------------------------------------------------

## Now for the request sets that contain the stages and links for underlying concurrent programs## For this you will be firstly required to download the request set definition.## Next you will be required to download the Sets Linkage definition## Well, lets be clear here, the above sequence is more important while uploadingFNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XX_GL_MY_INTERFACE_SET.ldt REQ_SET REQUEST_SET_NAME="FNDRSSUB4610101_Will_look_like_this"FNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XX_GL_MY_INTERFACE_SET_LINK.ldt REQ_SET_LINKS REQUEST_SET_NAME="FNDRSSUB4610101_Will_look_like_this"## Note that FNDRSSUB4610101 can be found by doing an examine on the########----->select request_set_name from fnd_request_sets_vl########----->where user_request_set_name = 'User visible name for the request set here'## Now for uploading the request set, execute the below commandsFNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct XX_GL_MY_INTERFACE_SET.ldtFNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct XX_GL_MY_INTERFACE_SET_LINK.ldt

54

Page 55: Oracle.anilpassi

----------------------------------------------------------------------------------------------------------------------------

## Now for the responsibilityFNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct XX_PERSON_RESPY.ldt FND_RESPONSIBILITY RESP_KEY="XX_PERSON_RESPY"## note that XX_PERSON_RESPY is the responsibility key## Now to uploadFNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct XX_PERSON_RESPY.ldt

----------------------------------------------------------------------------------------------------------------------------## OK, now for the forms personalizations## For the forms personalizations, I have given three examples as below.FNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct XX_PERWSHRG.ldt FND_FORM_CUSTOM_RULES function_name="PERWSHRG-404"FNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct XX_HZ_ARXCUDCI_STD.ldt FND_FORM_CUSTOM_RULES function_name="HZ_ARXCUDCI_STD"FNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct XX_AP_APXVDMVD.ldt FND_FORM_CUSTOM_RULES function_name="AP_APXVDMVD"## Note that the function name above is the function short name as seen in the Function Definition Screen## Now to upload the forms personalizations that are defined against these forms functions....FNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct XX_PERWSHRG.ldtFNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct XX_HZ_ARXCUDCI_STD.ldtFNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct XX_AP_APXVDMVD.ldt

----------------------------------------------------------------------------------------------------------------------------

Notes :1. Give special attention when downloading Menus or Responsibilities.In case your client has several developers modifying Responsibilities and Menus, then be ultra carefull. Not being carefull will mean that untested Forms and Functions will become available in your clients Production environment besides your tested forms, functions and menus.

2. Be very careful when downloading flexfields that reference value sets with independent values for GL Segment Codes.By doing so, you will download and extract all the test data in GL Codes that might not be applicable for production.

3. There are several variations possible for FNDLOAD, for example you can restrict the download and uploads to specific segments within Descriptive Flex Fields. Please amend the above examples as desired for applying appropriate filterations.

4. The list of examples by no mean cover all possible FNDLOAD entities.

5. FNDLOAD is very reliable and stable, if used properly. This happens to by one of my favourite Oracle utilities.

4. Last but not the least, please test your FNDLOAD properly, so as to ensure that you do not get any unexpected data. In past I have noticed undesired results when the Lookup gets modified manually directly on production, and then the FNDLOAD is run for similar changes. If possible, try to follow a good practice of

55

Page 56: Oracle.anilpassi

modifying FNDLOADable data only by FNDLOAD on production environment.

5. As the name suggests, FNDLOAD is useful for FND Related objects. However in any implementation, you will be required to migrate the Setups in Financials and Oracle HRMS from one environment to another. For this you can use iSetup. "Oracle iSetup".Some of the things that can be migrated using Oracle iSetup areGL Set of Books, HR Organization Structures, HRMS Employees, Profile Options Setup, Suppliers, Customers,  Tax Codes & Tax Rates, Financials Setup, Accounting Calendars, Chart of Accounts, GL Currencies.

Restart or Bounce Apache in Oracle Apps 11i

I find this script very handy for bouncing the Apache, specially when working on Self Service Applications. 

Please find the two commands that I use for bouncing the Apache

$COMMON_TOP/admin/scripts/$TWO_TASK*/adapcctl.sh stop$COMMON_TOP/admin/scripts/$TWO_TASK*/adapcctl.sh start

Of course this needs to be done in Middle Tier of Oracle Applications.

In case you have modified any java or class file in OAF ( Oracle Applications Framework ), then Apache bounce becomes mandatory for those changes to take effect.

In case you modify and load the XML Document in Oracle Framework, then it is noticed, for those XML changes to take effect, complete bounce of Middle Tier is required in Oracle Apps.

If your client is still stuck with AK Developer, then Apache bounce will be required after akload has been executed

Playing with CUSTOM.pll

Please find some commands for CUSTOM.pllTo convert from CUSTOM.pll to CUSTOM.pldf60gen module_type=LIBRARY module=CUSTOM script=YES userid=apps/apps

To convert back from CUSTOM.pld to CUSTOM.pll ( after having edited the text pld file )f60gen module_type=LIBRARY module=CUSTOM parse=YES userid=apps/apps

To convert from CUSTOM.pll to CUSTOM.plxf60gen module_type=LIBRARY module=CUSTOM userid=apps/apps

Read Only Schema in Oracle APPS 11i In this article I have discussed how to create and maintain a read only schema for APPS in Oracle eBusiness Suite.

Whilst in the past I have known clients to implement this using synonyms. However the approach discussed below is designed without the need of having to create a single synonym in APPS_QUERYschema.

Step 1  Create the read-only schema, in this case lets call it APPS_QUERY.

Step 2. Surely, the schema created in above Step 1 will be given read only grants to objects in apps. There will be cases where the grant command might fail. To monitor such failures  create a table as belowconn xx_g4g/&2 ;

56

Page 57: Oracle.anilpassi

--For APPS_QUERY. This table will capture the exceptions during GrantsPROMPT create table XX_GRANTS_FAIL_APPS_QUERYcreate table XX_GRANTS_FAIL_APPS_QUERY (         object_name VARCHAR2(100)       ,sqlerrm varchar2(2000)       ,creation_date DATE         );

grant all on XX_GRANTS_FAIL_APPS_QUERY to apps with grant option;

grant select on XX_GRANTS_FAIL_APPS_QUERY to apps_query ;

Step 3In this step we grant select on all the existing views and synonyms in apps schema to apps_query.

conn apps/&1 ;

PROMPT This can take upto 15-30 minutesPROMPT Granting SELECT on All synonyms and views to apps_queryDECLARE--One off script to execute grants to apps_query  v_error VARCHAR2(2000);BEGIN

  FOR p_rec IN (SELECT *                FROM   all_objects                WHERE  owner = 'APPS'                AND    object_type IN ('SYNONYM', 'VIEW')                AND    object_name NOT LIKE '%_S')  LOOP    BEGIN      EXECUTE IMMEDIATE 'grant select on ' || p_rec.object_name ||                        ' to apps_query';    EXCEPTION      WHEN OTHERS THEN        v_error := substr(SQLERRM, 1, 2000);        INSERT INTO bes.XX_GRANTS_FAIL_apps_query          (object_name          ,SQLERRM          ,creation_date           )        VALUES          (p_rec.object_name          ,v_error          ,sysdate          );    END;  END LOOP;  COMMIT;END;/

Step 4 Write a after logon trigger on apps_query schema. The main purpose of this trigger is to alter the session to apps schema, such that the CurrentSchema will be set to apps for the session(whilst retaining apps_query restrictions).In doing so your logon will retain the permissions of apps_query schema(read_only). Howerver it will be able to reference the apps

57

Page 58: Oracle.anilpassi

objects with exactly the same name as does a direct connection to apps schema.

conn apps/&1 ;PROMPT CREATE OR REPLACE TRIGGER xx_apps_query_logon_trgCREATE OR REPLACE TRIGGER xx_apps_query_logon_trg--16Jun2006 By Anil Passi--Trigger to toggle schema to apps, but yet retaining apps_query resitrictions--Also sets the org_id  AFTER logon ON apps_query.SCHEMADECLAREBEGIN  EXECUTE IMMEDIATE           'declare begin ' ||          'dbms_application_info.set_client_info ( 101 ); end;';  EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA =APPS';END;/

Step 5Create a Trigger on the apps schema to issue select only grants for all new views and synonyms. Please note that I am excluding grants for sequences. SELECT grants for views and synonyms will be provided to apps_query as and when such objects are created in APPS. Please note that, all the APPS objects (views and synonyms) that existed in APPS schema prior to the implementation of this design, would have been granted read-only access to apps_query in Step 2.

conn apps/&1 ;PROMPT CREATE OR REPLACE TRIGGER xx_grant_apps_queryCREATE OR REPLACE TRIGGER xx_grant_apps_query--16Jun2006 By Anil Passi--  AFTER CREATE ON APPS.SCHEMADECLARE  l_str VARCHAR2(255);  l_job NUMBER;BEGIN  IF (ora_dict_obj_type IN ('SYNONYM', 'VIEW'))     AND (ora_dict_obj_name NOT LIKE '%_S')  THEN    l_str := 'execute immediate "grant select on ' || ora_dict_obj_name ||             ' to apps_query";';    dbms_job.submit(l_job, REPLACE(l_str, '"', ''''));  END IF;END;/

Some notes for this design

Note1  You need to ensure that the schema created in Step 1 has very limited permissions. Most importantly it must not be given grant for “EXECUTE/CREATE ANY PROCEDURE”. You will need to agree with your DBAs upfront for the permissions,

Note 2Only views and synonyms will be granted access. Objects in your xx_g4g(bespoke) schema should have their synonyms in apps already in place.

58

Page 59: Oracle.anilpassi

Note 3If your site has multi org enabled, you will then have to set the org I'd after loggiong on to apps query schema. In case you have only one single ORG_ID, then would have been set as in Step 4 above.

Note 4 ALTER SESSION SET CURRENT_SCHEMA =APPSThis facilitates users to run their queries as if they were connected to apps schema. However, their previliges will be restricted to those of apps_query

Note 5It is assumed that ALTER SESSION privilege will exist for APPS_QUERY schema.

Create Oracle FND_USER with System Administrator If you have the Apps Password, its quite easy to create a FND_USER for yourself by using the API. I find this script very useful when development environment gets cloned from Production(that is when i do not have FND_USER in Production.Please note that:-1. You will be allocated System Administrator by this script. Hence you can assign whatever responsibilities that you desire latter, after logging in.2. The password will be set to oracle3. You need apps password to run this script. Alternately you need execute permission on fnd_user_pkg from the user where this script will be run. If using some other user, please use apps.fnd_user_pkg.createuser4. You need to do a COMMIT after this script has run. I have not included the commit within this script.5. When running this script, you will be prompted to enter a user name.

--------Beging of script--------------DECLARE--By: Anil Passi--When Jun-2001  v_session_id INTEGER := userenv('sessionid');  v_user_name  VARCHAR2(30) := upper('&Enter_User_Name');BEGIN  --Note, can be executed only when you have apps password.  -- Call the procedure to Creaet FND User  fnd_user_pkg.createuser(x_user_name                  => v_user_name    ,x_owner                      => ''    ,x_unencrypted_password       => 'oracle'    ,x_session_number             => v_session_id    ,x_start_date                 => SYSDATE - 10    ,x_end_date                   => SYSDATE + 100    ,x_last_logon_date            => SYSDATE - 10    ,x_description                => 'appstechnical.blogspot.com'    ,x_password_date              => SYSDATE - 10    ,x_password_accesses_left     => 10000    ,x_password_lifespan_accesses => 10000    ,x_password_lifespan_days     => 10000    ,x_employee_id                => 30 /*Change this id by running below SQL*/     /*         SELECT person_id           ,full_name     FROM   per_all_people_f     WHERE  upper(full_name) LIKE '%' || upper('<ampersand>full_name') || '%'     GROUP  BY person_id              ,full_name

59

Page 60: Oracle.anilpassi

     */    ,x_email_address => '[email protected]'    ,x_fax           => ''    ,x_customer_id   => ''    ,x_supplier_id   => '');  fnd_user_pkg.addresp(username       => v_user_name                      ,resp_app       => 'SYSADMIN'                      ,resp_key       => 'SYSTEM_ADMINISTRATOR'                      ,security_group => 'STANDARD'                      ,description    => 'Auto Assignment'                      ,start_date     => SYSDATE - 10                      ,end_date       => SYSDATE + 1000);END;/

A New Custom Form in Oracle Apps In this training article (for the readers of http://getappstraining.blogspot.com ), we will learn the steps needed to develop a custom Oracle Apps form from the very scratch.

In the previous chapter we learnt "how to customize an existing oracle delivered form"

Question: Why bother teaching this when Oracle fusion is destined to replace oracle forms by OA Framework?Answer: Well firstly I am yet to hear an official word from Oracle in this regard, but  I agree it is highly likely that fusion will se demise of Oracle Forms. However more importantly Oracle will support current tech stack indefinitely, I.e Release 12 will be supported for foreseen time as per Apps Unlimited statement. Hence, many of the clients will keep using this technology for decades. Yes, I won't bother my kid learning Oracle form though.

Question : Ok, what are the steps for building a screen from scratch?Answer: Below steps in briefA) Open up TEMPLATE.fmb, and save this as XXHELLOAPPS.fmbB) Create a new window, by right clicking on Window/newName this window as XXHELLOAPPS,and assign it SubClass Type “WINDOW” from picklist.C) Create a new canvas and name it XXHELLOAPPS , ensuring its Sublcass Type is “Content”D) Make the windows property reference canvas XXHELLOAPPS and vice versa make the canvas reference windows XXHELLOAPPS.E) Now create a block named XXHELLOAPPS . Lets keep this a control block for simplicity.F) go to form level property, and set first navigation block to XXHELLOAPPS. G) Add a label and a field named “Hello_World” to this block.H) Generate the form on PC using Control-T keystrokes. This will ensure that nothing critical has been missed out.I)  FTP the form file to $XXPO_TOP/forms/USSurely, this XX will be replaced by the naming convention at your client/company.J)  cd to  $XXPO_TOP/forms/USAnd f60gen on XXHELLOAPPS.fmbThis will create a file executable as XXHELLOAPPS.fmxK) Go to Application Developer responsibilityMenu /applicaton/formRegister the formL) Register the Forms FunctionHave you read he article form functions[http://getappstraining.blogspot.com/2006/10/oracle-forms-functions-menus-and-their.html] yet?This forms function must be registered against application "XX Purchasing".M) Now add a menu item so that this forms function becomes available to specific responsibility.

60

Page 61: Oracle.anilpassi

Thats it, you will be able to open up this form from the responsibility.

Now some important notes:-1. If you have a table based block, and if that block has some description type fields, then try not to fetch them from post query trigger. Instead, develop a view in apps schema and assign that view as base tale to this block. This has a benefit that users will be able to query on the description field if need be. Indeed you will need to do dml on the actual table yourself by overriding on-insert, on-update, on-delete and on-lock triggers.2. For each block in the screen, create a form level package spec and package body. Your triggers in the block/block fields will make calls to that package.3. Try not to do to much pl/sql within the form. Always do such database intensive operations in a database level package.4. Try not using global variables, unless really needed. Give preference to the creation of form package variables.5. In a multi record block, always add a field for Current Record Indicator.

Please let me know if anything is unclear. Feel free to ask your questions

Forms Customization Steps in Oracle Applications This article is for the readers of http://getappstraining.blogspot.com ,listing the steps required to customize a form in Oracle Applications. Lets do some Questions and Answers:-

Question: Is it a common practice to modify forms in Oracle Apps?Answer: Yes and No. Yes because you often will be called upon to modify the forms, but no because most often you should modify the screen without actually modifying the underlying forms executable .

Question: How can I modify screen without modifying the underlying executable ?Answer: There are two ways, listed in the order of preferences:-1. Forms Personalizations2. CUSTOM.pll

Question: How does forms personalization work?Answer: Oracle forms has triggers that we trap to write our business logic. Oracle has a standard practice of calling a generic piece of code from each trigger(at form level).  In this generic piece of code Oracle checks in personalizations tables to see if anything extra needs to be done for the events being executed. For details of example, see the article for forms personalizations

Question: Fine then, but why is CUSTOM.pLL needed when we already have forms personalization?Answer: Well just like any technology, forms personalization has its limitations.

Limitation example 1 of forms personalizations---------------------------------------------------For example you wish to prompt a message to user DO YOU WISH TO CREATE THIS PERSON AS SUPPLIER OR CUSTOMER OR EMPLOYEE. Lets say this message will prompt three options, create customer , create supplier or create vendor. Depending upon what user selects, you wish to navigate to one of relevant screens from the current TCA screen. For this, you have no choice but to use CUSTOM.pll

Limitation example 2 of forms personalizations ---------------------------------------------------For example you wish to change the record group of a LOV, via changing its query, in a screen.  This can be done by CUSTOM.pll, but not by forms personalization.

Question: What about CUSTOM.pll, what can't be done via custom.pll ??  Hence calling for

61

Page 62: Oracle.anilpassi

forms customization.Answer: For example, you need to add a complete new section to the screen at a very specific location, this must be done via forms customization.

Question : Ok, what are the steps for customization of such screen.Answer: Below steps in briefA) Identify the form in Oracle Apps that needs to be customized. B) Go to the specific directory on one of the mid-tiers to get that forms executable. Say from $AU_TOP/forms/US/POENTRY.fmb.C) FTP that form and all its dependable form objects & pll files to your PC.D) Open the form, ensuring that you do not receive any errors pertaining to missing library or missing form object.E) Perform a save-as to rename this form on your pc, using your company's naming conventions.F) Make the desired modifications to the form.G) Generate the form on PC using Control-T keystrokes. This will ensure that nothing critical has been missed out. Surely you will need to connect to apps schema before generating the form.H)  FTP the form file to $XXPO_TOP/forms/USSurely, this XX will be replaced by the naming convention at your client/company.I)  cd to  $XXPO_TOP/forms/USAnd f60gen on XXPOENTRY.fmbThis will create a file executable as XXPOENTRY.fmxJ) Go to Application Developer responsibilityMenu /applicaton/formRegister the formK) Register the Forms FunctionHave you read the article form functions ?This forms function must be registered against application "XX Purchasing".L) Now add a menu item so that this forms function becomes available to specific responsibility.

Question: Well, a question about (A), how to identify the form executable?Answer: There are two ways. Method1Open the form to be customized in Oracle Apps from respective Responsibility/MenuNext select menu /Help/About Oracle Application.Here, scroll down within the subwindow and search for fmx. This is the executable that oracle application runs when specific form is invoked.

Method2Query the responsibility definition which has the form attached to this. Note down the Menu which is attached to Responsibility. Go to the menu definition screen and find the form function attached to this menu. From this form function find the form attached to this function.

Question: Regarding (I), what is the command for f60genAnswer: FORMS60_PATH=$FORMS60_PATH:$AU_TOP/forms/USexport FORMS60_PATHcd $XXPO_TOP/forms/USf60gen module=XXPOENTRY.fmb userid=apps/apps module_type=form batch=no compile_all=special

Customization of Reports in Oracle Apps Oracle Reports will become a thing of past in Fusion, however it will still demand resources for the next 5yrs or so.

Hence I decided to write this article to fulfill my commitment towards http://getappstraining.blogspot.com

62

Page 63: Oracle.anilpassi

We learnt in Forms Customization article that customized executables must be registered with Custom Application. This rule applies to Oracle Reports too in Oracle Applications.

Important note: Just like Oracle Forms, there is no place for D2K Reports in Fusion. This will be replaced by XML publisher. I will explain that transition in a latter article very soon.

Question: I have been asked to customize Invoice Print program which happens to be an Oracle Report. What will be the steps, that I must follow.Answer : Follow the steps below.1. You will be told the name of the existing report that must be customized. Note down the exact name and query that name in Concurrent Program screen. Click on “Copy Program button” selecting checkbox option “Copy Parameters”. This will help you copy the current program definition to custom version of the program. Also note down the name of the executable as it appears in concurrent program definition screen.

2. In same responsibility i.e. Application Developer, navigate to screen concurrent executable and query on the field labeled "Executable Short Name".Note down the application within which it is registered. If the application is Oracle Receivables, then you must go to the database server and get hold the file named RAXINV.rdf in $AR_TOP/reports/US.

3. Copy that file to your custom AR Top directory. Basically that is the directory where custom reports for AR will be deployed..cd $XXAR_TOP/reports/uscp $AR_TOP/reports/us/RAXINV.rdf $XXAR_TOP/reports/us

Effectively you have now done the following:-1. Made the custom version of report registered with XXAR application. If you worked for say company named EA, then this might have been $EAAR_TOP/reports/US2. When you run that report, Oracle concurrent manager will search for that report in $XXAR_TOP/reports/USThe report will be found there, and executed.

Note: We haven’t made any changes as yet. Also, you need to include the new concurrent program name in the relevant request group.

Now you can ftp that report to your pc, make modifications for necessary customizations, and then ftp that piece of rdf back to the server. Run it again, to see it working.Some important tips:-1. Avoid writing SQL in format trigger, although in rare cases it becomes necessary to do so.2. Learn from Oracle's Report, by reverse engineering them.3. Do not write a formula column for something which can be achieved by amending the query in data group itself.4. Do not hardcode things like Currency Formatting. Have a look at Oracle's Amount fields, and use the same user exit. 5. srw2.message can be used for minor debugging, as those messages will appear in the log file of the concurrent program.6. You can set the trace checkbox against the concurrent program definition, to generate SQL Trace. This trace will not produce bind variable values though.7. Join between two queries in data group will always be outerjoined, by default.8. Avoid filters on Data Group queries. Try to implement that logic within the query itself.

Migration program in Apps. Migrate Customers This article explains the steps to write programs for data migration in Oracle Apps.

Question : Why this article?Answer : Because in every Oracle ERP implementation you have some level of data migration activity. I will try to explain the steps, followed by a real life example of data migration.

63

Page 64: Oracle.anilpassi

Question : How to do data migration?Answer :A. Prepare the source dataB. Design your staging tables and write codeC. Test Test Test....

Question : What is involved in the preparation stage of data migration in oracle apps?Answer:  For the Preparation stage, following must be done.1. Understand the structure of the data being imported and also its business purpose.2. Fully understand where the data will end up residing into Oracle Apps. 3 Find out if open interfaces or APIs exist in Oracle Apps to facilitate loading the required data.4. Ensure that lookup codes or setup in Oracle apps support the values that are coming from source system.5. Think about how the errors will be reported and managed.6. Also think about how the transactions that fail migration will be re-tried. You may decide to knock of a simple screen if high volume of transactions needs user intervention for cleansing.

Question: And how about the development stage during migration?Answer: Do the following1. Design the stages in which data will flow. Traditionally, your legacy/source data will be loaded into some temporary(staging) tables in a raw(as is) fomat/strucutre . Next you will translate the data into the physical structure that is similar to structure of Oracle Apps table/API. And then you will call the API or populate the Open Interface tables.2. For doing the above, you will first write one-off scripts to create those staging tables and load data into them using SQL*Loader or some other methodology. If your source system is Oracle too, then I suggest you create a db link to pull the data into your staging tables.All the steps pertaining the transformation can be done via a pl/sql concurrent Program(unless you are using tools like Warehouse builder)3. Run the concurrent program that you have would written for transformation of data. This will either populate your Open Interface Tables or it will perform migration if APIs are being used.(Again all this can be done via tools too, but here I am talking about a small migration activity, hence ignore the tool talk)4. Ensure that errors are logged into some error logging table.If the data errors in Oracle's open interface tables, then you could have a database view that does a union on your error table and also oracle's error logging table.

Question: How about testing?Answer: You will figure out the following at this stage, from the records that error1. Missing mapping codes2. Missing setups in oracle apps.Testing will most likely be repetitive, until you are able to have a migration run which leaves behind the records that are very low in volume or non-existent.

Question : If I get a comma delimited file, how will I load that into tables?Answer : You can use a Sql*Loader, or a java program with a csv parser or a file based table approach.

Question : In oracle apps during migration, do we usually receive xml data file?Answer : Keep in mind that you usually migrate data from mainframe or standalone systems which now stand outdated.Such systems usually produce comma delimited or tab delimited file.

Question : Ok, once the data from source system has been loaded using sql*loader, what next?Answer: The data model of the source data may or may not comply with the data model in oracle apps. Hence you need a transformation step in most cases. This is explained below with an example of TCA API to migrate customers/parties.

64

Page 65: Oracle.anilpassi

Question : Should I not ask the legacy system people to transform data as per our requirements?Answer : No, don't bother doing so, for below reasons :-A. Techies of legacy system will not be happy that their system is now being made redundant. Hence don't expect much value addition from them.B. There is a possibility that in an attempt to transform data to Oracle's data structure, they might induce faults/bugs.If the transformation bugs are encountered at your end in apps, you can fix them yourself. However if legacy team does transformation for you, then you become dependent  on them for bug fixes. Eventually tired of waiting on them, you might end up doing transformation yourself anyway.C. If your design for transformation changes, you should not be dependent upon the legacy system...just fix it yourself at your own end in apps.

Question : If we end up using interface api's in apps for data migration, then where lies the difference between migration and interfaces?Answer : Migration is a one-off activity, even though it uses the same sets of tables/API's as interfaces do.

Question : Enough explanation, now give me an example.Answer : Let’s assume you get a task to migrate customers from legacy system into TCA (or call it AR - Receivables for simplicity).Your file from source is:-lcust.dat1000,GE, GE Capital,1000-11001,Cisco,Cisco Routers,1001-11002,Barclays,Barclays Investments,1001-1 1003,Barclays,Barclays Mortgages,1001-2

The format of data is CustomerId,Cust parent name,customer operating company name, operating company id

Step 1. FTP this file to your database server and run sql*loader to load the file into a table named xx_legacy_cust, this table will have four columns, one column for each file in source.Step 2. Transform this data...For this we create two tables...XX_TRNSFRM_PARTY   --parent_cust_Id   --parent_cust_nameXX_TRNSFRM _CUST_ACCOUNT   --parent_cust_Id   --operating_cust_Id   --operating_cust_nameNow, you can write a pl/sql program to split data from table xx_legacy_cust into the two tables listed above.

Step 3. Now write the pl/sql program to migrate this data into Oracle.Create or replace procedure xx_migrate_parties(errbuff out varchar2,retcode out varchar2) isBeginFOR p_party_rec in (select * from XX_TRNSFRM_PARTY ) LOOP --call api to create partyHz_Party_Site_V2pub.create_party();

    For p_party_rec in (select * from XX_TRNSFRM _CUST_ACCOUNT where parent_cust_Id = p_party_rec.parent_cust-id)     loop    --now create a customer account         hz_cust_account_v2pub.create_cust_account(..parameters…

65

Page 66: Oracle.anilpassi

                                             l_return_status,                                             l_msg_count,                                             l_msg_data        );

      IF l_msg_count > 1 THEN         FOR i IN 1 .. l_msg_count          LOOP            Fnd_File.put_line (Fnd_File.LOG, i || '. ' || SUBSTR (Fnd_Msg_Pub.get (p_encoded      => Fnd_Api.g_false ), 1, 255 ) );         END LOOP;     END IF;

    END LOOP ;END LOOP ; END  ;

Now some notes:-1. No two data migrations are exactly the same, hence I have given a pseudo code, and not th actual code.2. In some cases the quality of the source data can be so bad that you may need a third party to cleanse the data before you run migration.3. The API's used for data migration and for developing open interfaces are the same.

FNDLOAD for Oracle Web ADI This article is dedicated for usage of FNDLOAD for Web ADI Question : Does this article cover FNDLOAD in general?Answer : This article is dedicated to the usage of FNDLOAD for Web ADI. If you wish to fndload entities other than Web ADI, then kindly visit link Fndload for common utilities.

Question: Why does one need to use FNDLOAD FOR WEB ADI?Answer : In any implementation that uses Web ADI, the setup for formatting letters and docments can be overwhelming. More importantly, once configured on a development environment you would not like to repeat the tedious setup on test, crp or other environment. Using FNDLOAD you can migrate 99% of your setup.

Question : What are the man steps when using FNDLOAD for Web ADI?Answer : First step Identify the pieces that must be moved across using fndload. These can be:-  Integrators  Layouts  Mappings  ContentsThis article covers the above listed components one by one.Second stepDownload the above web adi attributes into various ldt files. Basically we will create one ldt file for each of the above four web adi entities.Third stepUpload those ldt files into the new environment. For this we will run the fndload in upload mode.

Question: How do I execute Step 1, given that FNDLOAD requires the internal names of these entities, these internal names are not visible from the Web ADI screens?Answer: In this example,I will demonstrate using scripts how to recognize the web adi components Names for fndload. SQL will be provided to identify the internal names.

Question : Please demo how to FNDLOAD Integrators in Web ADIAnswer : To identify the integrator codes, run the below SQL.

66

Page 67: Oracle.anilpassi

SELECT integrator_code, application_idFROM bne_integrators_vl vlWHERE user_name IN      ('XX Request for further references', 'XX Sorry Interview did not work') ;

This will return two internal codes, both in application PER (Application ID 800). Lets say the two internal codes are HR_101_INTG & HR_41_INTG.

Now download these as below:-FNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/admin/import/bneint.lct XX_HR_101_INTG.ldt BNE_INTEGRATORS INTEGRATOR_ASN="PER" INTEGRATOR_CODE="HR_101_INTG"

FNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/admin/import/bneint.lct XX_HR_41_INTG.ldt BNE_INTEGRATORS INTEGRATOR_ASN="PER" INTEGRATOR_CODE="HR_41_INTG"

In order to upload theseFNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/admin/import/bneint.lct XX_HR_101_INTG.ldt

FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/admin/import/bneint.lct XX_HR_41_INTG.ldt

Question : Please demo how to FNDLOAD Layouts in Web ADIAnswer :  To identify the layout codes codes, run the below SQL.

=====Find the Layouts from layout names=====SELECT LAYOUT_CODEFROM bne_layouts_vl vlWHERE user_name IN ('Offer Letter for Job', 'Denial of Job')==============Above SQL can return values say XX_C_O_F_T & XX_CODETo download these layoutsFNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/admin/import/bnelay.lct XX_C_O_F_T.ldt BNE_LAYOUTS LAYOUT_ASN="PER" LAYOUT_CODE="XX_C_O_F_T"

FNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/admin/import/bnelay.lct XX_CODE.ldt BNE_LAYOUTS LAYOUT_ASN="PER" LAYOUT_CODE="XX_CODE"

Now in order to upload these into new environment, use below commandsFNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD  $BNE_TOP/admin/import/bnelay.lct XX_C_O_F_T.ldt

FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/admin/import/bnelay.lct XX_CODE.ldt

Question : Please demo how to FNDLOAD mappings in Web ADIAnswer :  To identify the mapping codes, run the below SQL.

=====Find the MAPPING CODES from integrator names==SELECT mapping_code, integrator_codeFROM bne_mappings_vlWHERE integrator_code IN      (SELECT integrator_code       FROM bne_integrators_vl vl       WHERE application_id = 800       AND user_name IN ('XX HR Reference letter', 'XX HR Sorry Cant offer'))ORDER BY last_update_date DESC;

67

Page 68: Oracle.anilpassi

Lets say this SQL returns HR_101_MAP & HR_86_MAP

--Now do the downloadFNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/admin/import/bnemap.lct XX_HR_101_MAP.ldt BNE_MAPPINGS MAPPING_ASN="PER" MAPPING_CODE="HR_101_MAP"

FNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/admin/import/bnemap.lct XX_HR_86_MAP.ldt BNE_MAPPINGS MAPPING_ASN="PER" MAPPING_CODE="HR_86_MAP"

To upload these files into a new environment, ftp the ldt files and run below commands on the new environment

FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/admin/import/bnemap.lct XX_HR_101_MAP.ldt

FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD  $BNE_TOP/admin/import/bnemap.lct XX_HR_86_MAP.ldt

Question : Is FNDLOAD of Web ADI contents similar to above?Answer : Its slightly different, as to recognize the contents I had to use the date range to pick all the content codes configured in Web ADI during the past 90 days. =====================SELECT CONTENT_CODEFROM bne_content_cols_vlWHERE last_update_date > SYSDATE - 90group by CONTENT_CODE ;=====================CONTENT_CODE--------------HR_101_CNTHR_41_CNT

For each content code returned by SQL above, we will now do FNDLOAD as below

FNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/admin/import/bnecont.lct XX_HR_101_CNT.ldt BNE_CONTENTS CONTENT_ASN="PER" CONTENT_CODE="HR_101_CNT"

FNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/admin/import/bnecont.lct XX_HR_41_CNT.ldt BNE_CONTENTS CONTENT_ASN="PER" CONTENT_CODE="HR_41_CNT"

Obviously to upload Web ADI contents, use the below commands

FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/admin/import/bnecont.lct XX_HR_101_CNT.ldt

FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/admin/import/bnecont.lct XX_HR_41_CNT.ldt

API to Update FND_USER and Add Responsibility

This article explains how you can reset the passwords and add responsibilities in APPS using scripts. This was tried and tested on 11.5.10 environment.My client: Hey Anil, we need a script to do the following:-A. Update fnd_user records for some 1000 users, to reset their passwords?B: To assign all these 1000 users with a new responsibility, which happens to be a new HRMS Self Service responsibility.C. We must not reset passwords of the employees which are active on that test environment.

Myself: Why do we need this done?

68

Page 69: Oracle.anilpassi

My Client: Well, we need to load test the system by simulating 1000 concurrent self service HR users...

That's the end of our talk. Now let me give you some background. Self Service HRMS kicks off a workflow each time a user logs onto system to either view or update their personal information. The reason for this approach is that SSHR uses workflow to manage the state of its transaction.

Question: Why does Oracle Self Service HR use workflow to manage its state?Answer: Because SSHR was developed before OAF was invented by Oracle. Using OA Framework, it is possible to manage the state of a web based applications via something known as AM(Application Module).

Question : Are you saying that Self Service HR in Oracle does not use OA Framework Answer: Not saying that. In fact Oracle has re-written most of its SSHR to use the OAF, but for some reasons(which I believe are legacy), the underlying workflow has been retained. I am not saying that this is bad design, but yet this begs to be load tested before goLive.

Question: Why is my client so concerned about load testing self service HR?Answer: Workflows have their overheads, but beyond that SSHR uses some staging tables to capture before and after state of the personal information, while the user is updating the same. This alongwith workflow overhead may hit the system hard, hence the need for load test.

Question: OK, how do you go about reseting 1000 passwords.Answer: Well, we not only have to reset passwords of fnd_user, but also need to assign each of those users a Self Service HR responsibility. This is how we do it:-Scripts steps:-Loop for latest employee records in fnd_user, excluding the recently logged in UAT users.  ...inside the loop call fnd_user_pkg.updateuser  ....again inside the loop call fnd_user_resp_groups_api.insert_assignment (to assign new SSHR Responsibility)   ----within the loop, handle exception in case the user already has that responsibility

Question: How do you write that code?Answer: Here you go....

After the script has completed, you can spool the data from temp table ....NOTE: DO NOT RUN THIS ON PRODUCTION

DECLARE  duplicate_responsibility EXCEPTION;  PRAGMA EXCEPTION_INIT(duplicate_responsibility                       ,-20001);  i INTEGER := 0;  no_action_required EXCEPTION;

  CURSOR c_get IS    SELECT *    FROM fnd_responsibility_vl    WHERE responsibility_name = 'XX HR Employee Self Service';

  p_get c_get%ROWTYPE;BEGIN  OPEN c_get;  FETCH c_get    INTO p_get;  CLOSE c_get;

69

Page 70: Oracle.anilpassi

  DELETE xxschema.fu_4_which_pwd_reset;  FOR p_rec IN (SELECT user_name, user_id                FROM fnd_user                WHERE user_name NOT IN (SELECT fu.user_name                                        FROM fnd_user fu, fnd_logins fl                                        WHERE fl.start_time > SYSDATE - 40                                        AND fu.user_id = fl.user_id                                        GROUP BY fu.user_name, fu.user_id                                        )                AND user_name NOT LIKE '00%'                AND end_date IS NULL                AND employee_id > 0                ORDER BY user_id DESC)  LOOP    i := i + 1;    --First 1000 users only    IF i = 1001    THEN      RAISE no_action_required;    END IF;    fnd_user_pkg.updateuser(x_user_name            => p_rec.user_name                           ,x_owner                => 'SEED'                           ,x_unencrypted_password => 'abcd0123'                           ,x_password_date        => SYSDATE + 500);      BEGIN      fnd_user_resp_groups_api.insert_assignment(user_id                       => p_rec.user_id                                                ,responsibility_id             => p_get.responsibility_id                                                ,responsibility_application_id => p_get.application_id                                                ,security_group_id             => 0                                                ,start_date                    => SYSDATE - 1                                                ,end_date                      => NULL                                                ,description                   => 'Load testing SSHR on Test environment');    EXCEPTION      WHEN duplicate_responsibility THEN        fnd_user_resp_groups_api.update_assignment(user_id                       => p_rec.user_id                                                  ,responsibility_id             => p_get.responsibility_id                                                  ,responsibility_application_id => p_get.application_id                                                  ,security_group_id             => 0                                                  ,start_date                    => SYSDATE - 1                                                  ,end_date                      => NULL                                                  ,description                   => 'Access Reinstated via Load testing SSHR on Test environment');    END;    INSERT INTO xxschema.fu_4_which_pwd_reset      (user_id      ,user_name)    VALUES      (p_rec.user_id      ,p_rec.user_name);  END LOOP;  COMMIT;EXCEPTION  WHEN OTHERS THEN

70

Page 71: Oracle.anilpassi

    COMMIT;END;Forms Personalization in Oracle HRMS For quite some time I was thinking about publishing an article about forms personalization in Oracle HRMS.

The Metalink note on Forms Personalization is helpful, but what it lacks is a pictorial approach to implementingForms Personalizations. I am a visual animal, so I like to explain in that manner too.

My first article in the series of Forms Personalization is in response to a question raised in Oracle Forum under Oracle Human Resources (HRMS ). As per the Oracle forum request, If the Person Type is Employee, their clients wants Person Title field to become Mandatory ( lets assume it is the title field for now).  When the Person Type field changes to a value that is anything but Employee, the person title field should then toggle back to become optional.

Please note that when Person type Employee is selected, value in fieldPERSON.D_PTU_USER_PERSON_TYPE  is assigned a value of “Employee”

Now the requirement is that for “Employee” field PERSON.D_TITLE must be made mandatory.

There are two possible ways the Person Type can change. Either by picking a dropdown list of Action (e.g. Create Employee) or by directly picking up a value from LOV on field “Person Type for Action”. Whenever the person type changes, WHEN-NEW-ITEM-INSTANCE is fired for one for the below fields(depending upon how its changed).  Hence forms personalization must check conditions for below three fieldsPERWSHRG.PERSON.PTU_ACTION_TYPEPERWSHRG.PERSON.D_PTU_USER_PERSON_TYPEPERWSHRG.PERSON.SHOW_NUMBER

The demo below contains conditional check on “WHEN-NEW-ITEM-INSTANCE” of PERSON.PTU_ACTION_TYPE

When implementing this, you will have to replicate the steps in the demo for WNII on both PERWSHRG.PERSON.D_PTU_USER_PERSON_TYPE & PERWSHRG.PERSON.SHOW_NUMBER

I have tested the steps below myself, and they appear to work.

OK, here we go.....

STEP 1Create Personalization as below( to make Title field mandatory)Sequence: 50Description: Make Person Title Mandatory when Person Type is Employee.Trigger Event: WHEN-NEW-ITEM-INSTANCETrigger Object: PERSON.PTU_ACTION_TYPECondition: ${item.person.d_ptu_user_person_type.value} = 'Employee

71

Page 72: Oracle.anilpassi

Check if Person Type is Employee in When New Item Instance

Action Sequence: 10Action Type: PropertyAction Object Type: ItemAction Target Object: PERSON.D_TITLEAction Property Name: REQUIREDAction Value: TRUE

Make Title mandatory when Person Type is Employee

STEP 2Create another Personalization as below ( to make Title field Optional)Sequence: 51Description: Make Person Title Mandatory when Person Type is Employee.Trigger Event: WHEN-NEW-ITEM-INSTANCETrigger Object: PERSON.PTU_ACTION_TYPECondition: NVL(${item.person.d_ptu_user_person_type.value},'xxyyzz') != 'Employee'

72

Page 73: Oracle.anilpassi

Check if Person Type is anything other than Employee in When New Item Instance  Action Sequence: 10Action Type: PropertyAction Object Type: ItemAction Target Object: PERSON.D_TITLEAction Property Name: REQUIREDAction Value: FALSE

Make Title option when Person Type is not Employee

Forms personalisation

In this article, I would like to explain different possibilities of Forms Personalizations. Surely before explaining what can be done, first we will touch base upon what exactly it is.

Why was forms personalization  introduced by Oracle in 11.5.10?1. CUSTOM.pll is a programmatic methodology for extending Oracle Forms, even for trivial tasks.2. Multiple developers working on same CUSTOM.pll could cause version related headaches

Does Forms Personalization replace CUSTOM.pll?Not really, however it does provide an alternative to most common activities for which earlier one would use CUSTOM.pllForms personalization is driven by the same set of events as that for CUSTOM.pll.Keep in mind that Oracle Forms Libraries first invoke the Forms Personalization, and then the

73

Page 74: Oracle.anilpassi

CUSTOM.pll too for the same set of events.

How do I enable Forms Personalizations?Enable the personalizations using the Help/Diagnostics menu.

What are the various components of Forms Personalizations?Different components of Oracle Forms Personalizations are listed below. You begin with recognizing which Triggers/Events that you wish to trap and  under what conditions. The condition can be entered using the syntax as defined in the picture below.

74

Page 75: Oracle.anilpassi

What does the Action Tab do?Here you will either change form property, or display messages or enable menu etc.

Can I modify SQL Query behind the LOV using Forms Personalizations?Of course you can. In the below example I am restricting the LOV to less than 3records by introducing where rownum <3 in record group query.Step 1. Create a new record groupStep 2. Attach the newly created record group to existing LOV in EBS Form.

75

Page 76: Oracle.anilpassi

Can I call a PL/SQL Stored procedure passing it form field variables?Yes,  using the syntax below. Note: You can also invoke FORMS_DDL built-in to perform DDL.

Can I call BuiltIn's? Indeed, as shown below, you can pick  from all the form built-in's as below.

You can also call a form function and pass it parameters using Forms Personalizations

76

Page 77: Oracle.anilpassi

Processing can be aborted if validation were to fail

You can invoke equivalent to app_item_property.set_property.I am displaying the Required property below, however you can use this option for all supportable properties of app_item_property

You can  initialize a global variable. Initialization code is executed if and only if the global variable does not already exist.Use global variables for passing variables back and forth between two forms.Please do not use Global Variables if your logic is restricted to a Single form  itself.

You can assign values to form fields  using global variable.

77

Page 78: Oracle.anilpassi

Using forms personalizations, you can set the Default where clause of the BLOCK too.Note: Don't forget to reset this clause after your desired operation has been finished. This will facilitate the form to run in standalone mode too.

Ditto for Order by Clause on block.

For displaying messages, you can either enter a plain text, or your message can be displayed from the result of a SQL Statement.

78

Page 79: Oracle.anilpassi

Local variables can be defined and they will be active for throughout the session of the current form.Use global variables if you wish to share the variable between multiple forms.Below, just for demo, I am setting the local variable to 0.

In the below picture, I am checking if local variable is 0 then display a message.

You can enable SPECIAL1-15 or MENU1-15, to create new menu entries under the Tool menu.

79

Page 80: Oracle.anilpassi

As seen below, the above two setups have instantiated the new Menu Items

SPECIAL16-30 will create entries under Reports menuSPECIAL31-45 will create entries under Actions menu

You can capture the click on those newly created menu items by trapping event MENU1 or SPECIAL1 [or whatever you defined]

Oracle Fusion Development Tools The roadmap for Oracle Fusion strategy is becoming clearer, thanks to most recent article by Steven Chan.

So the question is, what will be the development skills required by Oracle Fusion Developer?

In order to answer this, lets have a look at current skillsets required for Oracle Apps, and then map those to Oracle Fusion.

80

Page 81: Oracle.anilpassi

Oracle Apps : SQLOracle Fusion : Future is bright for SQL. Oracle Apps : PL/SQLOracle Fusion :  Oracle's current stance is that pl/sql will be integrated part of their Fusion Product.Oracle Apps : XML Gateway In Oracle Apps, you can post XML Documents to XML gateway using protocols such as HTTP, HTTPS, JMS & SMTP. For example Payables Invoices can be posted to XML Gateway by your trading partners. XML Gateway can also be used for outbound XML messages, by extracting data from Views/Tables.Oracle Fusion : BPELBPEL supports all the above protocols. Hence I see no reason why BPEL will nor replace XML Gateway Product.Oracle Apps : Oracle FormsIn Oracle Apps most of the Core data entry screens and many of the inquiry screens were built using D2k Forms. Oracle Forms can't run in the browser directly, hence this limitation was overcome by developing Applet called JInitiator.Oracle Fusion : ADF with Faces[JSF] appears to be winning the race. Have a look at http://www.jsfcentral.com Oracle Apps : Oracle ReportsThousands of reports have been written using Oracle Reports uptill Release 12.Not a single one of these will be carried forward to Oracle Fusion.Oracle Fusion : XMLPYes, no surprises here. It is indeed  XML Publisher.Oracle Report is proprietry tool that works just with Oracle Database. Also, Oracle would like their reporting tools to converge into a single reporting tool for  Peoplesoft, JD Edwards & Oracle Apps.XML Publisher will hopefully become as powerfull as Oracle Reports by the time Oracle Fusion is released.Oracle Apps : OA FrameworkOracle Fusion : The answer is same as that for Oracle Forms above. However one must continue to learn OA Framework, as its concepts like Personalizations, Extensions will be carried forward to ADF. Both are MVC based topologies.Oracle Apps : Oracle DiscovererOracle Fusion : I think this will remain, as Discoverer is a part of Oracle Fusion Middleware. At the end of the day, XMLP is not a business intelligence tool.Oracle Apps : Oracle Web ADIOracle Fusion : XMLP. I wonder why Web ADI will be needed, as letter can be printed off using XML Publisher itself.Oracle Apps : Oracle WorkflowsOracle Fusion : This will certainly be replaced by BPEL too.Clearly the future is :-Web Services with BPELJava/J2EE XML/CSS/XSL/JavaScript/ADFSQL & PL/SQL

FND Debug Log - Debugging Oracle Apps code There was a time when every individual Oracle Applications module used its own debugging technique.

But this is changing now, thanks to FND Logging. I have been using FND Logging for over one year now, ever since 11.5.10 was released, hence I would like to share knowledge on this topic.

What is the use of FND Debug Log?1. It helps you pinpoint the cause of error in standard Oracle Code, by making debug messages to appear in a centralized table named FND_LOG_MESSAGES.2. You can design and build your custom extensions in a manner that can easily be debugged. This can be done by calling Oracle delivered API’s in your custom code.

81

Page 82: Oracle.anilpassi

Where is the debug message stored, once the logging is turned on?Debug messages are stored in a table called FND_LOG_MESSAGESA program written in any technology, either form, or report, or pl/sql or java concurrent program or OAF…all their debug messages will be stored in fnd_log_messages.

How to debug the issue being faced in Oracle Application?Step 1 Set the following profile options at your user level(your fnd_user)FND: Debug Log LevelFollowing possible values are available, but I suggest you set this to "Statement" level when debugging code.   LEVEL_UNEXPECTED     : Internal Level Id is 6   LEVEL_ERROR          : Internal Level Id is 5   LEVEL_EXCEPTION      : Internal Level Id is 4   LEVEL_EVENT          : Internal Level Id is 3   LEVEL_PROCEDURE      : Internal Level Id is 2   LEVEL_STATEMENT      : Internal Level Id is 1

FND: Debug Log Enabled    Set this profile to Yes

FND: Debug Log Module    Set this to %Step 2 Login to the application and reproduce the problem.

Step 3  SELECT *FROM fnd_log_messagesWHERE user_id = 209122 /*your FND_USER user_id here*/AND TIMESTAMP > SYSDATE - .3ORDER BY log_sequence DESC /*note the order by clause here*/

The result of this select statement will provide the list of all the debug messages, on top will appear the most recent debug messages..

Why should I setup the module name to %, in profile option?You can set this to po%, if you know for sure that the error was caused by code written in po module. However po code might be internally calling hr code which might inturn be calling fnd code. Hence it’s best to set this profile value as %.You may also use comma delimited values i.e po%,hr%,fnd%

Why must I bother debugging Oracle's Standard code when I can quickly raise a tar.If the issue is with Standard Oracle Code, first thing you must do is to search into Metalink.

82

Page 83: Oracle.anilpassi

However having the debug information on error helps your searching ability further. Uploading the debug messages upfront during Tar creation will also help Oracle speedily understand and fix your issues.

Why to set the profile option to statement level?This profile option has following main levels.-ErrorWarningProcedureStatement

I like setting this to "Statement" level as it extracts debug messages at all levels, in one glance. You can latter filter those debug messages by using below SQL for exampleselect * from fnd_log_messages where user_id = 111 and LOG_LEVEL =5     

What if the piece of code causing the error is not appearing in fnd_log_messages?This is very much possible. The fnd_log_messages might have helped you get close to the culprit piece of code , but may not be able to pinpoint the error as there may not be enough debug messages implanted by Oracle.You can do one of the below:-A. Run the database sql trace for the session with bind variables and see the last meaningful SQL statement in the raw trace file.Please note that PL/SQL statements will not appear in trace, only the SQL Statements will appear, hence you may consider option (b) below B. Add your own debug messages to the pl/sql code that was delivered by oracle, which you suspect is causing problem. This is a temporary change, and must only be done on development environment, NEVER DO THIS CHANGE ON PRODUCTION.

The size of table FND_LOG_MESSAGES will keep on increasing?You can run concurrent program “Purge Debug Log and System Alerts”.

I have written a pl/sql concurrent process to interface Purchase Orders from 3rd Party System. How will add debug messages?    fnd_log.STRING(log_level => fnd_log.level_statement                  ,module    => 'xxpo.packagename.procedurename'                  ,message   => 'debug message here');

Will the above debug command create an entry into fnd_log_messages ?Debug records will be created in fnd_log_messages if and only if you run the interface program after setting the profile options as suggested above.

What if a rollback occurs due to unhandled exception. Will the inserts done to fnd_log_messages be lost?fnd_log.string eventually calls procedure  FND_LOG.STRING_UNCHECKED_INTERNAL2. This procedure uses pragma AUTONOMOUS_TRANSACTION with a commit.Hence your debug messages will not be lost despite a rollback in parent session.

What if an exception is incurred within the Debug Logging API itself?Oracle takes well care of this by handling the WHEN OTHERS exception. It is evident from below Oracle Code for debug API   PROCEDURE STRING(LOG_LEVEL IN NUMBER,                    MODULE    IN VARCHAR2,                    MESSAGE   IN VARCHAR2) is   begin      /* Short circuit if logging not turned on at this level */      if (LOG_LEVEL < G_CURRENT_RUNTIME_LEVEL) then         return;      end if;

83

Page 84: Oracle.anilpassi

      if FND_LOG_REPOSITORY.CHECK_ACCESS_INTERNAL (MODULE, LOG_LEVEL) then         FND_LOG_REPOSITORY.STR_UNCHKED_INT_WITH_CONTEXT(                               LOG_LEVEL       => LOG_LEVEL,                               MODULE          => MODULE,                               MESSAGE_TEXT    => MESSAGE);      end if;      exception         when others then        NULL; /* supress the exception */   end;

XML Publisher Concurrent Program - XMLP In this article I have listed a step by step demo of XML Publisher as a Concurrent Program in Oracle Apps.

I think it is very important that you get a feel of XML Publisher, as this will become the reporting tool in Fusion [assuming XMLP can become as powerful as Oracle Report in the given time].

Before I explain the steps in details with screenshots, let me brief them:-a.    Create a report and register it as Concurrent Program of type XMLb.    Build a Data Definition & XML Template using XML Publisher.c.    Create a relation between XML Template & Concurrent Program.

Sounds simple, it is indeed, but devil lies in detail. Hence read the below carefully.I have provided the source code with installation instructions for you to try this. Please note to try this you need 11.5.10 environment.

Now lets get into the details….Step by Step…..1. Create a table xx_emp_demo and insert two records into it.create table xx_managers ( manager_no integer, manager_name varchar2(200) ) ;insert into xx_managers ( manager_no, manager_name ) values ( 1000, 'Anil Passi') ;insert into xx_managers ( manager_no, manager_name ) values ( 1001, 'Martin') ;commit;

2. Next you need a concurrent program that spit out an XML file to the output of the concurrent program. Such concurrent program can be of type SQL or PL/SQL or Oracle Report or any other supportable type, provided it can produce a XML output.Hence in this case, we will develop a Report that has all the columns from table xx_managersCreate a plain default Oracle Report using wizard in Oracle Reports 6i.This can be done using wizard with SQL “select * from xx_managers”

Above picture shows the report output in Reports 6i preview

84

Page 85: Oracle.anilpassi

Do not change anything in DESFORMAT, as Concurrent Manager will take care of passing XML to this. Hence XML Publisher will be fed an XML output by the concurrent manager itself. 3. Add three user parameters P_CONC_REQUEST_ID,  P_RESPONSIBILITY_ID, P_USER_ID

These parameters will make it possible to run a report as concurrent program.Save the above RDF as XX_MANAGERS.rdf

4. FTP XX_MANAGERS.rdf  to $AR_TOP/reports/USSilly it is, but for demo I will use standard Application [forgive me, but I am making it easier for you to run the source code].

5. Create Concurrent program executable for XMLP report, as if it is a normal report

6. Create a concurrent program for the executable. Note that I have kept the short name and the program name both as XX_MANAGERS.IMPORTANT:- Note that format is XML

85

Page 86: Oracle.anilpassi

7. Register this program with Receivables request group.DECLAREBEGINFND_PROGRAM.add_to_group    (     PROGRAM_SHORT_NAME  =>'XX_MANAGERS'    ,PROGRAM_APPLICATION =>'AR'    ,REQUEST_GROUP       => 'Receivables All'    ,GROUP_APPLICATION   =>'AR'    ) ;      commit;exception     when others then           dbms_output.put_line('Object already exists'); END ;/

8. Run the report and you will see an xml output appearing. Save the output as XX_MANAGERS_241106.xml on your computer. You will need to use menu /Tool/Copy to open this XML output in browser, and then save it as XX_MANAGERS_241106.xml on your PC.

NOW THE TIME TO DO XML PUBLISHER BIT…

9. Install this XML Publisher Desktop software on your pc, ensuring that you have MS-Word installed(for this demo)The XML Builder Desktop Patch for Word is Patch Number: 4561835This software can be downloaded from http://updates.oracle.com/download/4561835.html

This is a tool given by Oracle[Desktop XML Publisher] that will read any XML file, will create the fields automatically.

10. Open MS Word after installing as per step 9, and you will now see something similar to below in Microsoft Word

Now in MS Word, click on “Load XML Data” and select file XX_MANAGERS_241106.xml that was created in Step 8.

86

Page 87: Oracle.anilpassi

11. Now, click on Insert/Table FormAnd then drag and drop “List G Manager No” within the template section and click on OK.

Effectively by doing these steps, you have just created a Layout for the report in XML Publisher. The layout will look like this [as below].

Save this MSWord file as MANAGER_XML_TEMPLATE.rtf

By clicking on Preview, you will see the output as below

12. Now, lets do the real bit in attaching the Concurrent Program definition to XML Publisher. Logon to responsibility “XML Publisher Administrator”.

87

Page 88: Oracle.anilpassi

Click on “Data Definition” menu as above…so that we can create the XMLs source data Definition. Effectively we are saying that output of the Concurrent program becomes the data definition for XMLP.

Lets define the value in below fields Name : XX_MANAGERSApplication : ReceivablesCode : XX_MANAGERS  [Note: This is the short name of the Concurrent program]Start Date : Leave it to default SysdateClick on “Apply”

13. Now lets define a template as below for XML Publisher.

For doing so, click on Templates Tab. We need to create a Template for the data-definition of previous step.

Name : XX_MANAGERS  [this is the name of the template]Code : XX_MANAGERS  [short name of conc program]Application : ReceivablesData Definition : XX_MANAGERS [the one that we created in prior step 12]Start Date: : Leave this default.Type : RTFClick on browse and select the RTF file[MANAGER_XML_TEMPLATE.rtf] that you had saved in Step 11.xmlp_A_14

Click on Apply, and you will get the below record.

88

Page 89: Oracle.anilpassi

14. Navigate to “Receivables Manager” and submit report XX_MANAGERS.Click on Output button to see the report as pasted below.

Audit Trail in Oracle Apps - EBS Oracle Apps provides an Out of the Box Audit Trail Functionality that works like a charm.

I never had thought about writing an Article on Audit Trail feature, until Kartikey pinged me to write an article on this subject. You can achieve Auditing[as explained in Step by Step example below] without writing a single piece of Code in Oracle Apps. It can be argued that CDC [change data capture] might be used, but I think the design of CDC is more friendly for Warehousing purposes, rather than Audit Reporting.

Lets say that we wish to create a audit trail on a table named FND_LOOKUP_VALUES.

Step 1: Find the name of Application for table to be AuditedLets first find the application name of this Oracle Apps table.SELECT application_nameFROM fnd_application_vl fav, fnd_tables ftWHERE ft.table_name = 'FND_LOOKUP_VALUES'AND ft.application_id = fav.application_id

The above SQL returns Application Object Library.

Step 2: Ensure that Audit on the Application is EnabledNavigate to System Administrator Menu Security/AuditTrail/Install

The owner of table FND_LOOKUP_VALUES is APPLSYS. Hence query on APPLSYS to ensure that Audit is enabled for this Application.

Step 3: Create Audit GroupNavigate to System Administrator Menu Security/AuditTrail/Groups

89

Page 90: Oracle.anilpassi

Application Name: Application Object LibraryAudit Group: XX Audit Lookup ValuesGroup State: Enabled

Now, add audit tables to this group[you can add as many tables]User Table Name: FND_LOOKUP_VALUES

Step 4: Run Concurrent program “AuditTrail Update Tables”This process can be run from System Administrator responsibility. It has no parameter. Running this process will create the Audit tables and the triggers that manage Audit data.

Step 5: Ensure that Audit Tables have been created as expectedSELECT object_name, object_typeFROM all_objectsWHERE object_name LIKE 'FND_LOOKUP_VALUES_A%'

OBJECT_NAME                      OBJECT_TYPE--------------------------                      --------------------------FND_LOOKUP_VALUES_A       TABLEFND_LOOKUP_VALUES_A       SYNONYMFND_LOOKUP_VALUES_AC    TRIGGERFND_LOOKUP_VALUES_AC1   VIEWFND_LOOKUP_VALUES_AD    TRIGGERFND_LOOKUP_VALUES_ADP  PROCEDUREFND_LOOKUP_VALUES_AH    TRIGGERFND_LOOKUP_VALUES_AI      TRIGGERFND_LOOKUP_VALUES_AIP    PROCEDUREFND_LOOKUP_VALUES_AT    TRIGGERFND_LOOKUP_VALUES_AU    TRIGGERFND_LOOKUP_VALUES_AUP  PROCEDUREFND_LOOKUP_VALUES_AV1   VIEW

90

Page 91: Oracle.anilpassi

Fine, this proves that the concurrent program in Step 4 did its job.Optionally, you may run concurrent process “AuditTrail Report for Audit Group Validation” to validate the success of Audit Table/Trigger creation.

Step 6: Now create a new lookup type to test Audit TrailNavigate to “Application Developer” responsibility and create a lookup type and Lookup codes as below.

Step 7: Now see the results of the Audit TrailNow run the query below, you can see the Audit information has been generated.SELECT audit_transaction_type      ,audit_user_name      ,audit_sequence_id      ,lookup_code      ,lookup_typeFROM fnd_lookup_values_a

Step 8: Add further columns for Audit TrailBy default Oracle will Audit Trail on all columns that are a part of first available Unique Index on FND_LOOKUP_VALUES.However further columns can be added to the Audit Trail. Lets say you wish to Audit Trail on Column Meaning too.Navigate to System Administrator Menu Security/AuditTrail/Tables

91

Page 92: Oracle.anilpassi

You can add additional columns to audit trail and re-execute Step 4.Please note that adding columns for Audit could have been done immediately after Step 3.

This explains how you can Audit trail changes to Data in Oracle Applications, without writing a single line of code.

Hierarchy Profile Options This article is an attempt to explain the Hierarchy Profile Options with examples.

Can all the profile options be set at Organization Level and Server level?You need to set “Hierarchy Type” field in Profile Option definition to enable that profile to be eligible for Hierarchy Level. This functionality was introduced in 11.5.9

How to find from SQL*Plus whether a Profile Option is Hierarchy Enabled?SELECT HIERARCHY_TYPE  FROM fnd_profile_options_vl where profile_option_name = 'profile option short name' ;If the above SQL returns SERVER, then the profile is enabled at Server Level.If the above SQL returns ORG, then the profile is enabled for Organization Level.If the above SQL returns SERVRESP, then the profile is enabled for both Server and Responsibility Level.

Why the need of Organization Level profile option?For example multiple responsibilities can be attached to same Operating Unit. In such event, it can get tedious to attach the same profile option to each such responsibility. By attaching an Organization Level Profile Option to an Operating Unit implies that all such responsibilities inherit Org Level Profile value.

Will Organization Level Profile override the Responsibility Level Profile?Yes

Give me some example usages of Server Level ProfilesManaging TimezonesIn a single Global DB Instance implementation, you may desire to display different time in UI screen, depending upon the local timezone. If you have a separate Middle Tier Server for each timezone, then timezone profile options [Enable Timezone Conversions, Client Timezone, Server Timezone] can be set at

92

Page 93: Oracle.anilpassi

Server Level.

External WWW Facing Mid TiersIt is possible that for security reasons, you may desire to change the functionality of Application when its accessed from External WWW facing mid-tier. Such security profiles can be assigned at server level. For example, profile option “Node Trust Level” can be set to a value of external against a server to flag the specific mid-tier server as External. See Link for details.

Give me some example usages of Organization Level ProfilesManaging TimezonesIn a single Global DB Instance implementation, you may desire to display different time in UI screen, depending upon the local timezone. If you can’t afford to have a separate Middle Tier Server for each timezone, then timezone profile options [Enable Timezone Conversions, Client Timezone, Server Timezone] can be set at Organization Level, as each Organization assumingly will be in a specific timezone.

Setting Org Level Profile Option in HRMSA HRMS Business Group can be assigned to various Oracle HRMS Responsibilities. Keeping a track of profiles against all such responsibilities, which belong to a specific Business Group can be tedious. Hence you may simplify this by simply assigning the profile to Business Group Organisation.

What is the order of precedence for Profiles?Security Profiles: Site Level >> Application Level >> Resp Level >> User LevelServer Profiles: Site Level >> Server Level >> User LevelOrganization Profiles : Site Level >> Organization Level >> User Level

Customization of Reports in Oracle Apps Oracle Reports will become a thing of past in Fusion, however it will still demand resources for the next 5yrs or so.

Hence I decided to write this article to fulfill my commitment towards http://getappstraining.blogspot.com

We learnt in Forms Customization article that customized executables must be registered with Custom Application. This rule applies to Oracle Reports too in Oracle Applications.

Important note: Just like Oracle Forms, there is no place for D2K Reports in Fusion. This will be replaced by XML publisher. I will explain that transition in a latter article very soon.

Question: I have been asked to customize Invoice Print program which happens to be an Oracle Report. What will be the steps, that I must follow.Answer : Follow the steps below.1. You will be told the name of the existing report that must be customized. Note down the exact name and query that name in Concurrent Program screen. Click on “Copy Program button” selecting checkbox option “Copy Parameters”. This will help you copy the current program definition to custom version of the program. Also note down the name of the executable as it appears in concurrent program definition screen.

2. In same responsibility i.e. Application Developer, navigate to screen concurrent executable and query on the field labeled "Executable Short Name".Note down the application within which it is registered. If the application is Oracle Receivables, then you must go to the database server and get hold the file named RAXINV.rdf in $AR_TOP/reports/US.

3. Copy that file to your custom AR Top directory. Basically that is the directory where custom reports for AR will be deployed..

93

Page 94: Oracle.anilpassi

cd $XXAR_TOP/reports/uscp $AR_TOP/reports/us/RAXINV.rdf $XXAR_TOP/reports/us

Effectively you have now done the following:-1. Made the custom version of report registered with XXAR application. If you worked for say company named EA, then this might have been $EAAR_TOP/reports/US2. When you run that report, Oracle concurrent manager will search for that report in $XXAR_TOP/reports/USThe report will be found there, and executed.

Note: We haven’t made any changes as yet. Also, you need to include the new concurrent program name in the relevant request group.

Now you can ftp that report to your pc, make modifications for necessary customizations, and then ftp that piece of rdf back to the server. Run it again, to see it working.

Some important tips:-1. Avoid writing SQL in format trigger, although in rare cases it becomes necessary to do so.2. Learn from Oracle's Report, by reverse engineering them.3. Do not write a formula column for something which can be achieved by amending the query in data group itself.4. Do not hardcode things like Currency Formatting. Have a look at Oracle's Amount fields, and use the same user exit. 5. srw2.message can be used for minor debugging, as those messages will appear in the log file of the concurrent program.6. You can set the trace checkbox against the concurrent program definition, to generate SQL Trace. This trace will not produce bind variable values though.7. Join between two queries in data group will always be outerjoined, by default.8. Avoid filters on Data Group queries. Try to implement that logic within the query itself.

Find Request Group for Concurrent Programs

In this article, I would like to give you a quick trick to find "which request group should the concurrent program be added to"? Many a times, we create a new concurrent program following which we try to make that program available from a specific Menu under a specific responsibility.

I have created a concurrent program, and I now wish to know which request group must this program be added to?

Step 1. Ensure that profile option "Utilities:Diagnostics" is set to Yes at your user level.

Note:- This step can be skipped in case you have the apps password.

Step 2. Navigate to the responsibility from where you will submit the concurrent program.

Step 3. Navigate to the "Submit New Request" screen, where you will enter the name of the concurrent program to run.

Step 4. Now you must do examine using the help menu as shown below.

94

Page 95: Oracle.anilpassi

Step 5. In the block field, enter PARAMETER, and in the field name enter REQUEST_GROUP_CODE

Note down this valueStep 6. Now in the value field enter REQUEST_GROUP_APPL_SHORT_NAME

Note down the two values from Step 5 and Step 6.

These will indicate the request group to which you must add your concurrent program.

Question: In the submit request screen, REQUEST_GROUP_CODE is blank??

In this case use the Request group specified in "Define Responsibility Screen"

The rule is :-

If request group code is being passed in as parameter to Submit Request form function, then 95

Page 96: Oracle.anilpassi

use that request group. Or else use the request group at responsibility level.

NOTES:-

Why do I need both the request group code and the request group application?

Request group name and its application is a composite primary key, hence you need the application name. For example "All Reports" request group can be found under every possible application.

Where does this request group parameter come from?

This request group name and application are defined as parameters to the form functions.

Is this form function attached to submit request form?

Correct

If at the time of defining form function, we do not pass request group parameter, then request group from responsibility is used?

Correct, because request group specified against responsibility is the default request group.

Smart Descriptive Flexfields In this article, I would like to explain some tricks with context sensitive Descriptive Flexfields. To begin with lets consider some scenarios as below.

Scenario 1. Depending upon the responsibility user has logged into, you wish to either show two flexfield segemts or three segments. This is a fairly common requirement.Scenario 2. There are two different oracle screens, both based on same table but different functionality. Hence the share the same descriptiveflexfields. You wish to use notation :block.fieldname in the value set. But this will work in one screen and error in another.

Can't we simply use context sensitive flexfields?You certainly can. However, what if you do not want to make your user select the value in context field manually? In this case you need to take your design a step further.In fact, before you proceed further with this article, you must read this link Basic Concepts of Context Sensitive Descriptive Flexfields.In case you do not know much about profile options, you must also read link basic concepts of Profile Options

What are the options at hand for solutions to Scenatio 1 and Scenario 2?Option 1. Use profile option as the contextOption 2. Use a system global variable as the context.

How does this work?In case of using profile option, value in Context Reference Field of the descriptive flexfield will be the profile option[see picture below].Lets say for Responsibility-1 this profile is set to XX, and for Responsibility-2 this profile is set to YY, and for a special user this profile is set to value ZZ.

You can then define three different contexts, as below. Context XX  Uses attribute1 and attribute2, using value sets vs1 and vs2Context YY  Uses attribute 1, using value set vs3Context ZZ  Uses attribute2 with value set vs4 , making this descriptive flexfield segment mandatory.

96

Page 97: Oracle.anilpassi

Depending upon which responsibility user logs into, and also depending upon which user logs into the screen, they will see different flexfield segments popping up.

Ah, what if same user in a single responsibility has access to different screens that share same DFF?In this scenario, you can design your descriptive flexfield on a System variable context. Hence your context will be :SYSTEM.CURRENT_FORM. Depending upon which form the user has navigated to, they will see different segments.

Note: Use Examine utility to find out the Current Form Name

Sounds good, but what are the pitfalls?1. :blockname.fieldname convention does not works for OA Framework screens.2. There is only one context reference field available per Descriptive Flexfield. If you choose to have your DFF context sensitive on a profile option, then you will have to live with it forever(ah should I say fusion-when D2K forms are gone). However this limitation can be overcome by using fnd_profile.put api, to alter the profile option value at runtime for forms session. Effectively you can modify the context[by changing profile option value pragmatically], using formspersonalizations.

How about OA Framework? Do we need these design methodology in OA Framework too?Not really, because in OA Framework, you can use personalizations to decide which Context + Attribute combination must be displayed. Personalizations can be performed at responsibility level to get the desired result as discussed in example above.

XML Publisher - Developing reports printed on Pre-Printed Stationary

Abstract

I was inspired to come up with this because I feel that lots of people want this solution and they

97

Page 98: Oracle.anilpassi

are struggling to implement this.

In this whitepaper, I am going to explain the approach which I used for developing pre-printed stationary reports by XML publisher’s RTF method. This approach I used for 2 customers and it works absolutely fine. They are very happy. Example Pre-Printed stationary reports which I worked on are following ‘AP Check Printing(Bank)’ ,’AR invoice Printing’,’PO purchase Order Printing’ …. etc….

Background

I have a customer who wants to convert their 40+ Oracle Apps reports to ‘XML publisher’ Reports. These reports are fall in categories of AR invoice report, check printing report and PO print report which they are printing on pre-printed (pre-defined) stationary.

Just a little background of pre-printed stationary report’s layout where there is a fix Header section and fix Detail Section Table. Detail section table should always have fix table height, in the sense it should always have fix number of rows in the table no matter how many rows returned by actual report run. For example Invoice stationary has fix 30 rows in line detail table, and Actual report run is returning only 5 rows then rest 25 blank rows should be generatedprogrammatically.

So far there are solutions available which are talking about fixing table height for the 1st pages onwards not for the first page itself, i.e. where actual report run is returning lines which are less than lines_fixed_per_page. For example Invoice run is returning only 5 rows where as pre-printed stationary has fixed 30 lines per page.I struggled a lot to get this solution and now I got this and sharing it in this whitepaper.

So far it has not been discovered because of the limitation of for-loop in XSL-FO (XML Technology).Limitation I mean is ,we can not write loop like ‘ for (i=10;i<15;i++)’ in XML. In XML ‘for’ loop will always iterate till it gets data, if we want to go beyond that then we can not go. I mean we can write for loop based on data value.

To overcome this problem, I have used Sub-template concept which I am calling recursively.

Detail Solution

 I am giving this solution for Standard Check Printing Report. Tree structure of data (Sample XML data is as follow).

<LIST_G_CHECKS>

    <G_CHECKS>  -- Top Most root -- Header

      <C_CHECK_NUMBER>21897</C_CHECK_NUMBER>

      <C_VENDOR_NUMBER>2205</C_VENDOR_NUMBER>

      <LIST_G_INVOICES>

        <G_INVOICES> -- Inner loop - Line Section

          <C_PAYMENT_NUMBER>1</C_PAYMENT_NUMBER>

          <C_INVOICE_NUMBER>ERS-20-SEP-06-243</C_INVOICE_NUMBER>

        </G_INVOICES>

        <G_INVOICES> -- Inner loop - Line Section

          <C_PAYMENT_NUMBER>2</C_PAYMENT_NUMBER>

          <C_INVOICE_NUMBER>ERS-20-SEP-06-244</C_INVOICE_NUMBER>

98

Page 99: Oracle.anilpassi

        </G_INVOICES>

      </LIST_G_INVOICES>

    </G_CHECKS>

</LIST_G_CHECKS>

Below is the step-step guide which I follow.

1) Open the Outermost for loop --  G_CHECKS

<?for-each@section:G_CHECKS?>  

2) Declare Global Variable called ‘no_of_lines_per_page’  -- In this case I have fixed 40 lines per page.

<xsl:variable name="no_of_lines_per_page" select="number(40)"/>

3) Declare incontext variable for inner group (G_INVOICES), variable is called ‘inner_group’

<xsl:variable xdofo:ctx="incontext" name="inner_group” select=".//G_INVOICES"/>

4) Open the Inner Loop

   <?for-each:$inner_group?>

5) Before putting any elements with the help of current record pointer 'position()’, I am checking if the current position is modulizing with the no_of_lines_per_page equals zero or not. If it reaches the first record after modulizing then I will create local variable 'first_rec' and initialize it with '0'.

<?if:(position()-1) mod $no_of_lines_per_page=0?><xsl:variable name="first_rec" xdofo:ctx="incontext" select="position()"/>

Note : -- Above 3 steps ( 3,4,5) are created under ‘V_inner_group_And_V_First_rec’ form-field. Here there is limitation of Microsoft-word. We can enter upto 138 characters only in ‘Status’ field of ‘Add help text’ button.If you want to add more , you can do this by clicking on ‘Help Key’  which is adjacent to ‘Status’ tab.

6) If above condition holds true then we will iterate the inner loop.

<?for-each:$inner_group?>

7) I will check with the help of current record pointer 'position()' that the current record position is either greater than 'first_rec' i.e. the first record or less the 'no_of_lines_per_page' value set up earlier. If it is then show the record otherwise not otherwise it will not go in loop.

   <?if:position()>=$first_rec and position()<$first_rec+$no_of_lines_per_page?>

8) Here I am closing the inner for loop and if condition

   <?end if?><?end for-each?>

9) Here I am checking if no_of_lines of invoice is modulizing with the no_of_lines_per_page equals to zero or not ,and the same time I am checking if $first_rec+$no_of_lines_per_page is greater than no_of_lines of invoice or not. This is important step for filling the blank rows.

<?if:not(count($inner_group) mod $no_of_lines_per_page=0) and ($first_rec+$no_of_lines_per_page>count($inner_group))?>

10) Now I am calling sub-template recursively for filling the blank rows. While calling this template I am passing one parameter which is having value of no_of_rows to fill. Sub-template will have just one row table.

99

Page 100: Oracle.anilpassi

<xsl:call-template xdofo:ctx="inline" name="countdown"><xsl:with-param name="countdown" select="$no_of_lines_per_page - (count($inner_group) mod $no_of_lines_per_page)"/></xsl:call-template>

11) Sub-template declaration

   <xsl:template name="countdown">

   <xsl:param name="countdown"/><xsl:if test="$countdown"><xsl:call-template   

   name="countdown"><xsl:with-param name="countdown" select="$countdown - 1"/>  

   </xsl:call-template></xsl:if>

   </xsl:template>

12) I have created page break after the fixed number of rows have been displayed.

   <xsl:if xdofo:ctx="inblock" test="$first_rec+$no_of_lines_per_page<=count($inner_group)">

      <xsl:attribute name="break-before">page</xsl:attribute>

   </xsl:if>

13) Finally closing outer if and inner for loop and outer for loop.

   <?end if?><?end for-each?><?end for-each?>

If you want more information then please contact me on [email protected]

Procure to Pay - Order to Cash - End to End Cycle Functional Documents

This document will help you to understand the complete Business Flow of Oracle Application including the accounting flow of Transactions in a Make to Stock Business Scenario

This document covers the following

A. Business Case                                                                                                      

1)      Creation of Items

2)      Setting up Selling Price for an Item                                                                   

3)      Define Customer                                                                                     

4)      Creation of Sales Order                                                                         

5)      Enter Item Costs                                                                                     

6)      Define Resources                                                                                               

7)      Define Departments                                                                               

8)      Define Routing (CPU Sub assembly)                                                     

9)      Define Bill of Materials (BOM) CPU Sub assembly                            

10)  Define Routing (Dell Computer)                                                

11)  Define Bill of Materials (BOM)  (Dell Computer)                               

12)  Define Suppliers                                                                                     

13)  Enter Purchase Requisitions                                                                  

14)  Create Purchase Orders                                                                         

100

Page 101: Oracle.anilpassi

15)  Enter Receipts (Inventory Receipt)                                                                  

16)  Auto-create Supplier Invoice                                                                             

17)  Create, View Invoices and Make Payments in Payables                                 

18)  Payments Reconciliation                                                                        

19)  Create, Release, Complete, Close Discrete Job for CPU Subassembly         

20)  Create, Release, Complete, Close Discrete Job for Dell Computer               

21)  Sales Order Booking, Releasing, Ship Confirm the Finished Goods               

22)  Run Auto invoice                                                                                    

23)  View Sales Invoice, Create Receipt, Remittance and view Account Balances

24)  Receipt Reconciliation                                                                           

This Document has been broken to three parts owing to the size of the document is very huge. Hence readers are requested to read the Document Links in the following Sequence to understand the complete flow of Transactions

a)      Business Case Study and Set up in Oracle Applications – I

b)      Procure to Pay and Manufacturing Cycle – II

c)      Order to Cash Cycle – III

101