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

Authorization Object

Former Member
0 Likes
350

In V/LD transaction I have a requirement to allow users to view certain sales districts.

I have created an authorization object and linked it to the user profile and

assigned the sales district values the user is allowed in the profile.

Now how will I know what sales districts are linked to the user profile.

When I call authorization object from my program. How will I validate

against the values assigned to the user profile?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
284

check this sample logic for Plant validations .

Here S_werks if selection params.

<b> select werks

into table i_auth_werks

from t001w

where werks in s_werks.

loop at i_auth_werks.

authority-check object 'Z_PLNT_AUT'

id 'ACTVT' field '03'

id 'WERKS' field i_auth_werks-werks.

if sy-subrc ne 0 .

message e398(00) with

'User' sy-uname 'not authorised for Plant : ' i_auth_werks-werks.

endif.

endloop.</b>

1 REPLY 1
Read only

Former Member
0 Likes
285

check this sample logic for Plant validations .

Here S_werks if selection params.

<b> select werks

into table i_auth_werks

from t001w

where werks in s_werks.

loop at i_auth_werks.

authority-check object 'Z_PLNT_AUT'

id 'ACTVT' field '03'

id 'WERKS' field i_auth_werks-werks.

if sy-subrc ne 0 .

message e398(00) with

'User' sy-uname 'not authorised for Plant : ' i_auth_werks-werks.

endif.

endloop.</b>