SAP CLASS-METHODS EVENT HANDLER ABAP Statements
Get Example source ABAP code based on a different SAP table
CLASS-METHODS - FOR EVENT
• FOR EVENT OF CLASS-METHODS
• sender CLASS-METHODS
ABAP Syntax
What does it do? This statement declares the
Static event handlers can be called by the event
Example ABAP Coding
In the class
PUBLIC SECTION.
METHODS constructor.
...
PRIVATE SECTION.
CLASS-DATA open_boxes TYPE i.
CLASS-METHODS close_box
FOR EVENT close OF cl_gui_dialogbox_container
IMPORTING sender.
...
ENDCLASS.
CLASS dialog_box IMPLEMENTATION.
METHOD constructor.
... ' create a dialogbox
open_boxes = open_boxes + 1.
ENDMETHOD.
METHOD close_box
... ' close the dialogbox referred by sender
open_boxes = open_boxes - 1.
ENDMETHOD.
ENDCLASS.
Return to menu