Concurrent program return code. This is actually a pl/sql package that will be called as a form from oracle applications. I want the oracle job to appear. APP-FND-00500: AFPPRN received a return code of failure from routine FDUPRN. Program exited with status 1 Cause: AFPPRN received a return code of failure from the OSD routine FDUPRN. Program exited with status 1. Action: Review your concurrent request log file for more detailed information.
Oracle Apps Concurrent Processing/Programs works on the principle – Work simultaneously, to efficiently use the available resource like hardware, software, etc. You can submit multiple instances of the same or different concurrent program in parallel. A dedicated concurrent manager controls the execution of programs. Programs run in background asynchronous manner.
Let’s see how to define concurrent programs in Oracle Applications (Apps).
Table of Contents
Create concurrent program execution file
This is a physical file which contains business logic. It can be a PL/SQL stored procedure, Oracle Reports, Host – an Operating system based execution file, C or Pro* C based spawned program, Java file.
To keep it simple, we will use a PL/SQL stored procedure for demonstration.
[sql]
CREATE OR REPLACE PACKAGE concurrent_demo
AS
PROCEDURE main(
o_chr_errbuf OUT VARCHAR2,
o_chr_retcode OUT VARCHAR,
p_custom_parameter IN VARCHAR2);
END concurrent_demo;
/
CREATE OR REPLACE PACKAGE body concurrent_demo
AS
PROCEDURE main(
o_chr_errbuf OUT VARCHAR2,
o_chr_retcode OUT VARCHAR,
p_custom_parameter IN VARCHAR2)
IS
BEGIN
–Write business logic here.
—I am putting only MESSAGE FOR demo purpose
Fnd_file.put_line(fnd_file.log, ‘Concurrent program execution demo starts’);
Fnd_file.put_line(fnd_file.output, ‘Concurrent program execution demo starts’);
AS
PROCEDURE main(
o_chr_errbuf OUT VARCHAR2,
o_chr_retcode OUT VARCHAR,
p_custom_parameter IN VARCHAR2);
END concurrent_demo;
/
CREATE OR REPLACE PACKAGE body concurrent_demo
AS
PROCEDURE main(
o_chr_errbuf OUT VARCHAR2,
o_chr_retcode OUT VARCHAR,
p_custom_parameter IN VARCHAR2)
IS
BEGIN
–Write business logic here.
—I am putting only MESSAGE FOR demo purpose
Fnd_file.put_line(fnd_file.log, ‘Concurrent program execution demo starts’);
Fnd_file.put_line(fnd_file.output, ‘Concurrent program execution demo starts’);
Fnd_file.put_line(fnd_file.log, ‘Input Parameter :- ‘ || p_custom_parameter);
Fnd_file.put_line(fnd_file.output, ‘Input Parameter :- ‘ || p_custom_parameter );
Fnd_file.put_line(fnd_file.output, ‘Input Parameter :- ‘ || p_custom_parameter );
dbms_lock.sleep(120);
o_chr_retcode := ‘0’; — 0 – Normal 1 – Warning 2 – Error
o_chr_errbuf := ‘No Error’;
o_chr_errbuf := ‘No Error’;
Fnd_file.put_line(fnd_file.log, ‘Concurrent program execution demo ends’);
Fnd_file.put_line(fnd_file.output, ‘Concurrent program execution demo ends’);
Fnd_file.put_line(fnd_file.output, ‘Concurrent program execution demo ends’);
END main;
END concurrent_demo;
/
END concurrent_demo;
/
[/sql]
The main procedure has two out parameter and one custom in the parameter. Two out parameters o_chr_errbuf, o_chr_retcode are mandatory and should be defined in the same sequence. You can return the status code to concurrent manager post completion of the program.
Typical usage of these parameter as shown below.
Depending on retcode programs end is normal, warning or error.
- 0 – Program complete in normal
- 1 – Program completed in warning
- 2 – Program completed in error
Define Concurrent Program Executable
This is the first step. You need to define executable for the concurrent program. This actually maps excutable file with excutable AOL in Oracle Apps. Login to Oracle Applications and navigate to Application Developer -> Concurrent -> Executable. Define executable in Oracle Apps as shown below.
- Executable: Valid executable name
- Short Name: Valid short name
- Application: application name which owns concurrent program
- Description: Valid description
- Execution Method: PL/SQL stored procedure, Host, Oracle Reports
- Execution File Name: Actual name of file, database package, or Oracle report
Define Concurrent Programs
Next step is defining a concurrent program. Navigate to Application Developer -> Concurrent -> Program
Define concurrent program in Oracle Apps as shown below. Select executable as defined above. Click on parameter button to define input parameters.
Define Concurrent Program Parameters
These are the placeholder for the custom parameter. Here you need to define the only custom parameter. Note our procedure is having three parameters, two are mandatory.
Do not define placeholder for those mandatory parameters. These out parameters are internally used by the concurrent program to return error message and status to concurrent manager.
Register concurrent program with responsibility
You can submit concurrent program using below methods in Oracle Apps,
- SRS window
- UNIX CONCSUB utility
We are going to use the first method. So we need to register the program with a request group in Oracle Apps. A request group, in turn, is attached to responsibility.
Let’s register it with Inventory Responsibility.
Navigate to System Administrator -> Security -> Responsibility – > Define to get Request group for inventory responsibility. All Inclusive GUI is a request group.
Navigate to System Administrator -> Security -> Responsibility – > Request. Add your program to request group.
Submit concurrent program
Lets test concurrent program by submitting it. Navigate to Inventory-> View -> Request->Submit New Request. Select concurrent program and click on submit.
You can submit multiple instances of the same program as shown below.
I hope you found this article on defining concurrent program in Oracle Apps helpful. Please share and do let me know your feedback in the comments section below.
Reference and further reading:
How to define Concurrent Program in Oracle Apps