Sample Script for Registering Concurrent Program through API
CREATE OR REPLACE PROCEDURE xxebiz_conc_prg is
v_appl_name VARCHAR2(240) := 'ONT';
lp_mesg VARCHAR2(2000);
lp_success VARCHAR2(1) := 'Y';
BEGIN
dbms_output.put_line('ebiz customer Concurrent Progam By Using API');
lp_success := 'Y';
IF Fnd_Program.executable_exists(executable_short_name => 'ONT_CUST_orderreceipt'
,application => v_appl_name) THEN
IF Fnd_Program.program_exists(program => 'ONT_CUST_orderreceipt',application => v_appl_name ) THEN
BEGIN
dbms_output.put_line('Program ONT_CUST_orderreceipt already exists ...now deletiing it ');
Fnd_Program.delete_program('ONT_CUST_orderreceipt',v_appl_name);
dbms_output.put_line('ONT_CUST_orderreceipt deleted successfully ... ');
EXCEPTION
WHEN OTHERS THEN
lp_success := 'N';
dbms_output.put_line('Unable to delete the program ONT_CUST_orderreceipt....');
RAISE;
END ;
END IF ;
BEGIN
dbms_output.put_line('Executable ONT_CUST_orderreceipt already exists ...now deletiing it ');
Fnd_Program.delete_executable('ONT_CUST_orderreceipt',v_appl_name);
dbms_output.put_line('ONT_CUST_orderreceipt deleted successfully ... ');
EXCEPTION
WHEN OTHERS THEN
lp_success := 'N';
dbms_output.put_line('Unable to delete the executable ONT_CUST_orderreceipt....');
RAISE;
END ;
END IF;
IF lp_success = 'Y' THEN
dbms_output.put_line(rpad('Executable : ',10,' ')||'ONT_CUST_orderreceipt');
Fnd_Program.executable
(
executable => 'ONT_CUST_orderreceipt'
,short_name => 'ONT_CUST_orderreceipt'
,application => v_appl_name
,description => 'ONT_CUST_orderreceipt'
,execution_method => 'SQL*Loader'
,execution_file_name => 'ONT_CUST_orderreceipt'
,subroutine_name => NULL
,ICON_NAME => NULL
,LANGUAGE_CODE => 'US'
,EXECUTION_FILE_PATH => NULL
);
dbms_output.put_line(rpad('Register :',17,' ')||'ONT_CUST_orderreceipt');
Fnd_Program.register
(
program => 'ONT_CUST_orderreceipt'
,application => v_appl_name
,enabled => 'Y'
,short_name => 'ONT_CUST_orderreceipt'
,description => 'ONT_CUST_orderreceipt'
,executable_short_name => 'ONT_CUST_orderreceipt'
,executable_application => v_appl_name
,priority => NULL
,save_output => 'Y'
,print => 'N'
,cols => 132
,ROWS => 45
,style => NULL--'A4' --to be checked
,style_required => 'N'
,printer => NULL--'' --to be checked
,use_in_SRS => 'Y'
,allow_disabled_values => 'N'
,run_alone => 'N'
,enable_trace => 'N'
,restart => 'Y'
,nls_compliant => 'Y'
,output_type => 'Text'
,execution_options => NULL
,request_type => NULL
,request_type_application => NULL
,icon_name => NULL
,language_code => 'US'
,mls_function_short_name => NULL
,mls_function_application => NULL
,incrementor => NULL
);
COMMIT;
END IF;
--adding to request group
dbms_output.put_line(rpad('Request group :',10,' ')||'ONT_CUST_orderreceipt' );
lp_success := 'Y';
IF Fnd_Program.PROGRAM_IN_GROUP('ONT_CUST_orderreceipt'
,v_appl_name
,'All Reports'
,v_appl_name) THEN
BEGIN
dbms_output.put_line(' Program exist in request group .. now removing it ..');
Fnd_Program.REMOVE_FROM_GROUP('ONT_CUST_orderreceipt'
,v_appl_name
,'All Reports'
,v_appl_name
);
-- dbms_output.put_line('Program removed successfully from request group ...');
EXCEPTION
WHEN OTHERS THEN
lp_success := 'N';
dbms_output.put_line(' Error while removing the program from request group ...');
RAISE;
END ;
END IF;
IF lp_success = 'Y' THEN
Fnd_Program.add_to_GROUP
('ONT_CUST_orderreceipt'
,v_appl_name
,'All Reports'
,v_appl_name
);
COMMIT;
END IF;
END;
/
SHOW ERR
CREATE OR REPLACE PROCEDURE xxebiz_conc_prg is
v_appl_name VARCHAR2(240) := 'ONT';
lp_mesg VARCHAR2(2000);
lp_success VARCHAR2(1) := 'Y';
BEGIN
dbms_output.put_line('ebiz customer Concurrent Progam By Using API');
lp_success := 'Y';
IF Fnd_Program.executable_exists(executable_short_name => 'ONT_CUST_orderreceipt'
,application => v_appl_name) THEN
IF Fnd_Program.program_exists(program => 'ONT_CUST_orderreceipt',application => v_appl_name ) THEN
BEGIN
dbms_output.put_line('Program ONT_CUST_orderreceipt already exists ...now deletiing it ');
Fnd_Program.delete_program('ONT_CUST_orderreceipt',v_appl_name);
dbms_output.put_line('ONT_CUST_orderreceipt deleted successfully ... ');
EXCEPTION
WHEN OTHERS THEN
lp_success := 'N';
dbms_output.put_line('Unable to delete the program ONT_CUST_orderreceipt....');
RAISE;
END ;
END IF ;
BEGIN
dbms_output.put_line('Executable ONT_CUST_orderreceipt already exists ...now deletiing it ');
Fnd_Program.delete_executable('ONT_CUST_orderreceipt',v_appl_name);
dbms_output.put_line('ONT_CUST_orderreceipt deleted successfully ... ');
EXCEPTION
WHEN OTHERS THEN
lp_success := 'N';
dbms_output.put_line('Unable to delete the executable ONT_CUST_orderreceipt....');
RAISE;
END ;
END IF;
IF lp_success = 'Y' THEN
dbms_output.put_line(rpad('Executable : ',10,' ')||'ONT_CUST_orderreceipt');
Fnd_Program.executable
(
executable => 'ONT_CUST_orderreceipt'
,short_name => 'ONT_CUST_orderreceipt'
,application => v_appl_name
,description => 'ONT_CUST_orderreceipt'
,execution_method => 'SQL*Loader'
,execution_file_name => 'ONT_CUST_orderreceipt'
,subroutine_name => NULL
,ICON_NAME => NULL
,LANGUAGE_CODE => 'US'
,EXECUTION_FILE_PATH => NULL
);
dbms_output.put_line(rpad('Register :',17,' ')||'ONT_CUST_orderreceipt');
Fnd_Program.register
(
program => 'ONT_CUST_orderreceipt'
,application => v_appl_name
,enabled => 'Y'
,short_name => 'ONT_CUST_orderreceipt'
,description => 'ONT_CUST_orderreceipt'
,executable_short_name => 'ONT_CUST_orderreceipt'
,executable_application => v_appl_name
,priority => NULL
,save_output => 'Y'
,print => 'N'
,cols => 132
,ROWS => 45
,style => NULL--'A4' --to be checked
,style_required => 'N'
,printer => NULL--'' --to be checked
,use_in_SRS => 'Y'
,allow_disabled_values => 'N'
,run_alone => 'N'
,enable_trace => 'N'
,restart => 'Y'
,nls_compliant => 'Y'
,output_type => 'Text'
,execution_options => NULL
,request_type => NULL
,request_type_application => NULL
,icon_name => NULL
,language_code => 'US'
,mls_function_short_name => NULL
,mls_function_application => NULL
,incrementor => NULL
);
COMMIT;
END IF;
--adding to request group
dbms_output.put_line(rpad('Request group :',10,' ')||'ONT_CUST_orderreceipt' );
lp_success := 'Y';
IF Fnd_Program.PROGRAM_IN_GROUP('ONT_CUST_orderreceipt'
,v_appl_name
,'All Reports'
,v_appl_name) THEN
BEGIN
dbms_output.put_line(' Program exist in request group .. now removing it ..');
Fnd_Program.REMOVE_FROM_GROUP('ONT_CUST_orderreceipt'
,v_appl_name
,'All Reports'
,v_appl_name
);
-- dbms_output.put_line('Program removed successfully from request group ...');
EXCEPTION
WHEN OTHERS THEN
lp_success := 'N';
dbms_output.put_line(' Error while removing the program from request group ...');
RAISE;
END ;
END IF;
IF lp_success = 'Y' THEN
Fnd_Program.add_to_GROUP
('ONT_CUST_orderreceipt'
,v_appl_name
,'All Reports'
,v_appl_name
);
COMMIT;
END IF;
END;
/
SHOW ERR