How to define Concurrent Program in Oracle Apps

oracle-concurrent-program-define

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).

Create a concurrent program execution file

This is a physical file that 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.

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');

Fnd_file.put_line(fnd_file.log, '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';

Fnd_file.put_line(fnd_file.log, 'Concurrent program execution demo ends');
Fnd_file.put_line(fnd_file.output, 'Concurrent program execution demo ends');

END main;
END concurrent_demo;
/

 PROCEDURE main(
         o_chr_errbuf OUT VARCHAR2,
         o_chr_retcode OUT VARCHAR,
         p_custom_parameter IN VARCHAR2);

The main procedure has two out parameters 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 the concurrent manager post completion of the program.

Typical usage of this parameter is shown below.

o_chr_errbuf := "Error while executing the program  ' || SQLERRM
o_chr_retcode = "2"

Depending on retcode program’s 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 an executable for the concurrent program. This actually maps executable file with executable AOL in Oracle Apps. Login  to Oracle Applications and navigate to Application Developer -> Concurrent -> Executable. Define executable in Oracle Apps as shown below.

oracle-concurrent-program-executable

  • Executable: Valid executable name
  • Short Name: Valid short name
  • Application: application name which owns the concurrent program
  • Description: Valid description
  • Execution Method: PL/SQL stored procedure, Host, Oracle Reports
  • Execution File Name: Actual name of the 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 the parameter button to define input parameters.

oracle-concurrent-program-define

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 a placeholder for those mandatory parameters. These out parameters are internally used by the concurrent program to return error messages and status to the concurrent manager.

oracle-concurrent-program-parameter

Register concurrent program with responsibility

You can submit concurrent program using the below methods in Oracle Apps,

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.

oracle-responsibility-request-group

Navigate to System Administrator -> Security -> Responsibility – > Request. Add your program to request group.

oracle-concurrent-program-register-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.

oracle-submit-concurrent-program

You can submit multiple instances of the same program as shown below.

oracle-request-summary-window

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:

 

Share This: