Skip to Content
Jul 24, 2020 at 05:21 PM

ALV - Summing the Quantity field problem.


I have got an requirement to create an contract related sales order report in ALV.

In which i want to sum the quantity order(KWMENG- from SO) for each line item of contract and subtract it from

target quantity(ZMENG - contract). i am facing problem in summing the quantity order. I have given do sum in field catalog.

if each sales order has single delivery there is no issues in summing the quantity, but if each sales order has multiple delivery, then the quantity is displaying as many as delivery. for example. if contract (20000004) has 4 line items , and 4th line item has the target quantity is 70 and but sales order's quantity as per deliveries, 3072000014- 40th line item-2 times the quantity is printed 20.00 but only one 20.00 should be calculated,3072000013, has single delivery so no prbm,3072000012 has three deliveries so 20.00 is three times it should be calculated only one times, so summing is issue here ...

balanced quantity = target quantity - (sum of quantity orders)

BQ = 70 -(20+30+20) = 0.. This should be the case.

but BQ = 70 - ( 20+20+30+20+20+20) . This is happening..

Please refer my screenshot.contract-sales-report.png

How i can overcome it.. please help, its urgent..Thanks in advance.