Concurrent Program
Concurrent Program
from backend
We need to use FND_PROGRAM.REGISTER api to create an concurrent program from backend
database, below is the sample script.
/******************************************************
*PURPOSE: To Create a Concurrent Program from backend *
*AUTHOR: Shailender Thallam *
*******************************************************/
--
DECLARE
--
l_program VARCHAR2 (200);
l_application VARCHAR2 (200);
l_enabled VARCHAR2 (200);
l_short_name VARCHAR2 (200);
l_description VARCHAR2 (200);
l_executable_short_name VARCHAR2 (200);
l_executable_application VARCHAR2 (200);
l_execution_options VARCHAR2 (200);
l_priority NUMBER;
l_save_output VARCHAR2 (200);
l_print VARCHAR2 (200);
l_cols NUMBER;
l_rows NUMBER;
l_style VARCHAR2 (200);
l_style_required VARCHAR2 (200);
l_printer VARCHAR2 (200);
l_request_type VARCHAR2 (200);
l_request_type_application VARCHAR2 (200);
l_use_in_srs VARCHAR2 (200);
l_allow_disabled_values VARCHAR2 (200);
l_run_alone VARCHAR2 (200);
l_output_type VARCHAR2 (200);
l_enable_trace VARCHAR2 (200);
l_restart VARCHAR2 (200);
l_nls_compliant VARCHAR2 (200);
l_icon_name VARCHAR2 (200);
l_language_code VARCHAR2 (200);
l_mls_function_short_name VARCHAR2 (200);
l_mls_function_application VARCHAR2 (200);
l_incrementor VARCHAR2 (200);
l_refresh_portlet VARCHAR2 (200);
l_check VARCHAR2 (2);
--
BEGIN
--
l_program := 'Concurrent program registered from backend
- OracleAppsDNA';
l_application := 'CUSTOM Custom';
l_enabled := 'Y';
l_short_name := 'XX_ORACLEAPPSDNA_CP';
l_description := 'OracleAppsDNA Test Program';
l_executable_short_name := 'XX_ORACLEAPPSDNA_EXE';
l_executable_application := 'CUSTOM Custom';
l_execution_options := NULL;
l_priority := NULL;
l_save_output := 'Y';
l_print := 'Y';
l_cols := NULL;
l_rows := NULL;
l_style := NULL;
l_style_required := 'N';
l_printer := NULL;
l_request_type := NULL;
l_request_type_application := NULL;
l_use_in_srs := 'Y';
l_allow_disabled_values := 'N';
l_run_alone := 'N';
l_output_type := 'TEXT';
l_enable_trace := 'N';
l_restart := 'Y';
l_nls_compliant := 'Y';
l_icon_name := NULL;
l_language_code := 'US';
l_mls_function_short_name := NULL;
l_mls_function_application := NULL;
l_incrementor := NULL;
l_refresh_portlet := NULL;
--
--Calling API to create concurrent program definition
--
apps.fnd_program.register
(program => l_program,
application => l_application,
enabled => l_enabled,
short_name => l_short_name,
description => l_description,
executable_short_name => l_executable_short_name,
executable_application => l_executable_application,
execution_options => l_execution_options,
priority => l_priority,
save_output => l_save_output,
print => l_print,
cols => l_cols,
ROWS => l_rows,
STYLE => l_style,
style_required => l_style_required,
printer => l_printer,
request_type => l_request_type,
request_type_application => l_request_type_application,
use_in_srs => l_use_in_srs,
allow_disabled_values => l_allow_disabled_values,
run_alone => l_run_alone,
output_type => l_output_type,
enable_trace => l_enable_trace,
restart => l_restart,
nls_compliant => l_nls_compliant,
icon_name => l_icon_name,
language_code => l_language_code,
mls_function_short_name => l_mls_function_short_name,
mls_function_application => l_mls_function_application,
incrementor => l_incrementor,
refresh_portlet => l_refresh_portlet
);
--
COMMIT;
--
BEGIN
--
--To check whether Concurrent Program is registered or not
--
SELECT 'Y'
INTO l_check
FROM fnd_concurrent_programs
WHERE concurrent_program_name = 'XX_ORACLEAPPSDNA_CP';
--
DBMS_OUTPUT.put_line ('Concurrent Program Registered Successfully');
--
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.put_line ('Concurrent Program Registration Failed');
END;
END;
View from front end application:
1. The various output types are PS, PDF, HTML, TEXT, PCL, XML.
2. The above script inserts data into FND_CONCURRENT_PROGRAMS and
FND_CONCURRENT_PROGRAMS_TL tables
PL/SQL Script to Create a Concurrent Program
Parameter from backend
We need to use FND_PROGRAM.PARAMETER api to create an concurrent program parameter
from backend database, below is the sample script.
/****************************************************************
*PURPOSE: To Create a Concurrent Program Parameter from backend *
*AUTHOR: Shailender Thallam *
*****************************************************************/
--
DECLARE
--
l_program_short_name VARCHAR2 (200);
l_application VARCHAR2 (200);
l_sequence NUMBER;
l_parameter VARCHAR2 (200);
l_description VARCHAR2 (200);
l_enabled VARCHAR2 (200);
l_value_set VARCHAR2 (200);
l_default_type VARCHAR2 (200);
l_default_value VARCHAR2 (200);
l_required VARCHAR2 (200);
l_enable_security VARCHAR2 (200);
l_range VARCHAR2 (200);
l_display VARCHAR2 (200);
l_display_size NUMBER;
l_description_size NUMBER;
l_concatenated_descr_size NUMBER;
l_prompt VARCHAR2 (200);
l_token VARCHAR2 (200);
l_cd_parameter VARCHAR2 (200);
l_check VARCHAR2 (2);
--
BEGIN
--
l_program_short_name := 'XX_ORACLEAPPSDNA_CP';
l_application := 'CUSTOM Custom';
l_sequence := 10;
l_parameter := 'Employee Name';
l_description := 'Employee Name';
l_enabled := 'Y';
l_value_set := '240 Characters';
l_default_type := NULL;
l_default_value := NULL;
l_required := 'N';
l_enable_security := 'N';
l_range := NULL;
l_display := 'Y';
l_display_size := 50;
l_description_size := 50;
l_concatenated_descr_size := 50;
l_prompt := 'Employee Name';
l_token := NULL;
l_cd_parameter := NULL;
--
--Calling API to create a Parameter for a concurrent program definition
--
apps.fnd_program.parameter
(program_short_name => l_program_short_name,
application => l_application,
SEQUENCE => l_sequence,
parameter => l_parameter,
description => l_description,
enabled => l_enabled,
value_set => l_value_set,
default_type => l_default_type,
DEFAULT_VALUE => l_default_value,
required => l_required,
enable_security => l_enable_security,
RANGE => l_range,
display => l_display,
display_size => l_display_size,
description_size => l_description_size,
concatenated_description_size => l_concatenated_descr_size,
prompt => l_prompt,
token => l_token,
cd_parameter => l_cd_parameter
);
--
COMMIT;
--
BEGIN
--
--To check whether a parameter is assigned to a Concurrent Program or
not
--
SELECT 'Y'
INTO l_check
FROM fnd_descr_flex_column_usages
WHERE descriptive_flexfield_name = '$SRS$.'
|| 'XX_ORACLEAPPSDNA_CP'
AND end_user_column_name = 'Employee Name';
--
dbms_output.put_line ('Concurrent Program Parameter registered
Successfully');
--
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line ('Concurrent Program Parameter Registration
Failed');
END;
--
END;
/*********************************************************
*PURPOSE: To Add a Concurrent Program to a Request Group *
* from backend *
*AUTHOR: Shailender Thallam *
**********************************************************/
--
DECLARE
l_program_short_name VARCHAR2 (200);
l_program_application VARCHAR2 (200);
l_request_group VARCHAR2 (200);
l_group_application VARCHAR2 (200);
l_check VARCHAR2 (2);
--
BEGIN
--
l_program_short_name := 'XX_ORACLEAPPSDNA_CP';
l_program_application := 'CUSTOM Custom';
l_request_group := 'System Administrator Reports';
l_group_application := 'Application Object Library';
--
--Calling API to assign concurrent program to a reqest group
--
apps.fnd_program.add_to_group (program_short_name =>
l_program_short_name,
program_application =>
l_program_application,
request_group => l_request_group,
group_application => l_group_application
);
--
COMMIT;
--
BEGIN
--
--To check whether a paramter is assigned to a Concurrent Program or
not
--
SELECT 'Y'
INTO l_check
FROM fnd_request_groups frg,
fnd_request_group_units frgu,
fnd_concurrent_programs fcp
WHERE frg.request_group_id = frgu.request_group_id
AND frg.application_id = frgu.application_id
AND frgu.request_unit_id = fcp.concurrent_program_id
AND frgu.unit_application_id = fcp.application_id
AND fcp.concurrent_program_name = 'XX_ORACLEAPPSDNA_CP';
--
dbms_output.put_line ('Adding Concurrent Program to Request Group
Succeeded');
--
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line ('Adding Concurrent Program to Request Group
Failed');
END;
END;
/**************************************************
***************************************************/
--
DECLARE
--
--
BEGIN
--
l_executable := 'XX_ORACLEAPPSDNA_EXE';
l_short_name := 'XX_ORACLEAPPSDNA_EXE';
l_execution_file_name := 'XX_ORACLEAPPSDNA_PKG.MAIN';
l_subroutine_name := NULL;
l_icon_name := NULL;
l_language_code := 'US';
l_execution_file_path := NULL;
--
--
execution_file_name =>
l_execution_file_name,
);
COMMIT;
BEGIN
--
--
SELECT 'Y'
INTO l_check
FROM fnd_executables
--
--
EXCEPTION
WHEN NO_DATA_FOUND
THEN
END;
END;
View from front end application:
FROM fnd_lookup_values
BEGIN
/*First we need to initialize the apps, this will automatically done when we submit the program
from application directly*/
BEGIN
SELECT user_id
INTO v_user_id
FROM fnd_user
WHERE user_name = 'USER NAME';
EXCEPTION
WHEN OTHERS
THEN
v_user_id := NULL;
END;
BEGIN
SELECT fa.application_id, fr.responsibility_id,
fr.responsibility_name, fa.application_short_name
INTO v_app_id, v_resp_id,
v_resp_name, v_app_name
FROM fnd_responsibility_vl fr, fnd_application fa
WHERE responsibility_name LIKE 'Order Management Super User'
AND fr.application_id = fa.application_id;
EXCEPTION
WHEN OTHERS
THEN
v_app_id:=null;
v_resp_id:=null;
v_resp_name:=null;
v_app_name:=null;
END;
-- Initializing apps
fnd_global.apps_initialize (user_id => v_user_id,
resp_id => v_resp_id,
resp_appl_id => v_app_id
);
use_reservation_time_fence : = 'Y';
resertvaton_run_types : = 'RESERVE';
booked : = 'Y';
reservation_mode : = 'PARTIAL';
order_by : = 'ORDERED_DATE';
item : = Inventory_item_id;
warehouse : = Organization_id;
/*These are the parameters of the reserve orders program which will passed as arguments
through fnd_request.submit_request function*/
v_request_id :=
fnd_request.submit_request (v_app_name, /* Short name of the application
under which the program is registered in this it will be ONT since the Reserve Order program is
registered under order management*/
'OMRSVORD', -- Short name of the concurrent program needs to
submitted
NULL, -- concurrent program description OPTIONAL parameter
SYSDATE, /* Start time parameter which can be used to mention the
actual start of the concurrent program which once again OPTIONAL*/
FALSE, /* Sub request parameters if this program is need to be
submitted from another running request then TRUE needs to passed, but default is FALSE and an
OPTIONAL parameter*/
argument1 => use_reservation_time_fence,
argument2 => '',
argument3 => '',
argument4 => '',
argument5 => '',
argument6 => '',
argument7 => warehouse,
argument8 => item,
argument9 => '',
argument10 => '',
argument11 => '',
argument12 => '',
argument13 => '',
argument14 => '',
argument15 => '',
argument16 => '',
argument17 => '',
argument18 => '',
argument19 => booked,
argument20 => reservation_mode,
argument21 => '',
argument22 => '',
argument23 => '',
argument24 => '',
argument25 => resertvaton_run_types,
argument26 => '',
argument27 => '',
argument28 => order_by,
argument29 => '',
argument30 => '',
argument31 => ''
);
100 arguments are available through which additional parameters can be passed to the
concurrent program.
Passing unequal number (or) unmatched additional parameters will complete the
concurrent program with ERROR Status.
COMMIT;
Only after the explicit commit the submitted requested will be available in the
fnd_concurrent_request table and in the Oracle apps.
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ( 'Main Exception'
|| SQLERRM
|| DBMS_UTILITY.format_error_backtrace
);
End;
If you have any queries related to this, do comment below we are ready to rectify your
queries in ease..
Tags: Oracle apps,
FND_REQUEST.SUBMIT_REQUEST, fnd_concurrent.wait_for_request,plsql for
submitting concurrent program, fnd packages