PROMPT **************************************************************
PROMPT
PROMPT Script prepared by <programmer name> to register Custom Concurrent Program and Executable
PROMPT Run this script as apps user
PROMPT
PROMPT **************************************************************
DECLARE
l_user_id NUMBER;
BEGIN
BEGIN
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name = '&user_name';
EXCEPTION
WHEN NO_DATA_FOUND THEN
l_user_id := -1;
WHEN OTHERS THEN
l_user_id := -1;
END;
DBMS_OUTPUT.PUT_LINE('****************************');
DBMS_OUTPUT.PUT_LINE('Delete from request group');
DBMS_OUTPUT.PUT_LINE('****************************');
BEGIN
If fnd_program.program_exists('program name','application name') then
fnd_program.remove_from_group
( program_short_name => 'program name'
,program_application => 'application name'
,request_group => 'reguest group name'
,group_application => 'group application name'
);
End if;
END;
DBMS_OUTPUT.PUT_LINE('****************************');
DBMS_OUTPUT.PUT_LINE('Delete Concurrent Program');
DBMS_OUTPUT.PUT_LINE('****************************');
BEGIN
If fnd_program.program_exists('program name','application name') then
fnd_program.delete_program
( program_short_name => 'conc program short name'
,application => 'application name'
);
End if;
END;
DBMS_OUTPUT.PUT_LINE('****************************');
DBMS_OUTPUT.PUT_LINE('Delete Concurrent Executable');
DBMS_OUTPUT.PUT_LINE('****************************');
BEGIN
If FND_PROGRAM.EXECUTABLE_EXISTS('executable name','application name') then
fnd_program.delete_executable
( executable_short_name => 'XX_executable name'
,application => 'application name'
);
End If;
END;
DBMS_OUTPUT.PUT_LINE('****************************');
DBMS_OUTPUT.PUT_LINE('register executable');
DBMS_OUTPUT.PUT_LINE('****************************');
BEGIN
FND_PROGRAM.EXECUTABLE
( executable => 'executable name'
,application => 'application name'
,short_name => 'executable short name'
,description => 'description'
,execution_method => 'executable method'
,execution_file_name => 'executable file name'
);
END;
DBMS_OUTPUT.PUT_LINE('****************************');
DBMS_OUTPUT.PUT_LINE('register concurrent program');
DBMS_OUTPUT.PUT_LINE('****************************');
BEGIN
FND_PROGRAM.REGISTER
( program => 'conc program name'
,application => 'application name'
,enabled => 'Y'
,short_name => 'conc short name'ion name
,description => 'description'
,executable_short_name => 'executable short name'
,executable_application => 'application name'
,execution_options => NULL
,priority => NULL
,save_output => 'Y'
,print => 'Y'
,cols => NULL
,rows => NULL
,style => NULL
,style_required => 'N'
,printer => NULL
,output_type => 'Text'
,use_in_srs => 'Y'
,restart => 'Y'
,nls_compliant => 'Y'
,mls_function_short_name => NULL
,mls_function_application => NULL
);
END;
DBMS_OUTPUT.PUT_LINE('********************************************');
DBMS_OUTPUT.PUT_LINE('Add concurrent program to a Request Group');
DBMS_OUTPUT.PUT_LINE('********************************************');
BEGIN
fnd_program.add_to_group
(program_short_name => 'conc program name'
,program_application => 'application name'
,request_group => 'request group name'
,group_application => 'application name'
);
END;
COMMIT;
--PROMPT **************************************************************
--PROMPT END OF Script
--PROMPT **************************************************************
END;
No comments:
Post a Comment