Code: Alles auswählen.
REPORT ztoigotest2 .
PARAMETERS: incoming TYPE i DEFAULT 1200,
spare_r TYPE i DEFAULT 200,
flat TYPE i DEFAULT 700,
fuel TYPE i DEFAULT 120,
drink TYPE i DEFAULT 50,
smoke TYPE i DEFAULT 120,
sonst TYPE i DEFAULT 70.
DATA: rest TYPE i,
spare TYPE i.
*---------------------------------------------------------------------*
* CLASS test DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
CLASS test DEFINITION.
PUBLIC SECTION.
METHODS: set_attributes IMPORTING
p_incoming TYPE i
p_spare_r TYPE i
p_flat TYPE i
p_drink TYPE i
p_smoke TYPE i
p_sonst TYPE i,
display_attributes,
show_time.
ENDCLASS.
*---------------------------------------------------------------------*
* CLASS test IMPLEMENTATION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
CLASS test IMPLEMENTATION.
METHOD set_attributes.
incoming = p_incoming.
spare_r = p_spare_r.
flat = p_flat.
drink = p_drink.
smoke = p_smoke.
sonst = p_sonst.
ENDMETHOD.
METHOD display_attributes.
WRITE: / 'Incoming: ' ,incoming, ' Sparrate: ', spare_r, ' Wohnung: ',
flat, ' Trinken: ', drink, ' Rauchen: ', smoke,
' Sonstiges: ', sonst.
ENDMETHOD.
METHOD show_time.
DO 10 TIMES.
rest = rest + incoming - spare_r - flat - drink - smoke - sonst.
spare = spare + spare_r.
WRITE: / 'Konto: ', rest, ' Sparbuch: ', spare.
ENDDO.
ENDMETHOD.
ENDCLASS.
DATA: test1 TYPE REF TO test.
CREATE OBJECT test1.
call method test1->set_attributes.
call method test1->display_attributes.