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: 

AUTHORITY CHECK OBJECT on ORGEH is always returning sy-subrc zero

Former Member
0 Kudos
618

Hi

Below is my code.

I have created autorization object and created a role N assigned to a User. But the sy-subrc is zero.

AUTHORITY-CHECK OBJECT 'ZORGEH' FOR USER sy-uname

ID 'ZORGEH' FIELD gv_org

ID 'ACTVT' FIELD '03'.

IF sy-subrc NE 0.

MESSAGE 'No Authorization.' TYPE 'E'.

STOP.

ENDIF.

plz help.

Regards

Nazi

4 REPLIES 4

Former Member
0 Kudos
191

Try FM AUTHORITY_CHECK

Former Member
0 Kudos
191

Your OBJECT NAME AND ID Name Is same Pls. Try it With Different Name........

0 Kudos
191

You were exactly right. solved the issue. ihave given object and field in different name. Thanks a loot.

Regards,

nazi

Former Member
0 Kudos
191

Hi,

In

AUTHORITY-CHECK OBJECT 'ZORGEH' FOR USER sy-uname
ID 'ZORGEH' FIELD gv_org
ID 'ACTVT' FIELD '03'.
IF sy-subrc NE 0.
MESSAGE 'No Authorization.' TYPE 'E'.
STOP.
ENDIF.

Check 03 for ACTVT field as it usually for display purposer and discplay authorization used to be given to any user ID.

So may be you need to check role assigned to user where for this authorization object values not allowed is 03 or not as possiblility is 01 and 02 may not be allowed but 03 may be allowed.