REPORT Z_SIMPLE_OBJECT.
CLASS application DEFINITION.
PUBLIC SECTION .
CLASS-DATA class_name(10) type c VALUE 'vehicle'. 类的静态成员属于整个类,定义时必须使用关键字class-data
METHODs:show_text.
PRIVATE SECTION.
DATA text(100) type c VALUE 'this is my first abao object'.
ENDCLASS.
CLASS application IMPLEMENTATION.
METHOD show_text.
WRITE text.
ENDMETHOD.
ENDCLASS.
data ob_app TYPE REF TO application.
START-OF-SELECTION.
WRITE application=>class_name. 对于类的静态组件,可以直接用类名称使用类成员选择运算符=>直接对类操作
CREATE OBJECT ob_app.
CALL METHOD ob_app->show_text.