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: 

Do I need a custom authorization object for this?

Former Member
0 Kudos

Hi,

I want to implement a report. This report has 2 radio buttons on the selection screen. I want to program the report so that only certain group of users can run the report with first radion button selection and another group of user can run with second radion button selection.

I dont want to create 2 transaction code. My question is do I need to create a custom authorization object. If so can you guide how?

Thanks for reading

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos

You can create your own Custom Authorisation Object from transaction SU20.

After creating the Authorisation Object, use the code like this..


authority-check object 'ZBUKRS'
                    id 'BUKRS'
                 field ZES_MAIL-BUKRS.
  if SY-SUBRC ne 0.
    message E138(ZSM) with SY-UNAME ' not authorized ' 'to use this transaction'.
  endif.

Regards

Gopi

3 REPLIES 3

Former Member
0 Kudos

Yes ,you have to create custom auth object .

check the below link for auth object :

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a...

Thanks

Seshu

gopi_narendra
Active Contributor
0 Kudos

You can create your own Custom Authorisation Object from transaction SU20.

After creating the Authorisation Object, use the code like this..


authority-check object 'ZBUKRS'
                    id 'BUKRS'
                 field ZES_MAIL-BUKRS.
  if SY-SUBRC ne 0.
    message E138(ZSM) with SY-UNAME ' not authorized ' 'to use this transaction'.
  endif.

Regards

Gopi

Former Member
0 Kudos

It would really depend on whether you can distinguish those two groups of users some other way. For example, if you only want option "A" available to people who can (say) create sales orders then you could check in your code for access to the VA01 transaction via auth object S_TCODE.

Jonathan