17 Ocak 2014 Cuma

Object Oriented Simple Program

Object Oriented Simple Program 

REPORT ztest1111111.

*----------------------------------------------------------------------*
*       CLASS testclass1 DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS testclass1 DEFINITION.

  PUBLIC SECTION.
    DATAlv_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.
dataclass1 TYPE REF TO testclass1.
CREATE OBJECT class1.
WRITEclass1->lv_answ.

call METHOD class1->testmethod.


Çıktısı:


Hiç yorum yok:

Yorum Gönder