REPORT zr_class_02.
*----------------------------------------------------------------------*
* CLASS lcl_car DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_car DEFINITION.
PUBLIC SECTION.
METHODS set_car IMPORTING im_model TYPE string
im_make TYPE string.
METHODS get_car EXPORTING ex_model TYPE string
ex_make TYPE string.
PRIVATE SECTION.
DATA: model TYPE string,
make TYPE string.
ENDCLASS. "lcl_car DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_car IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_car IMPLEMENTATION.
METHOD set_car.
model = im_model.
make = im_make.
ENDMETHOD. "set_car
METHOD get_car.
ex_model = model.
ex_make = make.
ENDMETHOD. "get_car
ENDCLASS. "lcl_car IMPLEMENTATION
START-OF-SELECTION.
DATA: r_car TYPE REF TO lcl_car.
DATA: gv_model TYPE string,
gv_make TYPE string.
CREATE OBJECT r_car.
r_car->set_car( EXPORTING im_model = 'SM7'
im_make = '2009' ).
r_car->get_car( IMPORTING ex_model = gv_model
ex_make = gv_make ).
WRITE:/ gv_model, gv_make.