05-31-2007 3:11 PM
Hi all,
here is what I'm looking for: On my selection screen I have a parameter of a round-up factor. With this factor I need to round a quantity. If for example I have a quantity of 2.26 and my factor is 25% it should go to 2.5.
Can anyone help how to do this?
Thanx!
05-31-2007 5:31 PM
what exactly do u men by 25% as round faactor.....can explain indetail
05-31-2007 5:31 PM
what exactly do u men by 25% as round faactor.....can explain indetail
05-31-2007 5:37 PM
to round the quantity to the closest 25%. So like my example 0.2662 would be 0.5 and 0.657 would be 0.75.
05-31-2007 6:00 PM
take an integer type and move the original value into a dummy variable say dummy of the original variable type.
data a, b type i.
dummy = 2.26
b = dummy - 0.5. " b = 2
a = ( dummy - b ) * 100. " a = 26
now u have write if else block to see whether 'A' is in between 0-25, 25-50, 50-75, 75-100.
if a bt 0 and 25.
a = 25.
elseif a bt 25 and 50.
a = 50.
...
....
endif.
dummy = b + ( a / 100 ).
copy back dummy to its original value.
05-31-2007 5:38 PM
05-31-2007 5:41 PM
06-18-2008 5:23 AM
qty = '2.55'.
tmp = qty mod 1.
qty = qty DIV 1.
if tmp > '0.50'
qty = qty+1.
endif.
Edited by: Priyanka Chowdry on Jun 18, 2008 6:23 AM