Show TOC

Propagating All ExceptionsLocate this document in the navigation structure

You can add the unhandled exceptions of a selected block to the signature of the calling method in order to propagate them.

Prerequisites

This functionality is provided since SAP NetWeaver Release 7.40 SP07 and higher.

Context

Example

Before Execution After Execution

To copy the source code example, click here Code Example Before Execution

The selection contains two statments that can raise exceptions. cx_no_fuel and cx_failure have either to be handled inside the method or propagated by adding them to the method signature. For both cases, ABAP Development Tools (ADT) provides a quick assist. The cx_failure and cx_no_fuel exceptions are added to the signature of the drive method. The exception will now be propagated to the caller of the drive method automatically at runtime.

To propagate exceptions, proceed as follows:

Note To handle them inside the method, proceed as described in Surrounding with TRY CATCH

Procedure

  1. In the implementation part, select the lines where the RAISE statement is called in a method.
  2. Get the quick assist proposals by choosing Quick Fix from the context menu (shortcut Ctrl 1) or by using the Quick Assist view.
  3. Apply Propagate All Exceptions.