SAP Tutorials Blog

 


CLASS class1 DEFINITION.

  PUBLIC SECTION.

    METHODS: constructor.

ENDCLASS.                    "class1 DEFINITION


*----------------------------------------------------------------------*

*       CLASS class1 IMPLEMENTATION

*----------------------------------------------------------------------*

*

*----------------------------------------------------------------------*

CLASS class1 IMPLEMENTATION.

  METHOD constructor.

    WRITE: / 'This is class1' COLOR 3.

  ENDMETHOD.                    "constructor

ENDCLASS.                    "class1 IMPLEMENTATION



*----------------------------------------------------------------------*

*       CLASS class2 DEFINITION

*----------------------------------------------------------------------*

*

*----------------------------------------------------------------------*

CLASS class2 DEFINITION INHERITING FROM class1.

  PUBLIC SECTION.

    METHODS: constructor.

ENDCLASS.                    "class2 DEFINITION


*----------------------------------------------------------------------*

*       CLASS class2 IMPLEMENTATION

*----------------------------------------------------------------------*

*

*----------------------------------------------------------------------*

CLASS class2 IMPLEMENTATION.

  METHOD constructor.

    CALL METHOD super->constructor.

    WRITE: / 'this is class2' COLOR 5.

  ENDMETHOD.                    "constructor

ENDCLASS.                    "class2 IMPLEMENTATION


*----------------------------------------------------------------------*

*       CLASS class3 DEFINITION

*----------------------------------------------------------------------*

*

*----------------------------------------------------------------------*

CLASS class3 DEFINITION INHERITING FROM class2.

  PUBLIC SECTION.

    METHODS: constructor.

ENDCLASS.                    "class3 DEFINITION


*----------------------------------------------------------------------*

*       CLASS class3 IMPLEMENTATION

*----------------------------------------------------------------------*

*

*----------------------------------------------------------------------*

CLASS class3 IMPLEMENTATION.

  METHOD constructor.

    CALL METHOD super->constructor.

    WRITE: / 'This is class3' COLOR 6.

  ENDMETHOD.                    "constructor

ENDCLASS.                    "class3 IMPLEMENTATION


START-OF-SELECTION.


  DATA: object1 TYPE REF TO class3.


  CREATE OBJECT object1.


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Manager

Contact : serkurumsal@yandex.com