Show TOC

Exception HandlingLocate this document in the navigation structure

If exceptions are propagated from a called procedure or raised by a RAISE EXCEPTION statement, they must be explicitly declared in the signature of the calling method or handled by an appropriate TRY CATCH block.

In the source code editor, several functionalities are available for exception handling and these can be triggered at the following positions:

  • Cursor inside statement with procedure call
  • Cursor inside RAISE EXCEPTION statement
  • Selection of multiple statements with procedure calls and/or RAISE EXCEPTION statements
Source Code Selection That Includes Raised Exceptions

The exception(s) are added to the signature of the calling method or surrounded with a TRY CATCH block.

Function Description Available since SAP NetWeaver 7.3 EHP1 Available since SAP NetWeaver 7.4 Available since SAP NetWeaver 7.5
Propagating All Exceptions Adding the unhandled exceptions of the selected block to the signature of the calling method in order to propagate them. - - SP00
Surrounding with TRY CATCH Single catches: Surrounding the selected block of statements with a try catch statement to handle raised exception(s). Each exception is handled in a seperate catch block - - SP00
Multi catch: Surrounding the selected block of statements with a try catch statement to handle raised exception(s). One catch block handles all exceptions. - - SP00
Existing TRY CATCH Block

The statement(s) are surrounded by a TRY CATCH block in order to handle the exceptions.

Function Description Available since SAP NetWeaver 7.3 EHP1 Available since SAP NetWeaver 7.4 Available since SAP NetWeaver 7.5
Extracting a Catch Variable Adding a local variable and adding the INTO clause to an existing catch block. - - SP00
Extending a TRY CATCH Statement Adding a new catch block to an existing try catch statement. - - SP00
Removing a TRY CATCH Statement Removing the entire try catch statement. - - SP00
Splitting a MULTI CATCH Block Replacing the existing multi catch block by individual catch blocks per exception. - - SP00
RAISE EXCEPTION Statement
Function Description Available since SAP NetWeaver 7.3 EHP1 Available since SAP NetWeaver 7.4 Available since SAP NetWeaver 7.5
Propagating an Exception Adding an exception class to the signature of a method signature that is based on an existing RAISE EXCEPTION statement. SP11 SP05  
Extracting an Exception Variable from a RAISE Statement Adding a variable declaration for the exception and source code to instantiate the exception before raising it. SP11 SP05