5 Replies Latest reply: May 10, 2016 12:36 PM by murugan bavani

# Function Module for Rounding Off to the Nearest  Value of th given Value

Currently Being Moderated

Hi Friends,

Is there any Function Module for Rounding Off the given Value.

For Example.....

Say v_variable contains the value 2.81

Now the decimal is more than 50 paise.. so it should round off to 3.00

Say if the variable v_variable contains the value 2.41

Now the decimal is less than the 50 paisa.. so it should round off to 2.00

How i am doing.

First every thing i am moving to charater format ( Charater Data Type )

after that SPLITTING at decimal positions into two variable like v_rupees and v_paise.

Checking the variable v_paise greater than or equal to 50 paise.

v_variable = CEIL( v_variable)

else.

v_variable = FLOOR(v_variable)

Here my problem is every thing i have to move into charactes data type..

So i am looking for a Function Module..

Please check this and let me help regarding this.

Thanks & Regards:

Sridhar.J

• ###### Re: Function Module for Rounding Off to the Nearest  Value of th given Value
Currently Being Moderated

Use FM ROUND

• ###### Re: Function Module for Rounding Off to the Nearest  Value of th given Value
Currently Being Moderated

Hi Sridhar,

Function Module is ROUND.

CALL FUNCTION 'ROUND'

EXPORTING

•   DECIMALS            = 0

input               = v_data

•   SIGN                = ' '

IMPORTING

OUTPUT              = v_data.

Also check the Funciton Modules:

ROUND_AMOUNT

FI_ROUND_AMOUNT

FM HR_IN_ROUND_AMT

Hope this helps you.

Regards,

Chandra Sekhar

• ###### Re: Function Module for Rounding Off to the Nearest  Value of th given Value
Currently Being Moderated

Sridhar,

J_1I6_ROUND_TO_NEAREST_AMT----161.40 will be 161- 161.50 will be 162

K.Kiran.

• ###### Re: Function Module for Rounding Off to the Nearest  Value of th given Value
Currently Being Moderated

hai kiran k  it is help full for me.

thank q .

regards,

uday.

• ###### Re: Function Module for Rounding Off to the Nearest  Value of th given Value
Currently Being Moderated

Hi All,

No need of Function modules use the below one line code

data(lv_round) = round( val = '5678.65800341' dec = 0 ).

Now the value of lv_round will be 5679

Thanks,

Murugan