‎2006 Sep 20 2:43 PM
hi friends,
i am working on smartform. according to below description could u plz help me code.
Item - Total number of Containers:
Get ANZGEB from QALS where QALS-MBLNR (material document number) = MSEG-MBLNR=LQUA-WENUM. If total number of containers is blank, leave this field (total number of containers) and (Containers to be Sampled) blank.
Item: Containers to be Sampled
Calculated field: square root of QALS-ANZGEB (round up the value if the decimal point value is > 0.5 else round down the value) plus 1. example: if the square root value is 5.2 then the results will be 5 + 1 = 6 but if the square root value is 5.5 then the results will be 6 + 1 = 7.
regards,
siri.
‎2006 Sep 20 2:50 PM
SELECT QALS-ANZGEB into lanzgeb
FROM QALS
WHERE MBLNR = MSEG-MBLNR.
lint = sqrt( lanzgeb ).
lint = lint + 1.
<b>Lint is of type integer and hence would take of the rounding.</b>
Which part..the Rounding off.
lp2 = '3349544.88'.
lint = sqrt( lp2 ).
*answer lint = 1830.
while the correct answer would be 1830.18
Message was edited by: Anurag Bankley
‎2006 Sep 20 2:53 PM
Thanx Anurag ,
could u plz explain this a little clearly.
regards,
siri
‎2006 Sep 20 3:03 PM
Which part..the Rounding off.
lp2 = '3349544.88'.
lint = sqrt( lp2 ).
*answer lint = 1830.
while the correct answer would be 1830.18
and lets say if lp2 = '248.88'.
lint = sqrt( lp2 ).
*answer lint = 16..and the correct answer is 15.78
‎2006 Sep 20 2:55 PM
select single ANZGEB from QALS where mblnr = lqua-wenum.
l_val = sqrt( qals-anzgeb ).
l_val = round( qals-anzgeb ).
Regards,
Ravi
‎2006 Sep 20 3:00 PM
hi,
data : rslt type i.
select single ANZGEB
from QALS into qals-anzgeb
where mblnr = lqua-wenum.
<b>rslt = sqrt( qals-anzgeb ).
rslt = ciel( qals-anzgeb ).</b>
Regards,
anver
pls mark points for all hlpful answers
‎2006 Sep 20 3:02 PM
hi Ravi when i used this round(qals-anzeb) it is showing syntax error for round.
siri.
‎2006 Sep 20 3:08 PM
I'm Sorry. There is no function for round as it is.
There is an fm.
CALL FUNCTION 'ROUND'
EXPORTING
INPUT = VALUE_FLOAT
DECIMALS = 0
SIGN = ' '
IMPORTING
OUTPUT = E_VALUE
EXCEPTIONS
OVERFLOW = 01
INPUT_INVALID = 02
TYPE_INVALID = 03.
REgards,
Ravi