No transfer of SY-SUBRC

The system field SY-SUBRC must not be used in ABAP Objects as an actual parameter for the output parameters of external procedures.

Error message in ABAP Objects in the following case:

CALL FUNCTION func IMPORTING p = sy-subrc.

Correct syntax:

DATA subrc TYPE sy-subrc.

CALL FUNCTION func IMPORTING p = subrc.

Reason:

After parameter transfer, SY-SUBRC is set by the call statement. This overwrites the transferred value. With a few exceptions, system fields should never be overwritten explicitly in a program.

Overview:

Replacement for Obsolete Statements ABAP Objects