REPORT ytest_011.
*----------------------------------------------------------------------*
* CLASS zcl_eventsreceive DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS zcl_eventsreceive DEFINITION .
PUBLIC SECTION.
METHODS :
say ,
constructor
IMPORTING
input TYPE char10.
DATA data_type TYPE char10 .
ENDCLASS. "zcl_eventsreceive DEFINITION
*&---------------------------------------------------------------------*
*& Class (Implementation) zcl_eventsreceive
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
CLASS zcl_eventsreceive IMPLEMENTATION .
METHOD constructor.
data_type = input.
ENDMETHOD. "constructor
METHOD say.
MESSAGE s000(oo) WITH data_type .
ENDMETHOD. "SAY
ENDCLASS. "zcl_eventsreceive
START-OF-SELECTION.
DATA lcl_cls_1 TYPE REF TO zcl_eventsreceive.
DATA lcl_cls_2 TYPE REF TO zcl_eventsreceive.
CREATE OBJECT lcl_cls_1
EXPORTING
input = 'SVICE1'.
CREATE OBJECT lcl_cls_2
EXPORTING
input = 'SVICE2'.
WRITE:/ '== GO =='.
CALL METHOD lcl_cls_1->say.
CALL METHOD lcl_cls_2->say.
WRITE:/ '== END =='.
以后写一个用同一个类响应多个ALV的事件的用法会用到自定义构造方法