2008 Jul 02 8:58 AM
HI,
in su01 we have user dummy that have lot of duplicates profiles,
how cam i build program or process that can delete his duplicates profiles?
i reward
Regards
2008 Jul 02 9:28 AM
Hi
Are you talking about "Profiles" or "Roles" in SU01 ?
Because if the issue is duplicate Roles, that you can resolve the issue as following
1: In your abap program, read from table AGR_USERS against a given user name. This will return all roles assigned to a user.
2: select the roles you want to unassign from the user. Lets say you put these in internat table itab.
3: use function PRGN_DELETE_USER_ASSIGNMENT to unassign these roles from user master as following
loop at itab.
call function 'PRGN_DELETE_USER_ASSIGNMENT'
exporting
user_name = itab-userid
activity_group = itab-role
from_date = itab-from
to_date = itab-tod
exceptions
actgroup_not_authorized = 1
actgroup_not_existing = 2
actgroup_enqueued = 3
others = 4.
if sy-subrc ne 0.
give your error message
endif.
endloop.
hope this helps.
Edited by: Rashid Javed on Jul 2, 2008 11:33 AM
Hi
Are you talking about "Profiles" or "Roles" in SU01 ?
Because if the issue is duplicate Roles, that you can resolve the issue as following
1: In your abap program, read from table AGR_USERS against a given user name. This will return all roles assigned to a user.
2: select the roles you want to unassign from the user. Lets say you put these in internat table itab.
3: use function PRGN_DELETE_USER_ASSIGNMENT to unassign these roles from user master as following
loop at itab.
call function 'PRGN_DELETE_USER_ASSIGNMENT'
exporting
user_name = itab-userid
activity_group = itab-role
from_date = itab-from
to_date = itab-tod
exceptions
actgroup_not_authorized = 1
actgroup_not_existing = 2
actgroup_enqueued = 3
others = 4.
if sy-subrc ne 0.
give your error message
endif.
endloop.
hope this helps.
Edited by: Rashid Javed on Jul 2, 2008 11:33 AM
2008 Jul 02 9:16 AM
2008 Jul 02 9:28 AM
Hi
Are you talking about "Profiles" or "Roles" in SU01 ?
Because if the issue is duplicate Roles, that you can resolve the issue as following
1: In your abap program, read from table AGR_USERS against a given user name. This will return all roles assigned to a user.
2: select the roles you want to unassign from the user. Lets say you put these in internat table itab.
3: use function PRGN_DELETE_USER_ASSIGNMENT to unassign these roles from user master as following
loop at itab.
call function 'PRGN_DELETE_USER_ASSIGNMENT'
exporting
user_name = itab-userid
activity_group = itab-role
from_date = itab-from
to_date = itab-tod
exceptions
actgroup_not_authorized = 1
actgroup_not_existing = 2
actgroup_enqueued = 3
others = 4.
if sy-subrc ne 0.
give your error message
endif.
endloop.
hope this helps.
Edited by: Rashid Javed on Jul 2, 2008 11:33 AM
2008 Jul 02 10:14 AM
Hi,
thanks but I don't wont to delete duplicates rols ,
i wont to delete duplicates profiles.
Regards
2008 Jul 02 10:14 AM
Hi,
thanks but I don't wont to delete duplicates rols ,
i wont to delete duplicates profiles.
Regards
2008 Jul 02 11:03 AM
Hmm
Well haven't personally worked on such problem but may be the following can help.
User - profile relationship is in table UST04.
profile - role relationship is in table AGR_1016B
Chedck the folloiwng FMs. May be helpful
PRGN_AUTH_PROFILES_ASSIGN
PRGN_AUTH_PROFILES_DELETE
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |