‎2008 May 14 10:55 PM
Hi friends,
I want to create a calculator program.
This is the code.
DATA: A TYPE I, "input value A
B TYPE I, "input value B
C TYPE I, "value c result
ADD TYPE C, " created check box
MULT TYPE C, " created checbox
SUB TYPE C,
DIV TYPE C,
CALCULATE TYPE C,
CLEAR TYPE C,
CANCEL TYPE C,
OK_CODE TYPE SY-UCOMM.
CALL SCREEN 153.
MODULE CALCULATE_VALUES INPUT.
IF OK_CODE = 'DISPLAY'.
IF ADD = 'X'.
COMPUTE C = A + B.
ENDIF.
IF SUB = 'X'.
C = A - B.
ENDIF.
IF MULT = 'X'.
C = A * B.
ENDIF.
IF DIV = 'X'.
C = A / B.
ENDIF.
ELSEIF OK_CODE = 'CLEAR'.
CLEAR: A, B, C.
ELSEIF OK_CODE = 'CANCEL'.
LEAVE program.
But it is not working.
i am not getting any value in c which should contain result of calculation.
Plz let me know what needs to be changed in the program.
Thanks
‎2008 May 15 1:36 AM
Download ur screen and post it here.
I will chk and let you know.
Cheers..!!!!
‎2008 May 15 3:12 AM
Hi,
Try naming your output box like the variable you are using in your program.
if C is the variable containing the result then try to make the name of your output box on your screen like C.
or you loop at the screen to check if the output box is really getting the result.
Regards,
Leonard Chomi