DECLARE
lc_user_name VARCHAR2(100) := 'ABDUL.JEELANI';
lc_resp_appl_short_name VARCHAR2(100);
lc_responsibility_key VARCHAR2(100);
lc_security_group_key VARCHAR2(100);
ld_resp_start_date DATE := SYSDATE;
ld_resp_end_date DATE := NULL;
BEGIN
SELECT fa.application_short_name,
fr.responsibility_key,
frg.security_group_key
INTO lc_resp_appl_short_name,
lc_responsibility_key,
lc_security_group_key
FROM fnd_responsibility fr,
fnd_application fa,
fnd_security_groups frg,
fnd_responsibility_tl frt
WHERE fr.application_id = fa.application_id
AND fr.data_group_id = frg.security_group_id
AND fr.responsibility_id = frt.responsibility_id
AND frt.LANGUAGE = USERENV ('LANG')
AND frt.responsibility_name = 'System Administrator';
fnd_user_pkg.addresp
( username => lc_user_name,
resp_app => lc_resp_appl_short_name,
resp_key => lc_responsibility_key,
security_group => lc_security_group_key,
description => NULL,
start_date => ld_resp_start_date,
end_date => ld_resp_end_date
);
/*fnd_user_pkg.delresp (username => lc_user_name,
resp_app => lc_resp_appl_short_name,
resp_key => lc_responsibility_key,
security_group => lc_security_group_key
);*/
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;

0 Comments