Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete roles from a certain system : BAPI_USER_LOCACTGROUPS_ASSIGN

Former Member
0 Kudos

Hi All,

    I have written a code which determines which users' roles should be deleted from which systems. The code is using BAPI_USER_LOCACTGROUPS_ASSIGN to delete the roles. Now here is what happens in the code:

1. Prepare a list of user's roles ( Lets say user has 5 roles in each of the 10 systems, table has 50 entries in it).

2. Delete the entries corresponding to SYSTEM1 and SYSTEM7. ( The table is left with 40 entries in it). I am deleted ALL the roles so after this there is no entry for SYSTEM1 and SYSTEM7 in the table.

3. Run the BAPI by passing table (with 40 entries).

Once BAPI runs the system send out 10 idocs (one for each system). And idocs for  SYSTEM1 and SYSTEM7 still have the roles in it. So essentially the BAPI just ignored my filtering and sent out idocs with situation as is.

I did try to change the idoc by removing all the roles segment and that does the job for me. But I am not sure why BAPI is not doing it. I can not use BAPI_USER_LOCACTGROUPS_DELETE as I want to delete roles only from certain systems.

Any idea whats up here?

Thanks,

Anuj

1 REPLY 1

Former Member
0 Kudos

I figured it out. For others who may be looking to do the same -->> If you want to remove all the roles from system A , you need to pass a row with just system id in it ( no role name/dates) and delete all the other rows for that system. That will delete all the roles for that system while keeping the system in system list.