DECLARE
l_user_name VARCHAR2(240) := 'SYSADMIN';
l_resp_name VARCHAR2(240) := 'System Administrator';
l_user_id NUMBER;
l_resp_id NUMBER;
l_resp_appl_id NUMBER;
l_request_id NUMBER;
BEGIN
-- Apps Initialization
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name =l_user_name;
SELECT b.RESPONSIBILITY_ID,b.APPLICATION_ID
INTO l_resp_id,l_resp_appl_id
FROM fnd_responsibility_tl tl, fnd_responsibility b
WHERE tl.responsibility_name = l_resp_name
AND LANGUAGE=UserEnv('LANG')
AND tl.RESPONSIBILITY_ID=b.RESPONSIBILITY_ID;
fnd_global.apps_initialize
( user_id => l_user_id
,resp_id => l_resp_id
,resp_appl_id => l_resp_appl_id
);
--
l_request_id := FND_request.submit_request(application => 'FND', -- Application Object Library
program => 'FNDWFBG', -- Workflow Background Process
description => NULL,
start_time => NULL,
sub_request => FALSE,
argument1 => null, -- Item Type
argument2 => null, -- Minimum Threshold
argument3 => NULL, --Maximum Threshold
argument4 => 'Y' , --Process Deferred
argument5 => 'N', -- Process Timeout
argument6 => NULL -- Process Stuck
);
IF l_request_id> 0 THEN
Dbms_Output.put_line(l_request_id);
commit;
END IF;
END;
Very Useful! Thanks!
ReplyDelete