Page 1 of 1

Kontostand übernimmt keine Einzahlwerte

PostPosted: Sun Dec 04, 2011 3:22 pm
by Ceren232
Hier bin ich hilfslos und bräuchte mal Hilfe
wie kann ich die return wert mit eingabe-Parameter verknüpfen ?

PARAMETERS: Betra_g type i.
TYPES boolean(1) TYPE C.
Class Z_Konto Definition .
Public Section .
Data Besitzer(20).
CLASS-METHODS Main_2.
Methods einzahlen
importing value(Betra_g) Type i Returning value(erfolg) TYPE Boolean.
Methods Kontostandabrufen Exporting betrag type i .
Private Section .
Data p_Kontostand type i .
EndClass.
Class Z_Konto Implementation .
METHOD einzahlen .
IF Betra_g > 1000.
erfolg =''.Return.
p_Kontostand = p_Kontostand + Betra_g .
erfolg = 'X'.
ENDIF.
ENDMETHOD.
METHOD Kontostandabrufen .
DATA output type String .
output = p_kontostand.
write :/'Kontostand ',p_kontostand,
/'Betra_g',Betra_g.
MESSAGE output TYPE 'I'.
ENDMETHOD.

Method Main_2.
DATA ref_konto Type Ref TO Z_KONTO.
DATA Kontostand Type i .
CREATE OBJECT ref_Konto .
IF ref_konto->einzahlen( Betra_g ) = 'X'.
WRITE 'erfolgreich gebucht'.
ELSE .
WRITE 'nicht erfolgreich'.
ENDIF.
ENDMETHOD .
ENDCLASS.
START-OF-Selection.
Z_Konto=>Main_2( ) .
DATA ref_Konto type Ref to Z_Konto.
CREATE OBJECT ref_Konto.
ref_Konto->Kontostandabrufen( ).
Vielen Dank
Jabran