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

Incorrect value while division

Former Member
0 Likes
916

Hi All,

I want to capture the calculated value correctly and without rounding off.

Example: 3501 / 3500 = 1.00028.

But in my variable of type p with decimals 5,it is getting stored as 0.01000.

Can you please help me how to store the correct value and also without rounding off.

My code is as follows,which is in an user exit,and i can not set the attributes to 'Fixed point arithmetic'.

*************************************************************************************

DATA:LV_QTY_TRAILER TYPE P DECIMALS 5,

LV_CASES_PER_TRAILER TYPE MARM-UMREZ.

IF NOT LV_CASES_PER_TRAILER IS INITIAL.

LV_QTY_TRAILER = XVBAP-KWMENG / LV_CASES_PER_TRAILER.

ENDIF.

**************************************************************************************

Thanks & Regards,

Seshagiri.

Note: MARM-UMREZ. is of data type DEC with CHAR5 and

XVBAP-KWMENG is of data type QUAN ,15,3.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
767

Hi,

simple define define ur variable as type 'F'.

Hope this will help u.

4 REPLIES 4
Read only

Former Member
0 Likes
768

Hi,

simple define define ur variable as type 'F'.

Hope this will help u.

Read only

0 Likes
767

Hi,

Thanks for the solution.

I got the correct value by declaring as type F.

Regards

Seshagiri

Read only

0 Likes
767

Hi ,

if it is a report then goto se38 enter your reportname

then check the attributes radio button then click change and see

whether the check box <b>Fixed Point Arithmetic</b> is Checked

if not please check it.

********

if it is the Function group

then check the attributes of the function group

and see

whether the check box <b>Fixed Point Arithmetic</b> is Checked

if not please check it.

regards,

santosh

Message was edited by:

santosh

Read only

0 Likes
767

Hi Thanks for the info.

However as already mentioned in my question i can't fix the checkbox,'Fixed point arithmetic'.

Thanks & Regards,

Seshagiri.