Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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.

Any FM.

Ster.

Tags:
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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question