‎2006 Nov 02 2:52 PM
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?
‎2006 Nov 03 4:31 AM
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>
‎2006 Nov 03 4:31 AM
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>