10-05-2007 4:45 PM
hi all,
I am trying to round of somes balances to without decimal places.
1) my value is 55.12
I need the value should be 55
or
1) my value is 55.65
i need the value should be 56
if the value is >.5 it should be 1
if the value is <.5 it should be 0
Please let me know how to do this
I tried some ROUND FM's...But, I can't get.
Plz Give me exact FUNCTION MODULE
Thanks in advance.
RAM
10-05-2007 4:48 PM
Try this
DATA pack TYPE p VALUE '123.456'
DECIMALS 3.
WRITE pack DECIMALS 2.
WRITE: / pack ROUND -2,
/ pack ROUND -1,
/ pack ROUND 1,
/ pack ROUND 2.
Result is
123,46
12.345,600
1.234,560
12,346
1,235
You need to use like
WRITE: / pack ROUND Your_field.
Also check this out -
1. Use CEIL function to get the result.
Go through this link for more details.
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3316358411d1829f0000e829fbfe/content.htm
2. U can use ROUND_AMOUNT fm to get also.
ashish
Message was edited by:
Ashish Gundawar
10-05-2007 4:57 PM
Hi Ram
take the help from this code :
DATA : v_var1 TYPE p DECIMALS 3 VALUE '55.56',
v_var2 TYPE i.
v_var2 = CEIL( v_var1 ).
WRITE : v_var2.
<b>Reward points, if helpful,</b>
Regards,
Sandeep kaushik
10-05-2007 5:00 PM
hi,
Pass that value on to a integer variable ..
ie., data : i_int type i.
i_int = 55.56.
write i_int.
Regards,
Santosh
10-05-2007 5:46 PM
Hi,
Declare a variable with type integer and pass the decimal value to it.
Thanks,
Sriram Ponna.
Message was edited by:
Sriram Ponna