Assign responsibility to user in oracle apps from backend | Being Oracle Database administrator, we are using various API scripts to do the administrative task in Oracle Database.Before executing script we should test it on test/dev instance, then migrate the solution to production carefully. Here we are discussing 'how to add responsibility in oracle apps from backend' using API.
Copy below api script to add responsibility to FND User .
---------API Script to add responsibility to user in oracle apps
----------------------------------------------------------------
DECLARE
v_user_name VARCHAR2 (30) := '&user_name';
v_responsibility_name VARCHAR2 (100) := '&Enter_responsibility_name';
v_application_name VARCHAR2 (100) := NULL;
v_responsibility_key VARCHAR2 (100) := NULL;
v_security_group VARCHAR2 (100) := NULL;
v_description VARCHAR2 (100) := NULL;
BEGIN
SELECT fa.application_short_name, fr.responsibility_key,
fsg.security_group_key, frt.description
INTO v_application_name, v_responsibility_key,
v_security_group, v_description
FROM apps.fnd_responsibility fr,
fnd_application fa,
fnd_security_groups fsg,
fnd_responsibility_tl frt
WHERE frt.responsibility_name = v_responsibility_name
AND frt.LANGUAGE = USERENV ('LANG')
AND frt.responsibility_id = fr.responsibility_id
AND fr.application_id = fa.application_id
AND fr.data_group_id = fsg.security_group_id;
fnd_user_pkg.addresp (username => v_user_name,
resp_app => v_application_name,
resp_key => v_responsibility_key,
security_group => v_security_group,
description => v_description,
start_date => SYSDATE,
end_date => NULL
);
COMMIT;
DBMS_OUTPUT.put_line( 'Responsiblity '
|| v_responsibility_name
|| ' is attached to the user '
|| v_user_name
|| ' Successfully'
);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line
( 'Unable to attach responsibility to user due to'
|| SQLCODE
|| ' '
|| SUBSTR (SQLERRM, 1, 100)
);
END;
/
SHOW ERR;
It's your turn!
What do you think? Share your experience in the comments box below.⤋
|
No comments:
Post a Comment
Thanks for reading till end. I hope this will help you more to improve your knowledge.
Now it's your turn!
What do you think? Share your experience in the comments box and subscribe for more interesting post.