Monday, 24 September 2018

How to remove responsibility in oracle apps from backend

How to remove responsibility in oracle apps from backend


In this post , We will discuss about , how to remove responsibility in oracle apps from backend. To remove any responsibility from Oracle User account , We have standard API , Which helps to end date the particular responsibility from the User account. We need to pass the Responsibility name and the User account in this API ,to end date responsibility. API do end date responsibility in the sysdate. Here below is the complete code showing how to remove responsibility in oracle apps from backend.


Sample Scrip to remove responsibility in oracle apps from backend

 
DECLARE

 
 
CURSOR c1

IS

SELECT fu.user_name,

fa.application_short_name,

frt.responsibility_name,

fr.responsibility_key,

fsg.security_group_key

FROM fnd_user_resp_groups_all ful,

fnd_user fu,

fnd_responsibility_tl frt,

fnd_responsibility fr,

fnd_security_groups fsg,

 
 
fnd_application fa

 
WHERE fu.user_id = ful.user_id

AND frt.responsibility_id = ful.responsibility_id

AND fr.responsibility_id = frt.responsibility_id

AND fsg.security_group_id = ful.security_group_id

AND fa.application_id = ful.responsibility_application_id

AND frt.language = 'US'

AND fu.user_name IN (SELECT USER_NAME FROM apps.FND_USER_RESP_GROUPS_DIRECT A1,apps.FND_RESPONSIBILITY_VL A2,apps.FND_USER A3

WHERE A1.RESPONSIBILITY_ID=A2.RESPONSIBILITY_ID

AND RESPONSIBILITY_NAME LIKE '%XX PAYABLES%'

AND A1.USER_ID=A3.USER_ID

AND RESPONSIBILITY_NAME='XX PAYABLES'

AND A3.END_DATE IS NULL

AND A2.END_DATE IS NULL

AND A1.END_DATE IS NULL)

AND RESPONSIBILITY_NAME='XX PAYABLES';
 
 
BEGIN

 

 
FOR i IN c1

LOOP

BEGIN

fnd_user_pkg.delresp (username => i.user_name,

resp_app => i.application_short_name,

resp_key => i.responsibility_key,

security_group => i.security_group_key);

COMMIT;

DBMS_OUTPUT.

put_line (

i.responsibility_name || ' has been End Dated Successfully !!!');

EXCEPTION

WHEN OTHERS

THEN

DBMS_OUTPUT.

put_line (

'Inner Exception: '

|| ' - '

|| i.responsibility_key

|| ' - '

|| SQLERRM);

END;

END LOOP;
 

EXCEPTION

 

 
WHEN OTHERS

THEN

DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);
 

END;



0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *