Skip to Content
0

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

Apr 12, 2017 at 07:44 PM

225

avatar image

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

Hello,

How I can change tag?

Thank you for your time.

0

There is a tiny button Actions right underneath the question title, it has an option to edit the question:

image4.jpg (13.1 kB)
0
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Vibhor Kulshrestha 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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

VBFA is also at the line item level, it won't help OP in any way, sorry.

0
Daniel F. Apr 14, 2017 at 07:04 PM
0

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?

Show 2 Share
10 |10000 characters needed characters left characters exceeded

when you use the VBFA also restrict your selection by VBFA-VBTYP_N

it should be 'R' for delivery

and 'J' for invoice

please take into account the VBFA-POSNN - it is your item number

as already mentioned below, use the correct tool to build your report, drop the query way and drive the ABAP

0

Please also use "Comment on this answer" when replying to an answer. Otherwise the person you're replying to will not get notified and it's confusing to the readers as well.

Thank you.

0
Daniel F. May 03, 2017 at 02:26 PM
0

Hi,

any suggestions at my question?

Share
10 |10000 characters needed characters left characters exceeded
G Lakshmipathi
May 25, 2017 at 04:05 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Daniel F. May 25, 2017 at 07:41 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Jelena Perfiljeva
Dec 11, 2017 at 03:58 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded