Skip to Content
0
Former Member
Feb 26, 2009 at 10:52 AM

Rounding off problem attaching piece of code please see it

80 Views

Hi,

I am currently trying to calculate a formula in va01 this pertcular is a combination of three values now my requirement is to round off my final value that is say if my amount is 1000 now my rest three values are say 20.6,now i have to subtract 20.6 from 1000 so the return id 974.4 i wont this value as 974 rather than 974.4 or if it is 974.6 i wont my result be 975. NOT able to find a solution have tryed using functional module round,round_amount. please help.

data : x1 type p decimals 2,

x2 type p decimals 2 ,

x4 type p decimals 2 ,

x5 type p decimals 2 ,

x6 type p decimals 2 ,

x3 type p decimals 2.

clear :x1 ,x2 ,x3 , x4 ,x5 ,x6.

DATA P_RUNIT LIKE VTBFIMA-RUNIT VALUE 1.

*

XKOMV-KWERT = ( KOMP-KZWI4 - KOMP-KZWI3 - komp-kzwi2 ).

x2 = XKOMV-KWERT - komp-kzwi1.

xkwert = x2.

CALL FUNCTION 'FIMA_NUMERICAL_VALUE_ROUND'

EXPORTING

I_RTYPE = SPACE

I_RUNIT = P_RUNIT

I_VALUE = X3

IMPORTING

E_VALUE_RND = X6.

.

Regards

Sumeet Malhotra