Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SQ02 - Duplicates in JOIN VBAK - VBAP

Former Member
0 Likes
1,177

Hi everybody,

I have to produce a query which outputs header data from VBAK .

As a further column I also need for each document the sum of the taxes (VBAP-MWSBP).

But if I put VBAP in the JOIN definition of SQ02 I get as many records as positions.. which is not correct.

Is thare any way I can solve it?

Thanks,Christian

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,008

Look at <a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf">SAP Query (BC-SRV-QUE)</a>

1 - keep your query and create a display variant with a level of summarization

2 - remove the table join, and define VBAP as a structure, managing yourself the selection and grouping of data in a small abap routine.

Regards

Hi everybody,

I have to produce a query which outputs header data from VBAK .

As a further column I also need for each document the sum of the taxes (VBAP-MWSBP).

But if I put VBAP in the JOIN definition of SQ02 I get as many records as positions.. which is not correct.

Is thare any way I can solve it?

Thanks,Christian

5 REPLIES 5
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,009

Look at <a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf">SAP Query (BC-SRV-QUE)</a>

1 - keep your query and create a display variant with a level of summarization

2 - remove the table join, and define VBAP as a structure, managing yourself the selection and grouping of data in a small abap routine.

Regards

Read only

0 Likes
1,008

Thank you,

I'll try and let you know (and reward you eventually..)

Read only

0 Likes
1,008

Solved!

Read only

0 Likes
1,008

Hi Christian,

I know this post is going back many years....but how did you resolve this issue?

I am new to SAP queries and very limited knowledge of ABAP code

Thanks

Read only

0 Likes
1,008

Raymond's response if excellent, IMHO, but in this case, you may want to obtain the aid of an ABAP guy to get and summarize VBAP for you...since the relationship of VBAK to VBAP is typically one to many, a join would resut  in a row of VBAK for every VBAP row....