FM to round Quantity
Hi I need a FM to round quantity to the highest 10's.
for eg if I have 11, it should make it to 20.
if i have 27, it should make it to 30.
Matthew Billingham replied
No FM required.
divide by 10, use CEIL, multiply by 10.
data: value1 type i value 11, value2 type p DECIMALS 1. value2 = CEIL( value1 / 10 ). value1 = value2 * 10. write: / value1.
or if you want to do it in one go, with an integer
DATA: value1 TYPE i VALUE 11. value1 = ( ( value1 + 4 ) / 10 ) * 10. WRITE: / value1.