07-21-2008 7:07 AM
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
07-21-2008 7:13 AM
Sridhar,
J_1I6_ROUND_TO_NEAREST_AMT----161.40 will be 161- 161.50 will be 162
K.Kiran.
07-21-2008 7:07 AM
07-21-2008 7:13 AM
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
07-21-2008 7:13 AM
Sridhar,
J_1I6_ROUND_TO_NEAREST_AMT----161.40 will be 161- 161.50 will be 162
K.Kiran.
07-08-2013 8:31 AM
05-10-2016 11:36 AM
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
07-06-2023 6:55 PM