ZMR - Class - Events: 'Displaying Item Information'

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

*&---------------------------------------------------------------------*

*& Report  ZMR_CLASS_EVENTS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZMR_CLASS_EVENTS.

CLASS LC_EVENTS DEFINITION.
  PUBLIC SECTION.
*EVENTS  <event name>  [EXPROTING value(<variable>) TYPE  <data type>....
[OPTIONAL]].
   EVENTS : DOUBLE_CLICK.
*   METHODS : <methodname> FOR EVENT  <event name> OF <class name> IMPORTIN
G  <P1> <P2>....
   METHODS : DISPLAY_INFO  FOR EVENT DOUBLE_CLICK OF LC_EVENTS.
   METHODS : TRIGRING_METHOD.
ENDCLASS.

CLASS LC_EVENTS IMPLEMENTATION.
  METHOD DISPLAY_INFO.
    WRITE :/ 'DISPLAYING ITEM INFORMATION'.
    ENDMETHOD.

  METHOD TRIGRING_METHOD.
    WRITE :/ 'TRIGGERING METHOD'.
*    RAISE EVENT  <event name> EXPORTING <field1> = <value1> ...
    RAISE EVENT DOUBLE_CLICK.
 ENDMETHOD.
 ENDCLASS.
DATA : LR_EVENT TYPE REF TO LC_EVENTS.
START-OF-SELECTION.
CREATE OBJECT LR_EVENT.
*SET HANDLER  <object/refvar>->METHODNAME  FOR  <object/refvar>.
SET HANDLER LR_EVENT->DISPLAY_INFO FOR  LR_EVENT ACTIVATION 'X'. "LR_ALVGRID
CALL METHOD LR_EVENT->TRIGRING_METHOD.

You might also like