SAP CLASS FOR EVENTS



Get Example source ABAP code based on a different SAP table
  


• FOR EVENTS OF CLASS

CLASS, FOR EVENTS OF, RAP Event Handler Class

ABAP_SYNTAX
CLASS cl_event_handler DEFINITION PUBLIC $[ ABSTRACT$] $[FINAL$] FOR EVENTS OF bdef.
...
ENDCLASS.

CLASS cl_event_handler IMPLEMENTATION
...
ENDCLASS.

What does it do?
The addition FOR EVENTS OF to the definition of a global class defines a RAP event handler class.
bdef specifies the name of the RAP BO root entity. The events that are handled by the class must be defined in the BDEF of that root entity. bdef can also be the name of an interface BDEF that exposes an event.
The global class is implicitly ABSTRACT and FINAL. Therefore , ABSTRACT and FINAL may or may not be specified.
The actual handling of the events is done by RAP event handler methods that are implemented in the CCIMP include of the event handler class.



Latest notes:

NON_V5_HINTS
Event handling is not part of the implementation of the RAP BO that defines an event, nor is it part of any other RAP BO.
There can be more than one event handler class for a RAP BO.
The event handler methods that are implemented in the CCIMP include of an event handler class are called asynchroneously.
ABAP_HINT_END

ABAP_EXAMPLE_ABEXA
The example Local Consumption of RAP Business Events demonstrates the use of a RAP event handler class.
ABAP_EXAMPLE_END