Application Development and Automation 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: 
Read only

A bit URGENT: Authorization-check in a program.

Former Member
0 Likes
566

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
538

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

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.

3 REPLIES 3
Read only

Former Member
0 Likes
539

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

Read only

Former Member
0 Likes
538

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

Read only

Former Member
0 Likes
538

in AT SELECTION-SCREEN ,

loop at s_users and then check the authority check for each user