2007 Jul 03 1:14 PM
Hi All,
In my program, I need to check authorizations for a set of users entered on the selection screen.
If I use authority-check statement, it will check for the current user( sy-uname) but not for the users entered on the selection screen. Please let me know if we can achieve this functionality and If yes how.
Thanks & Regards,
Goutham.
2007 Jul 03 2:36 PM
Hi,
I am not sure, but I hope it will work!!!
As many times as the no. of users entered on your selection screen, run AUTHORITY-CHECK statement with value of SY-UNAME with new user every time.
regards,
kiran
2007 Jul 03 2:36 PM
Hi,
I am not sure, but I hope it will work!!!
As many times as the no. of users entered on your selection screen, run AUTHORITY-CHECK statement with value of SY-UNAME with new user every time.
regards,
kiran
2007 Jul 03 2:46 PM
Hi,
AUTHORITY-CHECK OBJECT auth_obj [FOR USER user]
ID id1 {FIELD val1}|DUMMY
[ID id2 {FIELD val2}|DUMMY]
...
[ID id10 {FIELD val10}|DUMMY].
This statement checks whether authorization is entered in the user master record of the current user or the user specified in user for the authorization object entered in the field auth_obj, and whether this authorization is sufficient for the request specified in the statement. A flat character-type field that contains the name of an authorization object is expected for auth_obj. Without the addition FOR USER, the authorization of the current user is checked.
sy-subrc Meaning
0 - Authorization successful or no check was carried out. An authorization for the authorization object was found in the user master record. It's value sets include the specified values.
4 - Authorization check not successful. One or several authorizations were indeed found for the authorization object in the user master record and they include the value sets, but not the values specified, or incorrect or too many authorization fields were specified.
12 - No authorization was found for the authorization object in the user master record.
24 - This return value is no longer set.
40 - An invalid user ID has been entered in user.
Regards,
Vinodh
2007 Jul 03 2:52 PM
in AT SELECTION-SCREEN ,
loop at s_users and then check the authority check for each user
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |