08-01-2005 9:18 AM
Hi,
When I debug the code the following is what I get;
subtotal_price = wa_subtotl-J_3AFKIMG * grade_A_price.
wa_subtotl-J_3AFKIMG -> 15.000 (TYPE p DECIMALS 3 / This field is for Quantity and 3 decimal places is a must)
grade_A_price -> 2.20 (TYPE p DECIMALS 2 / This is Price)
subtotal_price -> 33000.00 (TYPE p DECIMALS 2 / Multiplication of Qty and Price)
Why the "subtotal_price" appear as "33000.00" when it should be "33", how ro solve this issue?
Thanks,
Kishan
08-01-2005 9:27 AM
Hi,
Did u debug and check what value each fields are taking
wa_subtotl-J_3AFKIMG * grade_A_price.
Check it in debugging mode so that u will get an idea.
It has to come as 33.00 as u have defined as type p 2 decimals.
08-01-2005 9:27 AM
Hi,
Did u debug and check what value each fields are taking
wa_subtotl-J_3AFKIMG * grade_A_price.
Check it in debugging mode so that u will get an idea.
It has to come as 33.00 as u have defined as type p 2 decimals.
08-01-2005 9:31 AM
Hi Kishan,
pls set field "fixed point arithmetic" (=x)
in attributes of your prg.
Andreas
Message was edited by: Andreas Mann
08-01-2005 9:34 AM
Hi Judith,
The Values that I have shown are from the dubugger.
Thanks,
Kishan
08-01-2005 9:44 AM
Hi Kishan,
Is it possible for you to paste us a bit more of your code? I made a small test with your values and it works fine (result is 33,00):
REPORT Z_TEST.
data: subtotal_price type p decimals 2,
grade_A_price type p decimals 2,
wa_subtotl type p decimals 3.
grade_A_price = '15.000'.
wa_subtotl = '2.20'.
subtotal_price = wa_subtotl * grade_A_price.
write: / subtotal_price.
Regards,
Ville
08-01-2005 9:50 AM
Hi,
Try this example
TYPES: myamount TYPE p DECIMALS 2,
amt1 TYPE p decimals 3,
amt2 TYPE p decimals 3.
DATA: amount TYPE myamount,
damt1 TYPE amt1,
damt2 type amt2.
damt1 = '15.000'.
damt2 = '2.20'.
amount = damt1 * damt2.
WRITE: amount.
Output is 33.00
08-01-2005 9:46 AM
Hi,
Look at the following Pgm.It works fine for me.
REPORT YTEST_VEN1.
data: x type p decimals 3,
y type p decimals 2,
z type p decimals 2.
x = '15.000'.
y = '2.20'.
z = x * y.
write:/ z.
Regs,
Venkat Ramanan