11-18-2016 4:22 PM - edited 01-21-2024 10:07 PM
Hi Everyone,
here you are a program, which divides 2 numbers:
---------------------------------
PROGRAM divide.
DATA: pack TYPE p DECIMALS 2,
n TYPE f VALUE '1000.5',
m TYPE f VALUE '10'.
pack = n / m.
WRITE pack.
---------------------------------
Result is 100.05 and this is wrong.
Correct result is 100.50
Where is a catch?
Our version is ECC 617
I do not believe that simple division sometimes does not really work in SAP.
Thanks,
Alex
11-18-2016 5:18 PM
Do you have "fixed point arithmatic" checked/selected for your program?
11-18-2016 5:45 PM
11-18-2016 8:00 PM
Just to double check that Alexander didn't mean the other way around (that SAP is returning 100.50) I just ran his little program in SAP and it did return 100.05 as expected. Pheww - the world is still round!
11-21-2016 9:00 AM