2023 May 05 3:13 AM
why the authority check is not working properly it is always subrc 0
in PFCG->Change authorization data . i changed the field value of WERKS to PLANT5 and PLANT6 only and the ACTVT value display,create,change are ticked
the authority check i inserted in my program should be sy-subrc=4 but why the AUTH is returning sy-subrc = 0
i also run the tcode st01 but the RC is also 0
AUTHORITY-CHECK OBJECT 'M_MSEG_LGO'
FOR USER sy-uname
ID 'WERKS' FIELD 'PLANT1'
ID 'ACTVT' FIELD '03'.
IF sy-subrc NE 0.
write 'no auth'.
else.
write: 'success'.
ENDIF.
2023 May 05 4:57 AM
2023 May 05 5:50 AM
user has sap_all in the profile
thanks
got an idea and i read this
https://help.sap.com/docs/SAP_NETWEAVER_AS_ABAP_FOR_SOH_740/c6e6d078ab99452db94ed7b3b7bbcccf/787a553...
2023 May 05 8:18 AM
but why my custom Authorization Object is Working fine the user profile has SAP_ALL?
the name of my custom Auth object starts with Z = Z_MSEG_LGO
2023 May 05 8:47 AM
Use the SU53 transaction, it displays authorization failures but also successes and therefore profiles/roles containing the requested authorization.
2023 May 05 9:25 AM
2023 May 05 9:59 AM
So you can find the profile/role in SU53 successes in green/yellow (in, your case profile SAP_ALL)
Also read Authorization Profile SAP_ALL
2023 May 05 10:05 AM
User has authorization profile "SAP_ALL" means user has "all authorizations".
I hope you understand now.