07-28-2006 8:41 AM
Hi All!
Any FM to get always the round up values.Suppose for example :
quantity is 1.234 I want 2.
or
quantity is 1.789 I want 2.
Always I want to round up.Please advise.
Regards
Praneeth
07-28-2006 8:46 AM
Hello,
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,
Naimesh
07-28-2006 8:44 AM
07-28-2006 8:45 AM
DATA: VAR1 TYPE P DECIMALS 2,
RES TYPE P DECIMALS 2.
VAR1 = '12.33'.
RES = ROUND( VAR1 ).
WRITE RES.
07-28-2006 8:46 AM
Hello,
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,
Naimesh
07-28-2006 8:52 AM
Hi Praneeth,
Dont think 'Round' will always work coz for 1.234.....it will give 1....
So better use Function ceil.
w_qty = ceil( input_qty)
07-28-2006 8:59 AM
Hi Praneeth,
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,
SP.
07-28-2006 9:56 AM
Hi
Use CEIL function . This gives the nearest integer value.
Regards