class test definition.
public section.
methods: out_put IMPORTING in TYPE string
EXPORTING out TYPE string.
methods: out_put2 IMPORTING in TYPE string.
methods: out_put3 IMPORTING in TYPE string
RETURNING VALUE(out) TYPE string.
endclass.
class test IMPLEMENTATION.
method out_put.
data string TYPE string VALUE 'Hello , '.
concatenate string in into string.
out = string.
endmethod.
method out_put2.
data string TYPE string VALUE 'This is out_put2 ,hello ,'.
concatenate string in into string.
WRITE:/ string.
endmethod.
method out_put3.
data string TYPE string VALUE 'This is out_put3 ,hello ,'.
concatenate string in into string.
out = string.
endmethod.
ENDCLASS.
start-of-selection.
data inst_test type REF TO test.
data num type string.
create object inst_test.
"一下是不同的调用方式
call method inst_test->out_put
EXPORTING in = 'dew'
IMPORTING out = num.
WRITE :/ num.
inst_test->out_put( EXPORTING in = 'vivian' IMPORTING out = num ).
WRITE : / num.