DECLARE
l_responsibility_id NUMBER;
l_application_id NUMBER;
l_user_id NUMBER;
l_request_id NUMBER;
BEGIN
--Get Responsibility ID and Application ID
SELECT DISTINCT fr.responsibility_id, frx.application_id
INTO l_responsibility_id, l_application_id
FROM apps.fnd_responsibility frx
,apps.fnd_responsibility_tl fr
WHERE fr.responsibility_id = frx.responsibility_id
AND UPPER (fr.responsibility_name) LIKE UPPER('XX Custom Reports');
--Get User ID
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name = 'XXUSER';
--
--To set environment context.
--
apps.fnd_global.apps_initialize (l_user_id,
l_responsibility_id,
l_application_id);
--
--Submitting Concurrent Request
--
l_request_id :=
fnd_request.submit_request (application => 'XXAPPL',
program => 'XXITEMCATEGORY',
description => 'XX Item Category Report',
start_time => SYSDATE,
sub_request => FALSE,
argument1 => null --Parameter 1
,argument2 => null --Parameter 2
,argument3 => null --Parameter 3
);
COMMIT;
--
IF l_request_id = 0
THEN
DBMS_OUTPUT.put_line ('Concurrent Request Failed to Submit');
ELSE
DBMS_OUTPUT.put_line ('Successfully Submitted the Concurrent Request');
END IF;
--
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (
'Error While Submitting Concurrent Request '
|| TO_CHAR (SQLCODE)
|| '-'
|| SQLERRM);
END;
/
l_responsibility_id NUMBER;
l_application_id NUMBER;
l_user_id NUMBER;
l_request_id NUMBER;
BEGIN
--Get Responsibility ID and Application ID
SELECT DISTINCT fr.responsibility_id, frx.application_id
INTO l_responsibility_id, l_application_id
FROM apps.fnd_responsibility frx
,apps.fnd_responsibility_tl fr
WHERE fr.responsibility_id = frx.responsibility_id
AND UPPER (fr.responsibility_name) LIKE UPPER('XX Custom Reports');
--Get User ID
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name = 'XXUSER';
--
--To set environment context.
--
apps.fnd_global.apps_initialize (l_user_id,
l_responsibility_id,
l_application_id);
--
--Submitting Concurrent Request
--
l_request_id :=
fnd_request.submit_request (application => 'XXAPPL',
program => 'XXITEMCATEGORY',
description => 'XX Item Category Report',
start_time => SYSDATE,
sub_request => FALSE,
argument1 => null --Parameter 1
,argument2 => null --Parameter 2
,argument3 => null --Parameter 3
);
COMMIT;
--
IF l_request_id = 0
THEN
DBMS_OUTPUT.put_line ('Concurrent Request Failed to Submit');
ELSE
DBMS_OUTPUT.put_line ('Successfully Submitted the Concurrent Request');
END IF;
--
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (
'Error While Submitting Concurrent Request '
|| TO_CHAR (SQLCODE)
|| '-'
|| SQLERRM);
END;
/
No comments:
Post a Comment