Hi, currently my company create a program to upload roles in txt file to insert and delete roles of a user, however, I am facing a problem which is the program unable to add new roles for the new user in sap ABAP. This is because the new user without any role will not available in the standard table agr_users, any recommended ways to insert roles to the new users using any function module or bapi? Thank you.
Why reinvent the wheel? Use SU10
transaction aka User Maintenance: Mass Changes
Step 1: select user(s) you wanna process
you can select by different criteria, the criteria are highlighted in yellow on the screen
Step 2: press Edit button
Step 3: go to Roles tab and add the required roles to the table selecting the action (add or delete)
Bingo!