DECLARE
v_user_name VARCHAR2(100) := 'SSHARMA';
v_responsibility_name VARCHAR2(100) := 'OM Super User';
v_application_name VARCHAR2(100) := NULL;
v_responsibility_key VARCHAR2(100) := NULL;
v_security_group VARCHAR2(100) := NULL;
BEGIN
SELECT
fa.application_short_name,
fr.responsibility_key,
frg.security_group_key
INTO
v_application_name,
v_responsibility_key,
v_security_group
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 = v_responsibility_name;
fnd_user_pkg.delresp(
username => v_user_name,
resp_app => v_application_name,
resp_key => v_responsibility_key,
security_group => v_security_group
);
COMMIT;
dbms_output.put_line('Responsibility '
|| v_responsibility_name
|| ' end dated for the user '
|| v_user_name
|| ' Successfully');
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error encountered while end dated responsibility from the user:' || sqlerrm);
END;
/
v_user_name VARCHAR2(100) := 'SSHARMA';
v_responsibility_name VARCHAR2(100) := 'OM Super User';
v_application_name VARCHAR2(100) := NULL;
v_responsibility_key VARCHAR2(100) := NULL;
v_security_group VARCHAR2(100) := NULL;
BEGIN
SELECT
fa.application_short_name,
fr.responsibility_key,
frg.security_group_key
INTO
v_application_name,
v_responsibility_key,
v_security_group
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 = v_responsibility_name;
fnd_user_pkg.delresp(
username => v_user_name,
resp_app => v_application_name,
resp_key => v_responsibility_key,
security_group => v_security_group
);
COMMIT;
dbms_output.put_line('Responsibility '
|| v_responsibility_name
|| ' end dated for the user '
|| v_user_name
|| ' Successfully');
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error encountered while end dated responsibility from the user:' || sqlerrm);
END;
/
No comments:
Post a Comment