‎2009 May 18 12:48 PM
In fm if i divide this price 594.94 with this quantity 6.637 .i am getting 0.08 ,but exact value is 89.64.
how to resolve it .price fields r declared with currency type of decimal 2.
‎2009 May 18 12:57 PM
Does the function group main program of the function module have the checkbox "Fixed Point Arithmetic" checked?
I created this program and ran it once with that checkbox checked, and once without.
DATA: a TYPE p DECIMALS 2 VALUE '594.94',
q TYPE p DECIMALS 3 VALUE '6.637',
c TYPE p DECIMALS 2.
c = a / q.
WRITE: a, q, c.When the checkbox is set, I get the right answer, when not, I get 0.09.
matt
‎2009 May 18 12:51 PM
‎2009 May 18 12:54 PM
hi,
please check the quantity field..... i think its taking 6637 instead of 6.637...
May be the deciamals are not given in that... so just check out in the program from where you are calling this FM is it passing the correct values or not....
Regards,
Siddarth
‎2009 May 18 12:56 PM
just multiply your 594.94 with 1000 before doing your division.
‎2009 May 18 1:24 PM
‎2009 May 18 12:57 PM
Does the function group main program of the function module have the checkbox "Fixed Point Arithmetic" checked?
I created this program and ran it once with that checkbox checked, and once without.
DATA: a TYPE p DECIMALS 2 VALUE '594.94',
q TYPE p DECIMALS 3 VALUE '6.637',
c TYPE p DECIMALS 2.
c = a / q.
WRITE: a, q, c.When the checkbox is set, I get the right answer, when not, I get 0.09.
matt
‎2009 May 18 1:00 PM
Pl. check the declaration of Qty field in FM.
data: pr type p decimals 2 value '594.94'.
data: qt type p decimals 3 value '6.637'.
data: tot type p decimals 3.
tot = pr / qt.
write:/ tot.