Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Value error during type conversion (KONP-KBETR to packed nos).

Former Member
0 Kudos

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.

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

-

Former Member
0 Kudos

Hi,

Have a look at program properties (of the main program) and see the effect of "Fixed point arithmetic' flag by unchecking it.

Issa