SAP RAISE ABEXA



Get Example source ABAP code based on a different SAP table
  



Exceptions, RAISE
This example demonstrates the statement RAISE EXCEPTION.

ABAP_SOURCE_CODE
DEMO CL_DEMO_RAISE_EXCEPTION

ABAP_DESCRIPTION
This example shows the two variants of the statement RAISE EXCEPTION . The first statement raises an exception of the class CX_DEMO_CONSTRUCTOR in the inner TRY block, creates the relevant object, and passes the current program name to the instance constructor. The inner CATCH block handles the exception, produces the exception text as output and raises the exception again without creating a new object. The outer CATCH block handles the exception again. The class CX_DEMO_CONSTRUCTOR is defined in such a way that the passed program name appears in the exception text. The generated instance constructor ensures this.
The output of the line number in which the exception was raised indicates that, when the existing exception object was reused, its information was changed.