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

Authority Check in Programs

Former Member
0 Likes
7,376

Hi all

Does anyone know tell me which table I check the check the program authority.

Thanks,

4 REPLIES 4
Read only

Former Member
0 Likes
2,948

As in transaction SU24 we managed to get a check which objects are active in transactions, I would like to know if there is a way to do a check on programs.

Read only

0 Likes
2,948

1. To create authorization field - SU20.

2. To create authorization class and authorization object - SU21.

3. Create roles - PFCG . This might have to be done by BASIS.

Assign the values allowed for the fields in authorization object for that role.

4. Finally, check authorization in program .

Example if its authorization to execute a transaction ZTCODE, include this in the program for ZTCODE.

  AUTHORITY-CHECK OBJECT 'S_TCODE'
          ID 'TCD' FIELD 'ZTCODE'.


Read only

naveenvishal
Contributor
0 Likes
2,948

Hi Rodrigo,

Use following code to get it done in programs.

Say, for object V_VBAK_VKO (which you can see in SU24), you can do it like this.

AUTHORITY-CHECK OBJECT 'V_VBAK_VKO'

ID 'VKORG' FIELD VKORG

ID 'VTWEG' FIELD VTWEG

ID 'SPART' FIELD SPART.

IF sy-subrc ne 0.

show an error message.

endif.

Here , VKORG, VTWEG and SPART you have to pass from program and check sy-subrc return value.

Hope this helps.

Regards,

Naveen

Read only

Former Member
2,948

Hi Rodrigo,



You need check the AUTHORITY-CHECK statement in a program.Which inturn help you to get the Authorization Object used in the program.

Suppose you want to check for the AUTHORITY-CHECK used in the program present in Z Packages you can used Tcode CODE_SCANNER provide the required parameters and Execute. You will get the list of programs having this statement and Auth Object.

Thanks

Rajesh Chowdary