cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Add/ Remove a User Role

lrayapat73
Participant
0 Kudos

Hi Team,

I have come across following BAPIs to add or remove a role.

BAPI_USER_LOCACTGROUPS_ASSIGN - This is removing all existing roles and adding the new role. Is there any alternative BAPI to add a specific role, without removing current roles ?

Does the timestamp for the existing roles will change each time we add a new role ?

BAPI_USER_LOCACTGROUPS_DELETE - This is removing all the roles, is there any alternative BAPI to remove any specific role ?

Thanks in advance!!!

BR,

Kumar

Accepted Solutions (1)

Accepted Solutions (1)

jmodaal
Active Contributor

Hello,

BAPI_USER_LOCACTGROUPS_ASSIGN is the one for CUA's. Don't have experience with it, but I guess it is nearly the same as for non CUA's (BAPI_USER_ACTGROUPS_ASSIGN).
If so, then use function module BAPI_USER_LOCACTGROUPS_READ to read the already assigned roles. Use the received ACTIVITYGROUPS table to fill the one in the ...ASSIGN function module.

For adding a role just add an entry in table ACTIVITYGROUPS.

For removing a role just delete the entry for the role.

lrayapat73
Participant
0 Kudos

Thanks Jan

Answers (1)

Answers (1)

vinita_kasliwal
Active Contributor
0 Kudos

Hi Kumar

Did you try this one and then use BAPI_TRANSACTION_COMMIT after that

BAPI_USER_ACTGROUPS_ASSIGN
BAPI_USER_ACTGROUPS_DELETE

Refer this documentation which is quite helpful 

https://archive.sap.com/kmuuid2/668e6629-0701-0010-7ca0-994cb7dec5a3/SAP%20Identity%20Management%20A...


Regards
Vinita
lrayapat73
Participant
0 Kudos

Thanks Vinita

vinita_kasliwal
Active Contributor
0 Kudos

Could you mark the answer as accepted if it answers your question?