Error handling
In ABAP the question is how a failure travels back to the caller: as a class-based exception, as a returned result object that carries the error, or as a message table such as BAPIRET2.
Overview
Class-based exceptions: an exception is an instance of an exception class, raised with RAISE EXCEPTION or THROW in a conditional expression, and handled in the CATCH blocks of a TRY structure.
Not covered: At raising and catching. The language has no result value for an expected failure, and converting exception texts into BAPIRET2 or SYMSG for a caller is left to the application.
Libraries that return a failure as a value, such as RESULT-for-ABAPRESULT-for-ABAPAn ABAP implementation of the result pattern: a method returns an object built with ok or fail instead of raising an exception for an expected failure, and several results combine into one.independent, abap, and that convert exception texts into BAPIRET2 and SYMSG, such as sap-usi-exceptionsap-usi-exceptionA shared root exception class and text getter API used across SchwarzIT's USI ABAP developments, converting an exception's text into a common format such as BAPIRET2 or SYMSG.independent, abap. ABAP-PRCABAP-PRCA framework for custom multi-step ABAP processes: a process class declares the states, and the framework runs each document through them and monitors the run.independent, abap is a process framework that collects errors as messages and resumes a failed object on the step that failed.
Artifacts
Content
Details
Coverage
For your agent
- Ref
capability:error-handling- JSON
- /capabilities/error-handling.json
- MCP
- Connecting an agent