Register PL SQL Stored Procedure in Oracle Apps
Register PL SQL Stored Procedure in Oracle Apps
Register PL SQL Stored Procedure in Oracle Apps
Oracle Apps
Register PL SQL stored procedure in Oracle Apps:
You have a PL/SQL procedure in your database and you want the user to be able to execute it
from Oracle Apps front end. To do so, we have to register the procedure in Oracle Apps. Now lets
see how to do that.
Steps to register a PL/SQL program:
1. Create procedure
2. Create Executable
3. Create Program
4. Add this program to the required request group
1. Create Procedure:
Lets create a procedure that will take input as Item name and returns the respective Item ID.
If you want to register a procedure, the procedure should be created with the two below
mandatory parameters:
errbuf : For printing out the error messages.
retcode: return 0 for successful execution
return 1 to end the concurrent program in warning
return 2 to end the concurrent program in error
Below is the code snippet of the procedure. Compile the same by connecting to the database as
APPS user.
1 PROCEDURE erps21_conc_prog(
2 errbuf OUT VARCHAR2,
3 retcode OUT VARCHAR2,
4 v_name VARCHAR2 )
5 IS
6 v_item_id VARCHAR2(100);
7 BEGIN
8 SELECT inventory_item_id
9 INTO v_item_id
10 FROM mtl_system_items_b
11 WHERE segment1 = v_name
12 AND rownum =1;
13 fnd_file.put_line(fnd_file.output, 'Parameter received:' || v_item_id);
14 EXCEPTION
15 WHEN OTHERS THEN
16 RETCODE := 2;
17 errbuf := 'Entered EXCEPTION block';
18 END;
3. Create Program:
Navigation: System Administrator/Application Developer responsibility > Concurrent > Program
Enter the below details and save the work.
a.Program: User Understandable Program Name
b.Short Name: This should be a unique name and for system reference
c.Application: Enter the application under which you want to register this concurrent program
d.Executable Name: Enter the Executable Short Name created in Step 2.
e.Method: This will be populated automatically from Executable Definition
f.Output Format: Select the format of the output you want
g.Output Style: Select A4 to print on A4 Paper
h.Printer: You can default any printer or you can enter while submitting concurrent program.
i.Enable Trace: Check this if you want to enable trace on this program. This is normally for
debugging performance issues.
j.Use in SRS: Check this box if you want the users to be able run this program from Submit
Request window.
Click on Parameters button to define the parameters for your concurrent program.
Enter the below details and save the work.
a.Seq: Its always better to enter sequences in multiple of 5 or 10 so that you can insert any
additional parameters if you want later in between.
b.Parameter: Enter a name for the parameter.
c.Description: You can see this description while submitting the concurrent program.
d.Value set: Enter a valid value set name. You can use the standard value sets provided as well.
e.Default Type and Value: These fields are optional. They are to be used when you want to
default any particular value for a parameter.
Current Date : Will be used to pass the Sysdate as default value
Current Time : Will be used to pass the Systime as default value
Constant
Segment
: Will be used to pass the constant number or date or string as default value
: will be used to get the Previous parameter value as default to the next parameter
SQL Statement: We can pass the SELECT statement result as default value
Profile : This will be used to pass the user profile value as default like userid
,username,respid,respname and so on.
Required CheckBox : This will be used to make the parameter as mandatory or optional
f.Prompt: This is the actual parameter name displayed while submitting the concurrent program
g.Token: This should be used only when you are registering a report.This is used to link this
parameter to the parameter defined in actual report file(.rdf)
h.Enabled CheckBox: will be used to enable or disable the parameter
i. Display CheckBox: will be used to hide or display the parameter
Navigation: System Administrator Responsibility > Security > Responsibility > Request
Query for the Request Group obtained above.
Now place the cursor under Requests section and click on ADD icon in the Menu.
Enter the below details and save the work.
1. Type: Enter Program if this is a concurrent program. Enter Set if this is a request set.
=========================
4)Create Executeable
:xxxxx
====>Application name
:xxxxx
=====>Execution method
:oracle reports
Responsibility