‎2007 Aug 24 6:26 AM
hi friends
is there any function module for rounding up the values.
how to use that .
how to align the numer field to right in alv.
thanks
sonu
‎2007 Aug 24 6:32 AM
DATA: VAR1 TYPE P DECIMALS 2,
RES TYPE P DECIMALS 2.
VAR1 = '12.33'.
RES = ROUND( VAR1 ).
WRITE RES.
regards,
rewards point
‎2007 Aug 24 6:32 AM
data: l_1 type i, l_2 type p decimals 2.
l_2 = '1.78'.
l_1 = FLOOR( l_2 ).
l_1 = l_1 + 1.
write: l_1.
Regards,
rewards point
‎2007 Aug 24 6:33 AM
You can have two options :
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.
REgards,
rewards point
‎2007 Aug 24 6:33 AM
Here is the example Program
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.
Regards
rewards point
‎2007 Aug 24 6:39 AM
Hi,
write:/ value1 into value2 round decimal 2.
So this write not display but assign round value1 to value2.
Rewards points if it is useful.
‎2007 Aug 24 7:39 AM