Application Development 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: 

authorization check

Former Member
0 Kudos
146

hello frns,

below is the code for authorizations,

the requirement is that ,

the authorization should be yes only

if all the bukrs are authorized for the user,

but now it is giving authorization even if one bukrs is valid.

AUTHORITY-CHECK OBJECT 'M_MATE_BUK'

ID 'ACTVT' DUMMY

ID 'BUKRS' FIELD P_FS.

IF SY-SUBRC = 0.

ZZ_EXIT = 'Y'.

ENDIF.

3 REPLIES 3

former_member194669
Active Contributor
0 Kudos
65

Hi,


v_auth = 'Y'.

Loop at i_t001w.
AUTHORITY-CHECK OBJECT 'M_MATE_BUK'
ID 'ACTVT' DUMMY
ID 'BUKRS' FIELD i_t001w-werks.

IF SY-SUBRC ne 0.
  v_auth = 'N'.
ENDIF. 
endloop.

After this loop if v_auth eq 'Y' that means user have authorisation

aRs

Former Member
0 Kudos
65

Hi,

In this case the authority check statement will check if user profile of user ( the user who logged in R/3) have object 'M_MATE_BUK' with field value BUKRS = P_FS. If this true then only this authorization will be passed otherwise not.

So just debug the code and see wht is the value for P_FS and check in SU01 if that user id has object 'M_MATE_BUK' with field value BUKRS = P_FS. If not then you need to ask security guy to add that particular value and object in user profile

Thanks,

Harkamal

Former Member