SAP® Documentation

Single view

ABAPCLASS-METHODS_EVENT_HANDLER - CLASS-METHODS EVENT HANDLER

CPI1466 during Backup   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

CLASS-METHODS - FOR EVENT

Short Reference



Syntax

CLASS-METHODS meth $[DEFAULT IGNORE$|FAIL$]
   FOR EVENT evt OF ${class$|intf$}
   $[IMPORTING p1 p2 ...$[sender$]$].

Effect

This statement declares the static methodmeth as the event handler for the event evt of the class class or the interface intf. The syntax and meaning of the additions are identical to the declaration of instance methods as event handlers.

Static event handlers can be called by the event evt independently of an instance of the class.

Example

The class dialog_box defines a static event handler close_box for the event raised when the user chooses to close a Control Frameworks (CFW) dialog box.

CLASS dialog_box DEFINITION.
  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.








RFUMSV00 - Advance Return for Tax on Sales/Purchases   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.

Length: 2702 Date: 20191210 Time: 232457     sap01-206 ( 22 ms )

Our Service

Looking for Support? Questions?

The

Consolut

Callback-Service

Leave us your contact details and we will call you back. Panels marked with * are mandatory.