‎2015 Oct 01 1:55 PM
Hi
I'm looking for a functional module that will remove a user from a Role.
I've seen that I can add a user by using PRGN_RFC_ADD_USERS, but not sure how to remove a user.
Thanks
‎2015 Oct 01 3:53 PM
‎2015 Oct 01 2:05 PM
‎2015 Oct 01 2:59 PM
Thanks. It seems like BAPI_USER_ACTGROUPS_DELETE can work, but will delete ALL activity group assignments. I'm only looking to remove a specified Role. I.e. role should be passed in a parameter.
But thanks for the answer. Not wrong - just not suited for me.
‎2015 Oct 01 3:04 PM
It seems you're right. In fact , the FM BAPI_USER_ACTGROUPS_ASSIGN, assigns roles deleting all of them before !... So you just need to retrive the roles before and then adjust for whatever you want.
I don't know why these functions have these behavior ...
Regards...
‎2015 Oct 01 2:06 PM
‎2015 Oct 02 10:35 AM
Thanks - this really seems like the correct function, but I call this function and pass in table "DELETE_USERS_FROM_ACTGROUPS", with values AGR_NAME and UNAME.
When executing the function it does not remove that role from the user.
Am I missing something?
Should i run anything afterwards to commit the change?
‎2015 Oct 01 3:16 PM
Hi Andre,
Please try to search with BAPI_BUPA_ROLE* probably BAPI_BUPA_ROLE_REMOVE function module will work for you.
AGR_USERS is table name which stores all roles assigned to User.
Thanks-
Abhishek
‎2015 Oct 01 3:53 PM
‎2015 Oct 01 3:58 PM
Thanks - will give it a try. Do I still have to run PFUD User Comparison after this, or is this then not necessary?
Andre
‎2015 Oct 05 7:01 AM
‎2015 Oct 05 7:29 AM
Hi,
in addition to Raymond's solution, if you have an active Central User Management, then you will need the rfc fm's BAPI_USER_LOCACTGROUPS_READ and BAPI_USER_LOCACTGROUPS_ASSIGN here.
Regards,
Klaus
‎2015 Oct 06 11:09 AM
Thanks. BAPI_USER_ACTGROUPS_ASSIGN does the job with a workaround. However neither BAPI_USER_PROFILES_ASSIGN nor BAPI_TRANSACTION_COMMIT does not run the User Comparison (with my current checks). Will still play around, but at least I can now remove the Role. Thanks.