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

Do I need a custom authorization object for this?

Former Member
0 Likes
750

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
Read only

gopi_narendra
Active Contributor
0 Likes
708

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

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
Read only

Former Member
0 Likes
708

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

Read only

gopi_narendra
Active Contributor
0 Likes
709

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

Read only

Former Member
0 Likes
708

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