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

Authorizations!!

Former Member
0 Likes
568

Hello All,

How can I check ::

1.Check if the user is authorized to call transaction code say : VF03

2.Check if the user is authorized to access documents created for the given sales organization and division.

Cheers,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
529

1.

call function 'AUTHORITY_CHECK_TCODE'

exporting

tcode = 'YSCC'

exceptions

ok = 0

not_ok = 2.

if sy-subrc eq 2.

message e077(s#) with 'YSCC'. " No authorization to transaction

else.

call transaction 'YSCC'.

endif.

2.check SU22, here u will find out list iof objects per tcode.

Regards

Prabhu

3 REPLIES 3
Read only

Former Member
0 Likes
530

1.

call function 'AUTHORITY_CHECK_TCODE'

exporting

tcode = 'YSCC'

exceptions

ok = 0

not_ok = 2.

if sy-subrc eq 2.

message e077(s#) with 'YSCC'. " No authorization to transaction

else.

call transaction 'YSCC'.

endif.

2.check SU22, here u will find out list iof objects per tcode.

Regards

Prabhu

Read only

Former Member
0 Likes
529

Hi

AUTHORITY-CHECK 'S_TCODE'

ID TCD FIELD 'V F03'.

IF SY-SUBRC <> 0.

-


> NO AUTH.

ENDIF.

AUTHORITY-CHECK 'V_VBRK_VKO'

ID VKORG FIELD <VKORG>

ID ACTVT FIELD '03'.

IF SY-SUBRC <> 0.

-


> NO AUTH.

ENDIF.

Max

Read only

Former Member
0 Likes
529

Hi sachin,

1. Fm = AUTHORITY_CHECK_TCODE

(it will run for the current user)

regards,

amit m.