*&---------------------------------------------------------------------*
*& Report YSAP_NESTED_INTERFACE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ysap_nested_interface.
*----------------------------------------------------------------------*
* INTERFACE interface1
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
INTERFACE interface1.
METHODS: method1.
ENDINTERFACE. "interface1
*----------------------------------------------------------------------*
* INTERFACE interface2
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
INTERFACE interface2.
METHODS: method2, method3.
INTERFACES interface1.
ENDINTERFACE. "interface2
*----------------------------------------------------------------------*
* CLASS class1 DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS class1 DEFINITION.
PUBLIC SECTION.
INTERFACES interface2.
ENDCLASS. "class1 DEFINITION
*----------------------------------------------------------------------*
* CLASS class1 IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS class1 IMPLEMENTATION.
METHOD interface1~method1.
WRITE:/ 'this is method1 from interface1' COLOR 4.
ENDMETHOD. "interface1~method1
METHOD interface2~method2.
WRITE:/ 'this is method2 from interface2' COLOR 5.
ENDMETHOD. "interface2~method2
METHOD interface2~method3 .
WRITE:/ 'this is method3 from interface2' COLOR 6.
ENDMETHOD. "interface2~method3
ENDCLASS. "class1 IMPLEMENTATION
START-OF-SELECTION.
DATA: object1 TYPE REF TO class1.
CREATE OBJECT object1.
CALL METHOD: object1->interface1~method1,
object1->interface2~method2,
object1->interface2~method3.
*& Report YSAP_NESTED_INTERFACE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ysap_nested_interface.
*----------------------------------------------------------------------*
* INTERFACE interface1
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
INTERFACE interface1.
METHODS: method1.
ENDINTERFACE. "interface1
*----------------------------------------------------------------------*
* INTERFACE interface2
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
INTERFACE interface2.
METHODS: method2, method3.
INTERFACES interface1.
ENDINTERFACE. "interface2
*----------------------------------------------------------------------*
* CLASS class1 DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS class1 DEFINITION.
PUBLIC SECTION.
INTERFACES interface2.
ENDCLASS. "class1 DEFINITION
*----------------------------------------------------------------------*
* CLASS class1 IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS class1 IMPLEMENTATION.
METHOD interface1~method1.
WRITE:/ 'this is method1 from interface1' COLOR 4.
ENDMETHOD. "interface1~method1
METHOD interface2~method2.
WRITE:/ 'this is method2 from interface2' COLOR 5.
ENDMETHOD. "interface2~method2
METHOD interface2~method3 .
WRITE:/ 'this is method3 from interface2' COLOR 6.
ENDMETHOD. "interface2~method3
ENDCLASS. "class1 IMPLEMENTATION
START-OF-SELECTION.
DATA: object1 TYPE REF TO class1.
CREATE OBJECT object1.
CALL METHOD: object1->interface1~method1,
object1->interface2~method2,
object1->interface2~method3.
No comments:
Post a Comment