ABAP - Keyword Documentation →  ABAP - Programming Language →  Program Flow Logic →  Exception Handling →  Exceptions Before Class-Based Exceptions →  Non-Class-Based Exceptions → 
Mail Feedback

RAISE

Short Reference

Syntax

RAISE exception.

Effect

This statement raises the non-class-based exception exception.

After the exception exception is raised, the system behaves as follows:

This form of the statement RAISE cannot be used in the same processing block as the statement RAISE EXCEPTION or the addition THROW in a conditional expression to raise class-based exceptions.

Hints



Example

Raising of a non-class-based exception in a method.

CLASS cls DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS meth EXCEPTIONS exc.
ENDCLASS.

CLASS cls IMPLEMENTATION.
  METHOD meth.
    ...
    RAISE exc.
    ...
  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  cls=>meth( EXCEPTIONS exc = 4 ).
  CASE sy-subrc.
    WHEN 4.
      cl_demo_output=>display( 'Exception' ).
    WHEN OTHERS.
      ...
  ENDCASE.

Exceptions

Uncatchable Exceptions