In SAP User Management we can’t just add, delete or edit theroles which are assigned to the particular user.

We are assigning the roles to the user while creating thenew user using BAPI ‘BAPI_USER_LOCACTGROUPS_ASSIGN’ .

SAP doesn’t have any BAPI or RFC for changing the user’sroles separately.

Solution:

If you want to add the additional roles to the user, thenfirst read the users previous assigned roles from the system & add thisadditional new roles to the previous roles list and call the BAPI ‘BAPI_USER_LOCACTGROUPS_ASSIGN’and pass the previous roles list which is having new roles also.

Same way if you want to delete some roles of the user, thenremove the particular roles from the user’s previous roles list and call theBAPI ‘BAPI_USER_LOCACTGROUPS_ASSIGN’ and pass new roles list.