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

Authority-Check

0 Likes
614

Hi all,

Can we give more than one value for an Authorization field in Auth-Check.

Ex: AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD <Value 1> <Value 2> <Value 3>.

IF SY-SUBRC <> 0.

MESSAGE E...

ENDIF.

If yes, please help me with exact syntax.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
581

HI,

u can't pass more than one value there.

so keep all the values u want to check in an internal table(itab)

and do like this.

LOOP AT itab.

AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD itab-var.

IF SY-SUBRC ne 0.

flag = 1.

exit.

ENDIF.

ENDLOOP.

if flag = 1.

MESSAGE E....

endif.

rgds,

bharat.

HI,

u can't pass more than one value there.

so keep all the values u want to check in an internal table(itab)

and do like this.

LOOP AT itab.

AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD itab-var.

IF SY-SUBRC ne 0.

flag = 1.

exit.

ENDIF.

ENDLOOP.

if flag = 1.

MESSAGE E....

endif.

rgds,

bharat.

3 REPLIES 3
Read only

VikasB
Active Participant
0 Likes
581

Hi,

Check with the following code

AUTHORITY-CHECK OBJECT 'Z_MM_PLANT'

ID 'ACTVT' FIELD '03'

ID 'WERKS' FIELD p_werks

ID 'TCD' FIELD l_transaction_code.

IF sy-subrc NE 0.

MESSAGE e000(oo) WITH 'No authorization for plant:'(004) p_werks.

ENDIF.

Regards,

Vikas.

plz reward if helpful..

Read only

Former Member
0 Likes
582

HI,

u can't pass more than one value there.

so keep all the values u want to check in an internal table(itab)

and do like this.

LOOP AT itab.

AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD itab-var.

IF SY-SUBRC ne 0.

flag = 1.

exit.

ENDIF.

ENDLOOP.

if flag = 1.

MESSAGE E....

endif.

rgds,

bharat.

Read only

0 Likes
581

Think there is some method to give more values for the same auth-field like

ID <field name>: <value 1>, <value 2>