Post: ABAP Programming
01-26-2018, 10:19 AM #1
kyfolam
Do a barrel roll!
(adsbygoogle = window.adsbygoogle || []).push({}); Maybe someone out here can help me out.*
I am trying to learn ABAP (SAP) now and already wrote a Calculator.*

    
REPORT ZCALC.
PARAMETERS Zahl1 TYPE i.
PARAMETERS plus RADIOBUTTON GROUP grp1.
PARAMETERS minus RADIOBUTTON GROUP grp1.
PARAMETERS mal RADIOBUTTON GROUP grp1.
PARAMETERS durch RADIOBUTTON GROUP grp1.
PARAMETERS Zahl2 TYPE i.

IF plus = 'X'. add Zahl2 to Zahl1.
WRITE : 'Awesome faceas Ergebnis der Addition lautet: ' , Zahl1.
ENDIF.

IF minus = 'X'. SUBTRACT Zahl2 FROM Zahl1. WRITE : 'Awesome faceas Ergebnis der Subtraktion lautet: ' , Zahl1.
ENDIF.

IF mal = 'X'. MULTIPLY Zahl2 by Zahl1. WRITE : 'Awesome faceas Ergebnis der Multiplikation lautet: ' , Zahl1.
ENDIF.

IF durch = 'X'. IF zahl2 = 0.
WRITE 'Awesome faceivision durch 0 nicht möglich. Bitte nochmal versuchen!'.
ELSE.
DIVIDE Zahl1 by Zahl2.
WRITE : 'Awesome faceas Ergebnis der Division lautet: ' , Zahl1.
ENDIF.
ENDIF.


Now I want to redesign it, not with Radio-Buttons, but with the "F4-Click". I know I have to delete the Radiobutton Group and add this Parameter in stead of

    PARAMETERS auswahl TYPE ZCALC_OPERATOREN.


But what next? How can I code it that the Programm knows what Operator has been choosen?

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo