Code: Alles auswählen.
REPORT ZMETHODS.
*---------------------
* DEFINING A CLASS
*---------------------
DATA counter type i.
CLASS myFirstClass DEFINITION.
public section.
methods: addition
importing
n1 type i
n2 type i,
endmethod.
ENDCLASS.
CLASS myFirstClass IMPLEMENTATION.
method addition.
counter = n1 + n1.
write / counter.
endmethod.
ENDCLASS.
start-of-selection.
data x type i value 10.
data y type i value 5.
" Instanz bilden
data obj type ref to myFirstClass.
create object obj.
obj->addition( x y ).