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: 

Authorization - all Z reports

Former Member
0 Kudos

Hi,

What is the best way to set-up authtorizations for z reports?

We have different keys like company code,material,plant etc..

Can we use any standard objects to do this? Or do we need to develop a custom for each report depending on Key's used?

regards

Praveen

Message was edited by:

PRAVEEN s

1 REPLY 1

ferry_lianto
Active Contributor
0 Kudos

Hi,

You need to create an authorization object from Transaction SU21.

Ther you can give the authorirization fields.

Now in your report just call that authority object:

Let's say if you had created an auhorizatin object as V_VBAK_VBO then you can code something like this in your custom report.

*Check the authority of the user

authority-check object 'V_VBAK_VKO'

id 'VKORG' field it_salesorg-vkorg

id 'VTWEG' dummy "FIELD '*'

id 'SPART' dummy "FIELD '*'

id 'ACTVT' dummy.

*If the user is not authorised

if sy-subrc <> 0.

    • Give the error message.

endif.

For more information, please check this link.

http://help.sap.com/saphelp_bw21c/helpdata/en/52/6712ac439b11d1896f0000e8322d00/frameset.htm

Regards,

Ferry Lianto