DECLARE
v_user_name VARCHAR2 (30) := UPPER ('&Enter_User_Name');
v_resp VARCHAR2 (30) := '&Enter_Responsibility';
v_resp_key VARCHAR2 (30);
v_app_short_name VARCHAR2 (50);
BEGIN
SELECT r.responsibility_key, a.application_short_name
INTO v_resp_key, v_app_short_name
FROM fnd_responsibility_vl r, fnd_application_vl a
WHERE r.application_id = a.application_id
AND UPPER (r.responsibility_name) = UPPER (v_resp);
FND_USER_PKG.ADDRESP (username => v_user_name,
resp_app => v_app_short_name,
resp_key => v_resp_key,
security_group => 'STANDARD',
description => NULL,
start_date => SYSDATE,
end_date => NULL);
COMMIT;
DBMS_OUTPUT.put_line( 'Responsibility:'
|| v_resp
|| ' '
|| 'is added to the User:'
|| v_user_name);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line( 'Unable to add the responsibility due to'
|| SQLCODE
|| ' '
|| SUBSTR (SQLERRM, 1, 100));
ROLLBACK;
END;
/
v_user_name VARCHAR2 (30) := UPPER ('&Enter_User_Name');
v_resp VARCHAR2 (30) := '&Enter_Responsibility';
v_resp_key VARCHAR2 (30);
v_app_short_name VARCHAR2 (50);
BEGIN
SELECT r.responsibility_key, a.application_short_name
INTO v_resp_key, v_app_short_name
FROM fnd_responsibility_vl r, fnd_application_vl a
WHERE r.application_id = a.application_id
AND UPPER (r.responsibility_name) = UPPER (v_resp);
FND_USER_PKG.ADDRESP (username => v_user_name,
resp_app => v_app_short_name,
resp_key => v_resp_key,
security_group => 'STANDARD',
description => NULL,
start_date => SYSDATE,
end_date => NULL);
COMMIT;
DBMS_OUTPUT.put_line( 'Responsibility:'
|| v_resp
|| ' '
|| 'is added to the User:'
|| v_user_name);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line( 'Unable to add the responsibility due to'
|| SQLCODE
|| ' '
|| SUBSTR (SQLERRM, 1, 100));
ROLLBACK;
END;
/
No comments:
Post a Comment