Application Development and Automation 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: 
Read only

decimal conversion

Former Member
0 Likes
791

Hi all,

LOOP AT it_equi INTO wa_equi.

g_s_totals_flat-pmax = g_s_totals_flat-pmax + wa_equi-zzpmax.

ENDLOOP.

In wa_equi-zzpmax having value like 203.6

when doing additon g_s_totals_flat-pmax having value like 2036 .

suppose if wa_equi-zppmax have another value like 203.25

g_s_totals_flat-pmax is added with 2036 + 20325 instead of 203.6 + 203.25

pls help me out.

1 ACCEPTED SOLUTION
Read only

former_member188827
Active Contributor
0 Likes
758

in your program attributes,check if "Fixed Point Arithmetic" check box is checked or not.

If not check the check box

Edited by: abapuser on Oct 16, 2009 12:03 PM

6 REPLIES 6
Read only

Former Member
0 Likes
758

what type have you declared the fields wa_equi-zzpmax and g_s_totals_flat-pmax for.

If you can declare these as type p decimals 2 to get the conversion. Unless there's a reason you cant declare these types ?

Regards

DK

Read only

0 Likes
758

I even tried with p decimal 2.

when the no. is 203.5 it displays as 20.05.

when 203.25 it displays correct 203.25

Both having same data types.

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
758

Hello,

Please check the data type of both should be the same with same number of decimal places.

Regards,

Nabheet Madan

Read only

former_member188827
Active Contributor
0 Likes
759

in your program attributes,check if "Fixed Point Arithmetic" check box is checked or not.

If not check the check box

Edited by: abapuser on Oct 16, 2009 12:03 PM

Read only

Former Member
0 Likes
758

Hi,

pmax and zzpmax can be declared as Type p decimal 2.

This must solve your problem with decimals.

regards,

Read only

RahulKeshav
Active Contributor
0 Likes
758

HI ,

data zppmax (10) type c.

WRITE wa_equi-zppmaxTO zppmax DECIMALS 2 LEFT-JUSTIFIED.

then add.

thnx

RK