Multiple choice technology programming languages

When catching errors using the CATCH…ENDCATCH statement, where does the runtime error return code get placed?

  1. sy-subrc

  2. sy-fdpos

  3. error class

  4. system-exceptions

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

When using the CATCH...ENDCATCH statement (the obsolete ABAP error handling mechanism before TRY...CATCH), the runtime error return code is placed in the system field sy-subrc. This allows the program to check what error occurred.

AI explanation

When a CATCH SYSTEM-EXCEPTIONS ... ENDCATCH block catches a runtime error, ABAP stores the corresponding numeric code in the system field sy-subrc, which the program then checks (e.g. IF sy-subrc <> 0) to handle the error. 'system-exceptions' is only the name of the clause used to declare which errors to catch, not the place the return code is stored.