04-13-2009 11:50 AM
Hi,
I am using TYPE KONP-KBETR whose data element is 'KBETR_KOND'. Its Length is 11 and decimal Places is 2.
Now I want to store this value in a variable with 3 decimal places.
For this I have taken a variable with type P.
Eg : DATA : VALUE2(7) type P decimals 3.
When I store the value of KONP-KBETR in var VALUE2, I get some confusing value.
For Eg: if KONP-KBETR = 300.00 and I pass this value to var VALUE2, then VALUE2 becomes 30.000.
Ideally VALUE2 should have been 300.000.
Can anybody tell why this is so and what needs to be done to get the correct value.?
Thanks.
04-13-2009 11:59 AM
Hi Kumar,
TABLES KONP.
data: val1 TYPE KONP-KBETR value '300.00',
VALUE2(7) type P decimals 3.
value2 = val1.
write: val1,
value2.
the output of the above code, 300.00 300.000.
i didn't get any problem.. check it out once..
Ram
04-13-2009 12:10 PM
It does work in this situation.
But I have copied standard report ME49 and am making changes in the same. In this case I am facing this problem.
Can anybody suggest what can be done to resolve this? Is there any setting at program level?
Thanks.
04-16-2009 12:22 PM
04-16-2009 1:49 PM
Hi,
Have a look at program properties (of the main program) and see the effect of "Fixed point arithmetic' flag by unchecking it.
Issa