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 for tcode

Former Member
0 Likes
19,295

Hi,

How to add an authority check for tcode in dialog progragging

5 REPLIES 5
Read only

Former Member
0 Likes
7,663

Hi,

authority-check object 'Z_CODE'

id 'BUKRS' field <fs_bukrs>

id 'WERKS' field <fs_werks>

id 'EKORG' field <fs_ekorg>

id 'EKGRP' field <fs_ekgrp>.

return = sy-subrc.

Check these links:

http://www.richardsantos.net/2009/03/16/sap-how-to-create-and-use-the-authorization-objects-in-abap/

Thanks.

Read only

sivasatyaprasad_yerra
Product and Topic Expert
Product and Topic Expert
0 Likes
7,663

Use AUTHORITY-CHECK OBJECT syntax

Read only

Former Member
0 Likes
7,663

Hi,

go through the fallowing link,

Regards,

Vijay

Read only

Former Member
0 Likes
7,663

hi

try this

call function 'AUTHORITY_CHECK_TCODE'

exporting

tcode = 'ST22'

exceptions

ok = 0

not_ok = 2

others = 3.

if sy-subrc <> 0.

message e172(00) with 'ST22'.

endif.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
7,663

Hello,

You can use the auth object S_TCODE.

AUTHORITY-CHECK OBJECT S_TCODE
  ID TCD FIELD <your t-code>.  "Authorization group ABAP/4 program
  IF SY-SUBRC NE 0.
  " Your Error Message
  ENDIF. "SY-SUBRC NE 0.

BR,

Suhas