07-24-2020 6:21 PM
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.
07-24-2020 6:40 PM
deepa22_,
Instead of trying out this logic through field catalog, why don't you try to achieve the logic through program. Any specific reason?
07-24-2020 9:18 PM
07-25-2020 1:31 PM
07-25-2020 1:33 PM
07-25-2020 5:06 PM
Deepa Priya I think that Satish Kumar Balasubramanian just tells you to do the sum in ABAP custom code (total = total + quantity) instead of telling ALV to do the sum by itself.
07-27-2020 2:13 AM
Maybe i dont have SD background so i dont get why you want to sum like that. if you have 1 SO with multiple deliveries, isnt it true that total quantity of each delivery must be equal to target quantity of SO? you may solve it by sum using abap code instead of ALV standard function (i think ALV cant do it), but still might be the logic you use to determine quantity of delivery is not correct.
07-28-2020 3:15 PM
can any one please help me in this logic,
please refer my screenshot attached.
remaining target qty = target qty - quantity ==> for so line item 10 - 1st line,
for the next line, if the so line item is same then it should do, remaining target qty = remaining target qty - quantity, for the next it is repeating.. How i could achieve this in coding..please help.
07-29-2020 7:53 PM
Try changing the sort and group from Contract - SO - QTY to SO - Contracy - QTY.