DECLARE
l_request_id NUMBER;
l_error_msg VARCHAR2(2000);
BEGIN
SELECT fnd.user_id, fresp.responsibility_id, fresp.application_id
INTO l_user_id, l_responsibility_id, l_appl_id
FROM fnd_user fnd, fnd_responsibility_tl fresp
WHERE fnd.user_name = 'XXXXX'
AND fresp.responsibility_name = 'XXXXXX'
AND fresp.LANGUAGE = 'E';
fnd_global.apps_initialize (l_user_id, l_responsibility_id, l_appl_id);
--apps.fnd_global.apps_initialize(39252,50333,1);
apps.mo_global.set_policy_context ('S', 83);
DBMS_OUTPUT.PUT_LINE('USER ID:'||fnd_profile.VALUE('USER_ID'));
DBMS_OUTPUT.PUT_LINE('RESP ID:'||fnd_profile.VALUE('RESP_ID'));
DBMS_OUTPUT.PUT_LINE('RESP APP ID:'||fnd_profile.VALUE('RESP_APPL_ID'));
DBMS_OUTPUT.PUT_LINE('ORG ID:'||fnd_profile.VALUE('ORG_ID'));
l_request_id := apps.fnd_request.submit_request
('XXX'
,'XXXXXXXXXXXXXX'
, ''
, SYSDATE
, FALSE);
COMMIT;
if l_request_id =0 then
l_error_msg := '';
FND_MESSAGE.RETRIEVE(l_error_msg);
DBMS_OUTPUT.PUT_LINE(l_error_msg);
DBMS_OUTPUT.PUT_LINE(SUBSTR(SQLERRM,0,240));
--FND_MESSAGE.ERROR;
end if;
DBMS_OUTPUT.PUT_LINE('Request ID:'||l_request_id);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SUBSTR(SQLERRM,0,240));
END;
No comments:
Post a Comment