‎2012 Jul 31 10:34 AM
I'm working on a report with table join VBRP & VBRK where main table is VBRP.
My goal to build a report to check Sales Order Item Qty compare with that SO/Item's billed Qty.
I can get billed qty from VBRP-FKLMG and also that Sales order's item qty available in VBRP-LMENG field.
Now the problem is, VBRP-FKLMG as increasing more than single line because of multiple billing, VBRP-LMENG also duplicates for what my report getting incorrect.
Now what can I do for not to repeat the Sales Order Item line Qty in VBRP-LMENG.
Please advice. Many thanks in advance.
‎2012 Aug 01 9:42 PM
I'm assuming you're talking about SQ01 query. This is, unfortunately, kind of a problem with the queries. If you link two tables via JOIN and there is "1 to many" relatonship, then it would cause duplicates and it's not possible to total correctly.
If you just need to get the quantity, instead of joining the tables create a custom field (Extras button), say BILLED_QTY and add your own code (SELECT ... ). You can use SUM with SELECT to get the total quantity, but please be cognizant of different billing types (e.g. proformas F8 should not be counted) and cancelled invoices.
This solution is not good for performance but, unfortunately, sometimes there is no other way. If this does not work or is performing too poorly then a custom ABAP report would be needed.