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 problem

Former Member
0 Likes
1,958

Hello,

I have to check auhorisation. I created in su20 2 authorization check fields (Z_UO and Z_ACT). In su21 I created an authorization object named Z_APO_MGTM. I assigned my two authorization check fields to it.

Now in an ABAP Program, i try this

AUTHORITY-CHECK OBJECT 'Z_APO_MGTM'

ID 'Z_UO' FIELD WS_T1-UO

ID 'Z_ACT' FIELD W_SENS .

I run the program myself. My authorization are SAPALL. In the program, after AUTHORITY-CHECK sy-subrc = 12. Why? It should be equal to 0 since i'm am SAPALL.

Did i forget something when i created the objects?

Thanks by advance,

LB.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,178

Hi

SY-SUBRC = 12 means you haven't the authorization object in your profile.

The profile SAP_ALL contains all standard authorization objects only, if you create new one, it can't be in SAP_ALL automatically, so your control is failing.

U have to create a new (Z)profile where you have to insert your all new authorizations and then assign it to your user.

In this way your profile will have SAP_ALL (with std authorizations) and Z<profile> (with custom authorization).

Max

3 REPLIES 3
Read only

Former Member
0 Likes
1,179

Hi

SY-SUBRC = 12 means you haven't the authorization object in your profile.

The profile SAP_ALL contains all standard authorization objects only, if you create new one, it can't be in SAP_ALL automatically, so your control is failing.

U have to create a new (Z)profile where you have to insert your all new authorizations and then assign it to your user.

In this way your profile will have SAP_ALL (with std authorizations) and Z<profile> (with custom authorization).

Max

Read only

0 Likes
1,178

You're right. I forgot this

Thank you!

Read only

0 Likes
1,178

If we assign SAP_NEW profile also to the user along with SAP_ALL.

Every time we no need to create a role for the newly created Tcodes ( authorization objects) .

is this useful ???