Sum of fields in Internal Table
I have an internal table which has fields Matnr, Plant and Valuation Class and Stock.
I need to find sum of stock for a combination of Material and Plant.
Please let me know how can i implement it.
Matnr Werks Val Class Stock
1 W1 V1 200
1 W1 V2 300
2 W2 V3 500
2 W2 V1 700
I should get the sum of Matnr '1' and Werks 'W1' combination as as 200 + 300 = 500