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

Abap query and duplicate rows

Former Member
0 Likes
651

Hi,

I'm creating a query using tables VBAK and VBKD.

When I execute the query, system displays duplicate rows.

Is there a code I can put in the infoset so that will be displayed only one row for each sales order ?

My situation is the following:

2035000 ZSOR FOB

2035000 ZSOR FOB

The first columns is related to a sales order, the second is the document type and last one is the incoterms. I also have furthers data in my report

and I have to use the above tables.

Thanks

Best regards

Hi,

I'm creating a query using tables VBAK and VBKD.

When I execute the query, system displays duplicate rows.

Is there a code I can put in the infoset so that will be displayed only one row for each sales order ?

My situation is the following:

2035000 ZSOR FOB

2035000 ZSOR FOB

The first columns is related to a sales order, the second is the document type and last one is the incoterms. I also have furthers data in my report

and I have to use the above tables.

Thanks

Best regards

2 REPLIES 2
Read only

madhu_vadlamani
Active Contributor
0 Likes
520

Hi,

I do not how you written code and key fields in in it.Go through this http://scn.sap.com/thread/2116717.If there is any issue post.

Regards,

Madhu.

Read only

Former Member
0 Likes
520

If you look at VBKD, you will see a 2nd key field - POSNR.  Therefore, it would appear that there can be more than one entry for a document in VBKD, but only only row per document in VBAK, would you agree?  Add something that does 'where POSNR = 0' to the data selection for VBKD, since in SD, posnr = 0 refers to the header portion of the document.  If you do that, however, you will fail to report item level rows ( = VBAP table) that have a different INCO1, 2 than what is stored at the header or document level.