I created this program using the screen painter, the program works but decimals don't work (doesn't allow them nor does the result screen use them) despite the fact that globally defined variables are defined with decimals like so:
DATA: value1 type p DECIMALS 2,
value2 type p DECIMALS 2,
result type p DECIMALS 2.
At this point I've set the imported fields as currency type. I dunno if theres anything I need do to the PAI module to make decimals work, but heres my coding on that anyway:
MODULE USER_COMMAND_0100 INPUT.
CASE sy-ucomm.
WHEN 'OPAD'.
result = value1 + value2.
leave to screen 0200.
WHEN 'OPSU'.
result = value1 - value2.
leave to screen 0200.
WHEN 'OPMU'.
result = value1 * value2.
leave to screen 0200.
WHEN 'OPDI'.
result = value1 / value2.
leave to screen 0200.
WHEN others.
leave program.
ENDCASE.
ENDMODULE.
Am I doing anything wrong? Why are the decimals not working? Thanks in advance.