Object Oriented Simple Program
REPORT ztest1111111.
*----------------------------------------------------------------------*
* CLASS testclass1 DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS testclass1 DEFINITION.
PUBLIC SECTION.
DATA: lv_answ TYPE char255 VALUE 'This is a variable (lv_answ) defined in testclass1 (class)'.
METHODS testmethod.
ENDCLASS. "testclass1 DEFINITION
*&---------------------------------------------------------------------*
*& Class (Implementation) testclass1
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
CLASS testclass1 IMPLEMENTATION.
METHOD testmethod.
WRITE : /'This is written from method (method testclass1 class).'.
ENDMETHOD. "testmethod
ENDCLASS. "testclass1
START-OF-SELECTION.
data: class1 TYPE REF TO testclass1.
CREATE OBJECT class1.
WRITE: class1->lv_answ.
call METHOD class1->testmethod.
Çıktısı:
Hiç yorum yok:
Yorum Gönder