Sunday 7 December 2014

Fnd_cant_insert_user_role when assigning a responsibility in R12

A second attempt to assign the same responsibility produces the error


Oracle Error -20001: ORA-20001: FND_CANT_INSERT_USER_ROLE has been detected in 
FND_USER_RESP_GROUPS_API.INSERT_ASSIGNMENT







Solution:-

-create Application user and give the permission to user from SYSADMIN like “Function Administrator”/”Fuctional Developer” 


SOME TIME POINT 1 Doesn't Work and showing differ type error like:

Oracle Error -20001: ORA-20001: FND_CANT_INSERT_USER_ROLE has been detected in 
FND_USER_RESP_GROUPS_API.INSERT_ASSIGNMENT

Then Follow 2nd Point.

1. Add a responsibility to a user using API fnd_user_resp_groups_api.Insert_Assignment
To add a responsibility to a user using and API, use the following API fnd_user_resp_groups_api.Insert_Assignment:

Example.

begin
fnd_user_resp_groups_api.Insert_Assignment (user_id =>0 ,
responsibility_id => '24077',
responsibility_application_id =>'0' ,
start_date => '07-DEC-2014',
end_date => '07-DEC-2222',
description =>'Sample example' );
commit;
end;

This shall raise an error if the responsibility is assigned to a user,
but if needed to update the responsibility assignment in case of responsibility existence,
use the following API:

begin
fnd_user_pkg.addresp(
'&User_Name',
'&Responsablity_Application_Short_Name',
'&Responsibility_Key',
'&Security_Group',
'&Description',
'&Start_Date',
'&End_Date' );
commit;
end;

Begin
wf_local_synch.PropagateUserRole(
p_user_name => 'SYSADMIN',
p_role_name => 'FND_RESP|FND|FND_FUNC_ADMIN|STANDARD');
commit;
end;



-------------------------------------------------

2nd Point

****** Find responsiblity_id for a particular responsibility:
select APPLICATION_ID,RESPONSIBILITY_ID ,LANGUAGE,RESPONSIBILITY_NAME
from apps.FND_RESPONSIBILITY_TL
where UPPER(responsibility_name) like '%FUNCTION%'



*** Find users with particular role:
SELECT * FROM APPS.WF_USER_ROLE_ASSIGNMENTS WHERE role_NAME ='UMX|9001A'     

ELSE

select USER_NAME,ROLE_NAME,ROLE_ORIG_SYSTEM_ID
 from APPS.WF_USER_ROLE_ASSIGNMENTS
where user_name='VINAY'
and ROLE_ORIG_SYSTEM_ID=24076;


***** Find all or specific roles inside the R12
 SELECT * FROM APPS.wf_local_roles where NAME ='FND_RESP0:24077'
 SELECT * FROM APPS.wf_local_roles where NAME ='FND_RESP|FND|FND_FUNC_ADMIN|STANDARD'



-- Assign role to a user using an API --
To assign role to a user using APIs, use the following API wf_local_synch.PropagateUserRole.

Example:

Begin
wf_local_synch.PropagateUserRole(
p_user_name => 'SYSADMIN',
p_role_name => 'FND_RESP0:24076');
commit;
end;
/

Begin
wf_local_synch.PropagateUserRole(
p_user_name => 'SYSADMIN',
p_role_name => 'FND_RESP|FND|FND_FUNC_DEV|STANDARD');
commit;
end;
/



-----After That Re-login EBS with SYSADMIN and check the on your left side responsibility exist






GO > SYSTEM ADMINISTRATOR > Security User > Define > Find "SYSADMI" > Update responsibility Start_Date > Save.




Yipeeee....!!!!

No comments: