Skip to Content

How to list only one record with sales order/deliver and /invoice number?

I created the infoset with VBAP and LIPS. They are joined using VBAP.VBEL and LIPS.VGBEL. Since I have multiple items for each sales order, my query shows the same line multiple times.See below an example:

I would like to show only one line per SO, for instance

100392380101340blank

1003928801013410091001205

100392980101342blank

And so on.

The invoice number is not a table defined in the query but is an extra field with this code.

Is there a way in the infoset to do this and obtain only one line?

Thank you in advance.

1tuiq.jpeg (31.8 kB)
ncuhd.jpeg (12.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Apr 13, 2017 at 03:37 PM
    -1

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 14, 2017 at 07:04 PM

    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?

    Add comment
    10|10000 characters needed characters exceeded

  • May 03, 2017 at 02:26 PM

    Hi,

    any suggestions at my question?

    Add comment
    10|10000 characters needed characters exceeded

  • May 25, 2017 at 04:05 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • May 25, 2017 at 07:41 PM

    Unfortunately the sales order number is not in LIKP. The sales order number is in LIPS (field VGBEL=Reference doc).

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 11, 2017 at 03:58 PM

    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
    10|10000 characters needed characters exceeded