Oracle Anilpassi
Oracle Anilpassi
Oracle Anilpassi
1
Design and Development of Open Interfaces in Oracle Apps
Customization of Reports in Oracle 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.htm
http://machinename:portnumber /oa_servlets/AppsLogin
When 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 environment
Testing environment
Production environment
You will most probably, as a techie, be given url,username ad password of the development environment.
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
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
Hurray, we have logged into apps.
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_APPLICATION
FND_UNSUCCESSFUL_LOGINS
FND_SESSIONS
FND_PRODUCT_INSTALLATIONS
FND_PRODUCT_GROUPS
FND_MESSAGES
FND_LANGUAGES_TL
FND_APPLICATION_TL
FND_APPLICATION_VL
FND_LANGUAGES_VL
FND_SIGNON
FND_PUB_MESSAGE
FND_WEBFILEPUB
FND_DISCONNECTED
FND_MESSAGE
FND_SECURITY_PKG
FND_LOOKUPS
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).
4
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
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.
Note, prior to version 10.6(of Oracle ERP –not database version), one had to do
Selelct 'x’ from PO.po_headers_all p, AP.ap_invoices_all a where a.po_Id = p.po_Id
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 Oracle
2. Pre-Interface tables ( Interface will certainly be discussed in one of the latter chapters)
3. Temp processing
4. Staging of data for third party extract interfaces….and much more
5
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.
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”.
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, 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 5
6
For 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 written
IF :oe_line_block.discount_value > fnd_profile.value('OEPASSI_MAX_DISCOUNT')
THEN
message(
'You can’t give discount more than '
|| fnd_profile.value('OEPASSI_MAX_DISCOUNT') || '%' ) ;
raise form_trigger_failure ;-- I mean raise error after showing message
END 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.
You have reached this page from Profile Options Training Article
7
Lets define user JOHN, that is Clerk
Now, we need to define the profile option for discount, hence go to responsibility "Application Developer"
8
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.
Hence go to responsibility "System Administrator"
9
The profile option assignment screen looks like below. Enter JOHN in USER, OEPASSI% in Profile, to select
profile named "OEPASSI Maximum Discount Allowed"
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.
10
Assign 5% max discount for Clerks
11
Assign value 15% to Sales Manager responsibility.
Thanks
Anil Passi
<!--[if !vml]--><!--[endif]-->
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:-
How can all this be achieved, without any hard coding in the screen.
Well....the answer is org_id
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 done
Insert 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.
13
--assuming 101 is French Org Id
execute dbms_application_info.set_client_info ( 101 );
select tax_code from ap_tax_codes ;
---Returns FRVAT
14
Applications in Oracle Apps
In this training chapter I will explain what Application means, in Oracles context.
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)
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 .plx
b. 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/po
d. 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/po
e. When running this report in Oracle Apps, oracle will ask below series of questions to itself
I 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/US
Here lies the significance of applicaton in oracle apps.
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.
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
16
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: 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 deploy the fmx file on mid tier, assuming a purchasing screen has been customized.
Ans: This will be deployed at $XXPO_TOP/forms/us
Basically by deployment I mean that fmx file will be copied to xxpo_top/forms/us
Have you read the previous article on applications?
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 tier
For example use below steps
Step 1
FORMS60_PATH=$FORMS60_PATH:$AU_TOP/forms/US
Step 2
export FORMS60_PATH
Step 3
cd $XXPO_TOP/forms/US
Qns:I have deployed the form at $XXPO_TOP but I can't run it,I get message can not find form
Ans: 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
17
Qns: How can I generate CUSTOM.pll or any other Forms Library
Ans:
----Below statements in one single line
cd $AU_TOP/resource
f60gen module=$AU_TOP/resource/CUSTOM.pll userid=apps/apps output_file=./CUSTOM.plx
module_type=LIBRARY
Qns: All the above sounds good, but how on earth do I connect to Mid Tier to generate forms
Ans: 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_TOP
If 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
18
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
19
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 Programs
2. 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.
Question: When I submit a concurrent program( or call it concurrent request), how does 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.
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....
Question: Is value set attached to all the fields that require validations?
Answer : A big NO
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.
21
Step 2. Now define a value set of type Independent. We will cover the other most widely used Type “Table”
latter.
Step 3. Now, lets add three independent values to the value set for this Cost Centre list. Hence click on
menu Values within Validation
22
Step 4. Here we add the values for IT, HR, SEC to this independent value set.
Step 5. Now let us go back to Concurrent Program that we created in earlier training lesson and Click on
Parameters
Step 6. Now lets create a parameter, and attach the value set that we created to this parameter.
23
Step 7.
Now to test this, lets go to receivables manager and click on Requests.
Click on Request,
Step 8.
Submit New Request, and then click on OK.
24
Step 9
Now, we can see the values defined in the value set here.
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 below
a. 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 like
Code Meaning
25
------ -------------
M Male
F Female
U Undisclosed
Here lies the beauty of lookups, you do not need to modify 2000 odd records in this case.
Now, if your client wants to track Ethnicity at a granular level, they can amend the Oracle delivered lookup
definition as below
Hence these values will then be available in the list of values for Ethnicity field.
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: 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.
26
Once in the screen, you can define your lookup type and lookup codes as below.
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 1
Value sets can be attached to parameters of a concurrent program, whereas Lookups can't.
Difference 2
Certain 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 3
Value 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.
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: 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.
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.
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
29
Add a new segment under "Global Data Elements"
The options for making mandatory or enabling validations for the new field.
30
Once you finalize the changes, you will be prompted to Freeze the DFF definition. Click on OK
31
Context Sensitive Descriptive Flexfields
32
When the user selects Type=SWIFT, we see the relevant SWIFT field appear in Flexfield window
When user selects Type=CHIPS, we see CHIP Id field appearing in Flexfield window.
33
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: GM
Cost Centre: IT
Project: OFP --means Oracle Fusion Project
Expense 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 :- GM
ATTRIBUTE2 :- IT
ATTRIBUTE3 :- OFP
ATTRIBUTE4 :- OCC
When an invoice is received from consulting company, the Payables clerk will capture the Invoice Line
accounting as below in AP_INVOICE_DISTRIBUTIONS_ALL
ATTRIBUTE1 :- GM
ATTRIBUTE2 :- IT
ATTRIBUTE3 :- OFP
ATTRIBUTE4 :- OCC
These 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 :- GM
ATTRIBUTE2 :- IT
ATTRIBUTE3 :- OFP
ATTRIBUTE4 :- 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.
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.
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.
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
36
Workflows
--------------
I suggest you create a directory similar to c:\oracle\wf
Next 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.
Open workflow Standard and save it as WFSTD.wft. You will require this wft file for building all new
Workflows.
37
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/resource
Add 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.
You are now ready to roll with your Oracle Apps development tasks…..
38
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 brief
A) Open up TEMPLATE.fmb, and save this as XXHELLOAPPS.fmb
B) Create a new window, by right clicking on Window/new
Name 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/US
Surely, this XX will be replaced by the naming convention at your client/company.
J) cd to $XXPO_TOP/forms/US
And f60gen on XXHELLOAPPS.fmb
This will create a file executable as XXHELLOAPPS.fmx
K) Go to Application Developer responsibility
Menu /applicaton/form
Register the form
L) Register the Forms Function
Have 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.
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.
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 records
3. Initiate workflows
4. 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 table
Check if the customer already exists in Oracle AR TCA
If customer already exists, thencall the api to update existing customer
If this is a new customer, then update existing TCA Customer/Party record
Step 1
Connect xxschema/password
Create table xx_stage_siebel_customers ( customer_Id integer, customer name varchar2(400));
Grant all on xx_stage_siebel_customers to apps ;
Step 2
Connect apps/apps_password
Create 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 ) is
n_ctr INTEGER := 0 ;
Begin
40
for p_rec in ( select * from xx_synch_siebel_cust ) LOOP
Select count(*) into n_ctr from hz_parties where party_number = p_rec.customer_number;
If n_ctr=0 then
Hz_party_create(pass appropriate parameters here).
Else
Hz_party_update(pass appropriate parameters here);
End if;
END LOOP ;
delete from xx_synch_siebel_cust ;
End xx_synch_siebel_cust
Step 4
Create concurrent program executable ( for example of screenshot, visit link )
Step 5
Create concurrent program for that executable
Step 6
Add this concurrent program to request group
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
wrapping
In my case I am ensuring that $CLIENT_APPS_PWD has the apps password before running the scripts
------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
## Now it's the turn of Lookup values. Again, its not a rocket science
FNDLOAD 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 upload
FNDLOAD 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'
#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 FNDLOAD
43
FNDLOAD 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 upload
FNDLOAD 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 uploading
FNDLOAD 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 commands
FNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct
XX_GL_MY_INTERFACE_SET.ldt
FNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct
XX_GL_MY_INTERFACE_SET_LINK.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
44
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.ldt
FNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct
XX_HZ_ARXCUDCI_STD.ldt
FNDLOAD 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.
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
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 are
GL 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.
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
45
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
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
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 below
conn xx_g4g/&2 ;
--For APPS_QUERY. This table will capture the exceptions during Grants
PROMPT create table XX_GRANTS_FAIL_APPS_QUERY
create table XX_GRANTS_FAIL_APPS_QUERY (
object_name VARCHAR2(100)
,sqlerrm varchar2(2000)
,creation_date DATE
);
Step 3
In this step we grant select on all the existing views and synonyms in apps schema to apps_query.
conn apps/&1 ;
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 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_trg
CREATE 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.SCHEMA
DECLARE
BEGIN
EXECUTE IMMEDIATE
'declare begin ' ||
'dbms_application_info.set_client_info ( 101 ); end;';
EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA =APPS';
END;
/
Step 5
Create 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
47
read-only access to apps_query in Step 2.
conn apps/&1 ;
PROMPT CREATE OR REPLACE TRIGGER xx_grant_apps_query
CREATE OR REPLACE TRIGGER xx_grant_apps_query
--16Jun2006 By Anil Passi
--
AFTER CREATE ON APPS.SCHEMA
DECLARE
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;
/
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 2
Only views and synonyms will be granted access. Objects in your xx_g4g(bespoke) schema should have their
synonyms in apps already in place.
Note 3
If 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 =APPS
This 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 5
It is assumed that ALTER SESSION privilege will exist for APPS_QUERY schema.
--------Beging of script--------------
48
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
*/
,x_email_address => 'appstechnical.blogspot@gmail.com'
,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;
/
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.
49
Question : Ok, what are the steps for building a screen from scratch?
Answer: Below steps in brief
A) Open up TEMPLATE.fmb, and save this as XXHELLOAPPS.fmb
B) Create a new window, by right clicking on Window/new
Name 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/US
Surely, this XX will be replaced by the naming convention at your client/company.
J) cd to $XXPO_TOP/forms/US
And f60gen on XXHELLOAPPS.fmb
This will create a file executable as XXHELLOAPPS.fmx
K) Go to Application Developer responsibility
Menu /applicaton/form
Register the form
L) Register the Forms Function
Have 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.
Please let me know if anything is unclear. Feel free to ask your questions
Question: How can I modify screen without modifying the underlying executable ?
Answer: There are two ways, listed in the order of preferences:-
1. Forms Personalizations
2. CUSTOM.pll
50
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.
Question: What about CUSTOM.pll, what can't be done via custom.pll ?? Hence calling for 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 brief
A) 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/US
Surely, this XX will be replaced by the naming convention at your client/company.
I) cd to $XXPO_TOP/forms/US
And f60gen on XXPOENTRY.fmb
This will create a file executable as XXPOENTRY.fmx
J) Go to Application Developer responsibility
Menu /applicaton/form
Register the form
K) Register the Forms Function
Have 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.
Method1
Open the form to be customized in Oracle Apps from respective Responsibility/Menu
Next 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.
51
Method2
Query 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.
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/us
cp $AR_TOP/reports/us/RAXINV.rdf $XXAR_TOP/reports/us
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.
52
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.
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 : 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.
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.
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_name
XX_TRNSFRM _CUST_ACCOUNT
--parent_cust_Id
--operating_cust_Id
--operating_cust_name
Now, 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.
54
Create or replace procedure xx_migrate_parties(errbuff out varchar2,retcode out varchar2) is
Begin
FOR p_party_rec in (select * from XX_TRNSFRM_PARTY )
LOOP
--call api to create party
Hz_Party_Site_V2pub.create_party();
END LOOP ;
END LOOP ;
END ;
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
Contents
This article covers the above listed components one by one.
Second step
Download 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.
55
Third step
Upload 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.
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 in order to upload these into new environment, use below commands
FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/admin/import/bnelay.lct XX_C_O_F_T.ldt
56
WHERE 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;
Lets say this SQL returns HR_101_MAP & HR_86_MAP
To upload these files into a new environment, ftp the ldt files and run below commands on the new
environment
For each content code returned by SQL above, we will now do FNDLOAD as below
57
Myself: Why do we need this done?
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.
----within the loop, handle exception in case the user already has that responsibility
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
58
INTO p_get;
CLOSE c_get;
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;
59
EXCEPTION
WHEN OTHERS THEN
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
implementing
Forms 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 field
PERSON.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 fields
PERWSHRG.PERSON.PTU_ACTION_TYPE
PERWSHRG.PERSON.D_PTU_USER_PERSON_TYPE
PERWSHRG.PERSON.SHOW_NUMBER
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.
STEP 1
Create Personalization as below( to make Title field mandatory)
Sequence: 50
Description: Make Person Title Mandatory when Person Type is Employee.
Trigger Event: WHEN-NEW-ITEM-INSTANCE
Trigger Object: PERSON.PTU_ACTION_TYPE
Condition: ${item.person.d_ptu_user_person_type.value} = 'Employee
60
Check if Person Type is Employee in When New Item Instance
Action Sequence: 10
Action Type: Property
Action Object Type: Item
Action Target Object: PERSON.D_TITLE
Action Property Name: REQUIRED
Action Value: TRUE
STEP 2
Create another Personalization as below ( to make Title field Optional)
Sequence: 51
Description: Make Person Title Mandatory when Person Type is Employee.
Trigger Event: WHEN-NEW-ITEM-INSTANCE
Trigger Object: PERSON.PTU_ACTION_TYPE
Condition: NVL(${item.person.d_ptu_user_person_type.value},'xxyyzz') != 'Employee'
61
Check if Person Type is anything other than Employee in When New Item Instance
Action Sequence: 10
Action Type: Property
Action Object Type: Item
Action Target Object: PERSON.D_TITLE
Action Property Name: REQUIRED
Action Value: FALSE
62
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.
63
64