INTERFACE inter1.
EVENTS: event1."event decleration
methods: method1 FOR EVENT event1 of inter1.
ENDINTERFACE.
INTERFACE inter2 .
INTERFACEs inter1 .
methods: method2,
method3.
ENDINTERFACE.
CLASS inte DEFINITION.
PUBLIC SECTION.
INTERFACEs inter2.
CLASS-data: a TYPE i VALUE 10.
CLASS-data: b TYPE i VALUE 20.
ENDCLASS.
CLASS inte IMPLEMENTATION.
METHOD: inter1~method1. "implementing the event here
write:/ 'The value of I is' , a COLOR 5.
ENDMETHOD.
METHOD inter2~method2.
write:/ 'The value of i is ' ,b COLOR 6.
ENDMETHOD.
method inter2~method3.
write:/ 'The value of i is ', a COLOR 7.
RAISE EVENT inter1~event1. "Raising the event
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA: obj TYPE REF TO inte.
create OBJECT: obj .
SET HANDLER obj->inter1~method1 FOR obj.
CALL METHOD: "obj->inter1~method1,
obj->inter2~method2,
obj->inter2~method3.
EVENTS: event1."event decleration
methods: method1 FOR EVENT event1 of inter1.
ENDINTERFACE.
INTERFACE inter2 .
INTERFACEs inter1 .
methods: method2,
method3.
ENDINTERFACE.
CLASS inte DEFINITION.
PUBLIC SECTION.
INTERFACEs inter2.
CLASS-data: a TYPE i VALUE 10.
CLASS-data: b TYPE i VALUE 20.
ENDCLASS.
CLASS inte IMPLEMENTATION.
METHOD: inter1~method1. "implementing the event here
write:/ 'The value of I is' , a COLOR 5.
ENDMETHOD.
METHOD inter2~method2.
write:/ 'The value of i is ' ,b COLOR 6.
ENDMETHOD.
method inter2~method3.
write:/ 'The value of i is ', a COLOR 7.
RAISE EVENT inter1~event1. "Raising the event
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA: obj TYPE REF TO inte.
create OBJECT: obj .
SET HANDLER obj->inter1~method1 FOR obj.
CALL METHOD: "obj->inter1~method1,
obj->inter2~method2,
obj->inter2~method3.
No comments:
Post a Comment