Application Development 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 statement with duplicate key fields

Former Member
0 Kudos

Hello,

I have an internal table(EKBE) with 8 fields

ebeln ebelp vgabe gjahr belnr budat wrbtr refkey

populating the first 7 fields from EKBE table with VGABE = 2 and PO#, concatenating the WRBTR and GJAHR to get the Refkey and passing this to the 8th field.

Using this refkey, getting the document numbers from BKPF.

I am looping another internal table into a work area and reading the above internal table by passing the ebeln field and I am doing some calculations ,etc.

A custom table is getting updated from the above work area.

The issue is-

The internal table EKBE can have the same PO numbers with the same line item numbers but with different ref key's.

So, when I am reading the int. tab, it is reading only one record, since I have no other key's to read except EBELN. So for one PO# it is reading only 1 ref key, I cannot use the line item# as a key, as the line item#'s never match, even if they match they could be same PO# with same line item# and different ref key.

Any inputs highly appreciated.

Regards,

Kiran

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Loop on EKBE Internal table as well to fetch all entries of PO. Use Parallel cursor to optmize performance.

http://wiki.sdn.sap.com/wiki/display/Snippets/ABAPCodeforParallelCursor-Loop+Processing

2 REPLIES 2

Former Member
0 Kudos

Loop on EKBE Internal table as well to fetch all entries of PO. Use Parallel cursor to optmize performance.

http://wiki.sdn.sap.com/wiki/display/Snippets/ABAPCodeforParallelCursor-Loop+Processing

0 Kudos

Use Parallel cursor to optmize performance.

Use sorted tables to help performance.

Rob