REPORT ZSM_DEMO1.
PARAMETERS p_num1 type int4.
PARAMETERS p_num2 type int4.
PARAMETERS operatn type char10.
data: p_result type int4.
if operatn = '+'.
p_result = p_num1 + p_num2.
write:/ 'result : ', p_result.
ELSEIF operatn = '-'.
p_result = p_num1 - p_num2.
write:/ 'result : ', p_result.
ELSEIF operatn = '*'.
p_result = p_num1 * p_num2.
write:/ 'result : ', p_result.
ELSEIF operatn = '/'.
p_result = p_num1 / p_num2.
write:/ 'result : ', p_result.
ENDIF.
0 Comments