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

Code for user authorization

Former Member
0 Likes
502

Hello All,

I have to implement a sample code which will filter out activities according to user authorization. Please help me in this regard.

Thanks in advance.

Paul.

4 REPLIES 4
Read only

Former Member
0 Likes
482

hello,

check this

AUTHORITY-CHECK OBJECT object "where object needs to be first created in SU21

ID name1 FIELD f1

ID name2 FIELD DUMMY "pass DUMMY if u dont want to use dat field for check

u2026

ID name10 FIELD f10.

Thank u,

santhosh

Read only

Former Member
0 Likes
482

Hi:

have a look

[Link|http://help.sap.com/saphelp_bw21c/helpdata/en/52/6712ac439b11d1896f0000e8322d00/content.htm]

Regards

Shashi

Read only

Former Member
0 Likes
482

Hi,See the below code and write as per your need.

INITIALIZATION.

AUTHORITY-CHECK OBJECT 'ZPRCHK_NEW'

ID 'TCD' FIELD SY-TCODE

ID 'BUKRS' DUMMY

ID 'PRCTR' DUMMY

ID 'SPART' DUMMY

ID 'WERKS' DUMMY

ID 'VKORG' DUMMY

ID 'EKORG' DUMMY.

IF SY-SUBRC NE 0.

MESSAGE I000(VZ) WITH TEXT-002 SY-TCODE .

LEAVE PROGRAM.

ENDIF.

Regards

rajendra

Read only

Former Member
0 Likes
482

ok