Skip to Content
0
Former Member
Sep 09, 2008 at 11:51 PM

Compare 2 rows of an internal table

648 Views

Hello,

I have a requirement where I have to compare the rows of an internal table (table containing poduction order no., material no, required quantity and used quantity) and get a count of the required quantity and used quantity for the same materials belonging to one production order.

For E.g.:

Prod Ord Material Req. Qty Used Qty

123 A 1 1

133 A 2 0

123 B 1 1

123 A 3 3

The quantities of Rows 1 and 4 need to be summed up. (as they correspond to the same material used within the same production order).

Please let me know if there is a method to do this.

I tried using SUM within AT END OF...ENDAT, but it does not do the summation, maybe because these quantity fields have the data type as QUAN.

Helpful suggestions will be greatly appreciated.

Thanks,

Rugmani