‎2008 May 12 11:07 AM
Hi friends,
I have a problem,
i have define box_no type i,
I_tab-BOX_NO = QUAN / 125000.
while dividing for eg:
300000/125000 = 2.4
but it display 2 .
if it is above .5 it display to
a approx value but if it is
below .5 it does not display
how can i display tthe values
2.4 to appox 3.
‎2008 May 12 11:12 AM
‎2008 May 12 11:12 AM
‎2008 May 12 11:18 AM
data: zp TYPE p DECIMALS 2, zint TYPE i.
zp = frac( 300000 / 125000 ).
zint = 300000 / 125000 .
IF zp is NOT INITIAL.
zint = zint + 1.
ENDIF.
WRITE zint.
u can also do as follows:
data zp type p decimals 0.
zp = ceil( 300000 / 125000 ).
replace da numbers wid ur variables..
plz reward points if dis helps
‎2008 May 12 11:20 AM
hi
it is like this becoz u have defined it integer ok
iif u want the output as u specified use
floor or seil key word
Cheers
Snehi Chouhan
‎2008 May 12 11:22 AM
data : wsp1 type p DECIMALS 2,
wsp type I.
clear : wsp, wsp1.
WSP = I_tab-BOX_NO.
wsp1 = WSP - I_tab-BOX_NO.
if wsp1 < 0.
wsp = wsp + 1.
ENDIF.
I_tab-BOX_NO = wsp.
‎2008 May 12 11:25 AM