SAP RAISE EVENT ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID RAISE-EVENT
• RAISE EVENT ABAP Statement

RAISE EVENT
Short Reference

ABAP_SYNTAX
RAISE EVENT evt $[EXPORTING p1 = a1 p2 = a2 ...$].

ABAP Addition
... EXPORTING p1 = a1 p2 = a2 ...

What does it do?
This statement can only be used in methods. It raises the event evt . evt is the name to be specified directly for an event that must be declared with the statement EVENTS or CLASS-EVENTS directly in the same class, in a superclass, or in an implemented interface.
After the event is raised, all event handlers that were registered for this event with the statement SET HANDLER are executed. The order of execution is undefined and can change during program execution. After the event handlers have been executed, the method continues after RAISE EVENT.
• EXPORTING RAISE EVENT

ABAP Addition

What does it do?
If the addition EXPORTING is used, actual parameters a1 a2 ... can be assigned to all optional formal parameters p1 p2... of the event evt and must be assigned to all non-optional formal parameters. The values of the actual parameters are passed to those event handlers whose definition lists the according formal parameters after the addition IMPORTING of the statements $[CLASS-$]EVENTS .
a1, a2, ... are general expression positions, which means that, alongside data objects, functions and expressions can also be passed as actual parameters. Special rules apply in this case.



Latest notes:

To avoid endless recursion, a maximum of 1023 further events can be raised using RAISE EVENT in event handling.
If the formal parameter sender is defined for an event handler, this is automatically supplied with the reference to the raising object when instance events are raised. It cannot be specified explicitly after EXPORTING.
If there is an exception in an event handler, event handling is canceled. For a class-based exception, the control is then returned to the trigger. See Class-Based Exceptions in Event Handlers.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Raising of the instance event e1. An actual parameter must be assigned to the non-optional formal parameter p1.
ABEXA 00505
ABAP_EXAMPLE_END



Runtime Exceptions


Non-catchable Exceptions
Reason for error:
RAISE EVENT statements nested too deeply.
Runtime error:
RAISE_EVENT_NESTING_LIMIT
ABAP_NONCAT_END

Return to menu