Hi Daniel
You are querying item level tables so if you don't want multiple line you might want to limit it by selecting only first item number on LIPS.
Why don't you use VBFA table to get this data?
Thanks
Vibhor.
Hi Vibhor,
thank you for the suggestion.
You suggested to use VBFA table instead of LIPS. If I set VBAP.VBELN (sale document) = VBFA.VBELV (preceding doc), I still have multiple records because of the items. Could you please tell me the correct link of the two tables?
Did you try VBAK and LIKP ? If you want to have Billing reference also, then, add VBRK. In fact, the easy method is Table Join in SQVI
Unfortunately the sales order number is not in LIKP. The sales order number is in LIPS (field VGBEL=Reference doc).
First of all, the document flow is always at the line level, so it simply will not be accurate to present the information the way you're asking. Even if it is how, de facto, process works in your system there is nothing preventing anyone from creating multiple references.
That aside, in a query obviously you can't just JOIN line item tables and then expect to see the result at the header level. To achieve what you are asking you'd need to start with the header level table (e.g. VBAK) and then add entries using ABAP code in Extras. But it'd be much more efficient to do this in an ABAP report.
Add comment