0% found this document useful (0 votes)
25 views1 page

Adding Responsibility FromApps-NEW

This document declares variables and uses a cursor to select responsibility data from tables. It then loops through the cursor, calling a package to add the responsibilities to a user. Any exceptions are caught and output.

Uploaded by

madamanachisri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

Adding Responsibility FromApps-NEW

This document declares variables and uses a cursor to select responsibility data from tables. It then loops through the cursor, calling a package to add the responsibilities to a user. Any exceptions are caught and output.

Uploaded by

madamanachisri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

declare

v_username fnd_user.user_name%type;
v_resp_key fnd_responsibility.responsibility_key%type;
v_apps_short_name fnd_application.application_short_name%type;
v_resp_name fnd_responsibility_tl.responsibility_name%type;

cursor resp_info
is
select fr.responsibility_key, fa.application_short_name
from applsys.fnd_responsibility_tl frt,
applsys.fnd_responsibility fr,
applsys.fnd_application_tl fat,
applsys.fnd_application fa
where fr.responsibility_id = frt.responsibility_id
and fa.application_id = fat.application_id
and fr.application_id = fat.application_id
and frt.language = userenv ('LANG')
and fat.language = userenv ('LANG')
and frt.responsibility_name in (
'System Administrator');
begin
v_username := <USER NAME>;

for resp_data in resp_info


loop
begin
fnd_user_pkg.addresp (username => v_username,
resp_app =>
resp_data.application_short_name,
resp_key => resp_data.responsibility_key,
security_group => 'STANDARD',
description => null,
start_date => sysdate,
end_date => null);

commit;

dbms_output.put_line (
v_resp_name
|| ' responsibility added successfully for '
|| v_username);
end;
end loop;
exception
when others
then
dbms_output.put_line (
v_resp_name || ' responsibility not added for ' || v_username);
dbms_output.put_line ('SQLERRM: ' || substr (sqlerrm, 1, 100));
rollback;
end;

You might also like