Vous êtes sur la page 1sur 17

Profile Option in Oracle Apps

Posted by Prudhvi avuthuArticles, Sysadmin and AOLAdd comments

Profile Option in Oracle Apps:

Profile Option values control the behavior of Oracle Apps, in other words they determine how Oracle

Apps should run. The value for a profile option can be changed any time.

For Example we have a profile option called MO: Operating Unit. Assigning a value to this profile

option will determine what operating unit it should use when a user gets into a particular

responsibility.

We have two types of Profile options System and Personal profile options depending on to whom

they are visible and who can update their values.

System Profile options are visible and can be updated only in System Administrator responsibility. In

short they will be maintained by a System Administrator only.

User Profile Options are visible and can be updated by any end user of Oracle Apps.

Profile Options can be set at different levels. Site level being the highest and User being the lowest in

the heirarchy. If a profile option is assigned at two levels, then value assigned at lowest level takes the

precedence.

Site (restricted to the whole of Apps)

Application ( restricted only to a particular application like Payables, Receivables)

Responsibility (restricted only to a particular responsibility)

Organization (restricted to a particular organization)

User (restricted to a user)


Now lets see how to create a new profile option and assign a value to it.

Say you want to create a profile option called erpSchools Debug and the possible values that the user

can choose are Yes, No. If the user chooses Yes, then the custom concurrent program will print all the

debug messages otherwise the debug messages will not printed in the log file of the concurrent

request.

Creating a Profile Option:

Navigation: Application Developer > Profile

Profiles window will open up where you enter the below details:

Name: Give a meaningful and unique name for this profile option

Application: Enter the application for which this profile option will be used like Payables, Receivables

etc. If it is for a custom program then choose the custom application.

User Profile Name: Again enter a meaningful and unique name. This is the name that the users will

see in the Profile Options window.

Description: Enter the purpose or usage of this option.

Heirarchy Type Access Levels: At what levels this profile option should be visible and updatable.
Active dates: Enter the dates on which the profile option becomes active/inactive

User Access:

Visible Determines whether your end users can see and query this profile option in their personal

profiles. Otherwise, they cannot query or update values for this option.

Updatable Determines whether your end users can change the value of this profile option using their

Profile Values window. Otherwise, your system administrator must set values for this profile option.

SQL Validation: You can write up a SQL statement to display the selected rows in LOV. If this section is

left blank, there will no LOV instead the user can enter any free text as value.

Click here to know more about SQL Validation rules

Save the work.


Assign a value to the profile option:

Navigation: System Administrator > Profile > System

Enter the below when the window opens and click on Find button

Under Display section, Choose at what level you want to assign a value.

In the Find field, enter the profile option name to which you want to assign the value.
Enter the value that you want to assign to profile option at the appropriate level and save.

To derive a value of profile option from PL/SQL procedure:

We have seen how to create and assign value to profile option. Most of the times, custom concurrent

program will need to get the value of a profile option that will determine its course of actions. You will

use API called FND_PROFILE.

1.To get the value of profile option:

1 select FND_PROFILE.value('ERPSCHOOLS DEBUG') from dual;

Remember to pass on the name of the profile option and not the user profile name here.
2. To set value to profile option from PL/SQL procedure:

1 BEGIN
2 FND_PROFILE.put ('ERPSCHOOLS DEBUG','No');
3 END;

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 script
A Sql*Loader program
Java program
Oracle Report
Pl/SQL program ( or call it a stored procedure/package procedure)
Host script, like a unix shell script
Pro*C/Spawned
Perl

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
Apps
Step 1. Make Oracle Apps identify the executable
Step 2. Provide a handle to the executable by means of defining a concurrent program
Step 3. Make this concurrent program accesible to selected users via their responsibility.

Question: Please can you describe the above steps in detail


Answer:
Step 1. Make Oracle Apps identify the executable
In 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 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/sql
create 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) IS
BEGIN
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 retcode


These 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 program
This can be done by navigating to responsibility Application Developer and then selecting 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.

After the completion of the request, we check the table

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.

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 responsibility
Payables 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' then
Go_block(lfind_invoices')
Elsif :parameter.invoice_mode='CLERK' then
GO_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/US
And 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 examples


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

Click on menu /application/function


Define 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


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.

We have two types of Profile options System and Personal profile options depending on to whom

they are visible and who can update their values.


System Profile options are visible and can be updated only in System Administrator responsibility. In

short they will be maintained by a System Administrator only.

User Profile Options are visible and can be updated by any end user of Oracle Apps.

Profile Options can be set at different levels. Site level being the highest and User being the lowest in

the heirarchy. If a profile option is assigned at two levels, then value assigned at lowest level takes the

precedence.

Site (restricted to the whole of Apps)

Application ( restricted only to a particular application like Payables, Receivables)

Responsibility (restricted only to a particular responsibility)

Organization (restricted to a particular organization)

User (restricted to a user)

Now lets see how to create a new profile option and assign a value to it.

Say you want to create a profile option called erpSchools Debug and the possible values that the user

can choose are Yes, No. If the user chooses Yes, then the custom concurrent program will print all the

debug messages otherwise the debug messages will not printed in the log file of the concurrent

request.

Creating a Profile Option:

Navigation: Application Developer > Profile


Profiles window will open up where you enter the below details:

Name: Give a meaningful and unique name for this profile option

Application: Enter the application for which this profile option will be used like Payables, Receivables

etc. If it is for a custom program then choose the custom application.

User Profile Name: Again enter a meaningful and unique name. This is the name that the users will

see in the Profile Options window.

Description: Enter the purpose or usage of this option.

Heirarchy Type Access Levels: At what levels this profile option should be visible and updatable.

Active dates: Enter the dates on which the profile option becomes active/inactive

User Access:

Visible Determines whether your end users can see and query this profile option in their personal

profiles. Otherwise, they cannot query or update values for this option.

Updatable Determines whether your end users can change the value of this profile option using their

Profile Values window. Otherwise, your system administrator must set values for this profile option.

SQL Validation: You can write up a SQL statement to display the selected rows in LOV. If this section is

left blank, there will no LOV instead the user can enter any free text as value.

Click here to know more about SQL Validation rules

Save the work.


Assign a value to the profile option:

Navigation: System Administrator > Profile > System

Enter the below when the window opens and click on Find button

Under Display section, Choose at what level you want to assign a value.

In the Find field, enter the profile option name to which you want to assign the value.
Enter the value that you want to assign to profile option at the appropriate level and save.

To derive a value of profile option from PL/SQL procedure:

We have seen how to create and assign value to profile option. Most of the times, custom concurrent

program will need to get the value of a profile option that will determine its course of actions. You will

use API called FND_PROFILE.

1.To get the value of profile option:

1 select FND_PROFILE.value('ERPSCHOOLS DEBUG') from dual;

Remember to pass on the name of the profile option and not the user profile name here.
2. To set value to profile option from PL/SQL procedure:

1 BEGIN
2 FND_PROFILE.put ('ERPSCHOOLS DEBUG','No');
3 END;

Vous aimerez peut-être aussi