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: 

AUTHORITY-CHECK OBJECT 'Z_EX_BUK' - How it works???

Former Member
0 Kudos

Hi Experts,

Just curious to know( I know, some thing!), that, How the following works? or Wht is the behaviuor of the following stetemnts?

LOOP AT it_bukrs.

AUTHORITY-CHECK OBJECT 'Z_EX_BUK'

ID 'BUKRS' FIELD it_bukrs-bukrs

ID 'ACTVT' FIELD '01'.

IF sy-subrc <> 0.

MESSAGE i052(sv).

EXIT.

ELSE.

CALL FUNCTION 'VIEW_AUTHORITY_CHECK'

.............. so on.......

pls. clarify.

thanq.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Srikar,

The Authority check checks if you have the authorization for the following company code depending upon the activity(01-may be create,02 may be change etc). It gives a message if the check fails..

I think that is a custom authority check for some specific purpose. Go to SU21 and search for 'Z_EX_BUK'. You will find the description and permitted activities for this Authority Object.

Thanks,

Vamshi.

2 REPLIES 2

Former Member
0 Kudos

Hi Srikar,

The Authority check checks if you have the authorization for the following company code depending upon the activity(01-may be create,02 may be change etc). It gives a message if the check fails..

I think that is a custom authority check for some specific purpose. Go to SU21 and search for 'Z_EX_BUK'. You will find the description and permitted activities for this Authority Object.

Thanks,

Vamshi.

0 Kudos

Authority-check: Authority Check is the statement used in an ABAP program to perform an authorization check against an authorization object. This statement will return sy-subrc is 4 if user has not authorized.

create authorization object in SU21

Authorization Object Which contains Authorization field. You can create authorization field in SU20 or while creating authorization object also you can create.

TYPES: BEGIN OF TY_SPFLI,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
CITYFROM TYPE SPFLI-CITYFROM,
CITYTO TYPE SPFLI-CITYTO,
END OF TY_SPFLI.

PARAMETERS: P_CARRID TYPE SPFLI-CARRID.
DATA: LT TYPE TABLE OF TY_SPFLI.

AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'ZSPF_CARRI'
ID 'ZCARRID' FIELD P_CARRID
ID 'ACTVT' FIELD '03'.

IF SY-SUBRC EQ 4.
MESSAGE 'GIVEN AIRLINE CODE IS NOT AUTHORIZED' TYPE 'E'.
ENDIF.

START-OF-SELECTION.
SELECT CARRID CONNID CITYFROM CITYTO FROM SPFLI INTO TABLE LT WHERE CARRID = P_CARRID.

LOOP AT LT INTO DATA(LS).
WRITE:/ LS-CARRID, LS-CONNID, LS-CITYFROM, LS-CITYTO.
ENDLOOP.