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 Programming Error ITAB_DUPLICATE_KEY SAPLEINS

Former Member
0 Likes
1,833

Hi all,

When i try to post an invoice in MIRO, i get a abap run time error, and it happens only for a particular PO and for other PO's the Credit memo is getting posted without any issue.

Category               ABAP Programming Error
Runtime Errors         ITAB_DUPLICATE_KEY
ABAP Program           SAPLEINS
Application Component  MM-PUR
Date and Time          25.11.2013 09:20:48

Short text
     There is already a line with the same key.

What happened?
     Error in the ABAP Application Program

     The current ABAP program "SAPLEINS" had to be terminated because it has
     come across a statement that unfortunately cannot be executed.

What can you do?
     Note down which actions and inputs caused the error.


     To process the problem further, contact you SAP system
     administrator.

     Using Transaction ST22 for ABAP Dump Analysis, you can look
     at and manage termination messages, and you can also
     keep them for a long time.

Error analysis
     You tried to insert an entry into table
      "\FUNCTION-POOL=EINS\FORM=XEKCPO_CUT_LIS\DATA=AUX_XEKCPO". However, upd
     the unique table key "PRIMARY_KEY" resulted in a duplicate entry. The key
      concerned may be either the primary key or a secondary key.

     The key components of the duplicate entry have the values
      "{2;100;4508541234;00100}"
     " " " " " ".

      With primary keys, the system may terminate while processing

     block insert operations.



What can be done to solve this issue?

2 REPLIES 2
Read only

Former Member
0 Likes
1,253

Hi Hari,

The runtime error occurs at some INSERT statement because an attempt is being made to insert an entry that matches the primary key portion of another existing entry. To avoid this runtime error, the addition - ACCEPTING DUPLICATE KEYS of the INSERT statement may be used. Even if this addition is used, the duplicate record will NOT be inserted into the table. But it will avoid the runtime error.

But then the question is - how will this change be made if you are using a standard BAPI for this...That needs to be figured out.

Read only

1,253

Did you find the solution for this? Does anyone know? I am facing the same issue now.