In 90% of cases, sy-msgno and sy-msgty are empty for OS-level errors. Do not rely on them.
In ABAP, sy-subrc (Return Code) is a global system field that indicates the success or failure of the last operation. A 0 means success. Any non-zero value indicates a specific problem.
For standard OpenSQL operations, 4 might mean "no rows found." However, for low-level system operations—specifically File handling (OPEN DATASET) and External command execution (CALL 'SYSTEM')—the code 15 takes on a distinct personality. access denied sy-subrc 15
In SAP ABAP, SY-SUBRC is a system field that returns the result of an operation.
SY-SUBRC = 15 specifically means:
"Access denied" or "No authorization"
It occurs when you try to perform an action (e.g., read, write, update, delete) on a database table or a file, but the current user does not have sufficient authorization.
For file access, the relevant authorization object is S_DATASET.
Use transaction SU53 immediately after the error occurs to see missing authorizations. In 90% of cases, sy-msgno and sy-msgty are
Some developers generate a dummy authorization object (e.g., ZMY_OBJ) but never assign meaningful ACTVT (Activity) values. The check fails with 15 because while the object exists, no activities are assigned.