Skip to Content
1
Jul 20, 2020 at 07:51 AM

AUTHORITY-CHECK OBJECT always returns SY-SUBRC = 0

471 Views Last edit Jul 20, 2020 at 11:24 AM 3 rev

Hello,

I'm an SD consultant, and I need help with something related to ABAP.

We made a custom authorization object of Z_KONH_KLS, to control which values of condition types the users can see based on the pricing procedure name (KALSM) and step number (STUNR). So, if user viewed a Sales Order document that has different pricing procedure set in the authorization object, all values of condition types won't appear; or if both pricing procedure in authorization object and SO are the same, the user can only view the values until step number set in the authorization object.

We've been using this method in one of our server (4.6C version) for years.

One of the users asked to bring the same method to the other server (SAP ERP Central Component 5.0 version). However, when we debug the new code brought from 4.6C version, the sy-subrc always returns 0.

These are the roles:

4.6C version role-1.png

SAP ERP Central Component 5.0 version role-2.png

The pricing procedure used in both servers have different names, but same content. Step 174 and beyond, we use it for VPRS, which we don't want user to see the value.

Here's the debug result - left is 4.6C version, right is SAP ERP Central Component 5.0 version debug-result.png

In SAP ERP Central Component 5.0 version of server, no matter what KALSM I give, it always returns sy-subrc = 0.

Can anyone help what is the cause why it always returns sy-subrc = 0 and how to fix it, despite the same code has been used in other server for years without problem?

Thanks,

Attachments

role-1.png (14.3 kB)
role-2.png (14.3 kB)
debug-result.png (88.0 kB)