Skip to Content

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

Internal table using At Statment

Dear All

i have one internal table . In that table materialcode, qty,movementtype fields are available. i want to get sum of the qty based on materialcode and movermenttype.

internaltable

materialcode movementtype qty

1039-2006-mat 101 25

1039-2006-mat 101 25

1039-2006-mat 102 25

1039-2006-mat 102 25

1039-2006-mat 231 25

1039-2006-mat 231 25

cutpcs 101 25

cutpcs 102 25

i want output following

materialcode movementtype qty

1039-2006-mat 101 50

1039-2006-mat 102 50

1039-2006-mat 231 50

cutpcs 101 25

cutpcs 102 25

This is not ALV Report

Thanks and Regards

Suresh

Tags:
Former Member
Former Member replied

suppose you have the data in itab then declare one int tbale itab1 like itab.

loop at itab.

read table itab1 with key matnr = itab-matnr bwart = itab-bwart.

if sy-subrc = 0.

itab1-menge = itab-menge + itab1-menge.

modify itab1 index sy-tabix.

else.

append itab to itab1.

endif.

clear : itab,itab1.

endloop.

loop at itab1.

write : / itab1-matnr,itab1-bwart,itab1-menge.

endloop.

regards

shiba dutta

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