Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

need help

Former Member
0 Likes
348

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

2 REPLIES 2
Read only

Former Member
0 Likes
330

Download ur screen and post it here.

I will chk and let you know.

Cheers..!!!!

Read only

Former Member
0 Likes
330

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