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

ADDR_SAVE_INTERN duplicate key error short dump

0 Likes
8,656

Hi all,

I am trying to insert a record into the ADRC table through FM ADDR_SAVE_INTERN. First, I am pulling the next available ADRNR number through GET_NEXT_ADRNR. That is working fine and pulling back the next available number. However, when I insert via ADDR_SAVE_INTERN (adrc_i) I am getting a short dump with error DBSQL_DUPLICATE_KEY_ERROR. I have checked the ADRC table and the ADRNR number I am passing does not exist so I dont know why it is complaining about a duplicate?

Below is full error:

Category ABAP programming error

Runtime Errors DBSQL_DUPLICATE_KEY_ERROR

Except. CX_SY_OPEN_SQL_DB

ABAP Program SAPLSZA0

Application Component BC-SRV-ADR

Short Text Open SQL array insert produces duplicate records in the database. What happened? Error in the ABAP application program. The current ABAP program "SAPLSZA0" had to be terminated because it found a statement that could not be executed.

What can I do? Note which actions and entries caused the error to occur. Consult your SAP administrator. Using transaction ST22 for ABAP dump analysis, you can view, manage, and retain termination messages for longer periods. 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 An exception has occurred which is explained in more detail below. The exception is assigned to class 'CX_SY_OPEN_SQL_DB' and was not caught in procedure "ADDR_SAVE_INTERN" "(FUNCTION)", nor was it propagated by a RAISING clause. Since the caller of the procedure could not have anticipated this exception, the current program was terminated. The reason for the exception is: When an Open SQL array insert is performed, trying to insert a record into the database table "ADRC_UUID_INDEX" causes the function to terminate if a record with the same key already exists. (When an Open SQL individual record insert is performed, this situation does not cause the function to terminate. SY-SUBRC is set to 4 instead.)

Hi all,

I am trying to insert a record into the ADRC table through FM ADDR_SAVE_INTERN. First, I am pulling the next available ADRNR number through GET_NEXT_ADRNR. That is working fine and pulling back the next available number. However, when I insert via ADDR_SAVE_INTERN (adrc_i) I am getting a short dump with error DBSQL_DUPLICATE_KEY_ERROR. I have checked the ADRC table and the ADRNR number I am passing does not exist so I dont know why it is complaining about a duplicate?

Below is full error:

Category ABAP programming error

Runtime Errors DBSQL_DUPLICATE_KEY_ERROR

Except. CX_SY_OPEN_SQL_DB

ABAP Program SAPLSZA0

Application Component BC-SRV-ADR

Short Text Open SQL array insert produces duplicate records in the database. What happened? Error in the ABAP application program. The current ABAP program "SAPLSZA0" had to be terminated because it found a statement that could not be executed.

What can I do? Note which actions and entries caused the error to occur. Consult your SAP administrator. Using transaction ST22 for ABAP dump analysis, you can view, manage, and retain termination messages for longer periods. 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 An exception has occurred which is explained in more detail below. The exception is assigned to class 'CX_SY_OPEN_SQL_DB' and was not caught in procedure "ADDR_SAVE_INTERN" "(FUNCTION)", nor was it propagated by a RAISING clause. Since the caller of the procedure could not have anticipated this exception, the current program was terminated. The reason for the exception is: When an Open SQL array insert is performed, trying to insert a record into the database table "ADRC_UUID_INDEX" causes the function to terminate if a record with the same key already exists. (When an Open SQL individual record insert is performed, this situation does not cause the function to terminate. SY-SUBRC is set to 4 instead.)

5 REPLIES 5
Read only

0 Likes
5,534

I should also note even though it short dumps, the entry still inserts into the ADRC table.

Read only

lutzi3
Active Participant
5,534

I have one question and one remark:

Do you use the address "stand alone" or in the context of a business object for instance customer or Business partner ? In this case there might be Bapi's covering the functionality in a more comfortable way.

The modules you use are SAP internal function modules. So I could be that there are other calls necessary beside ADDR_SAVE_INTERN to build up the internal data model before saveing the address,

Read only

0 Likes
5,534

We use it as a business partner - but only need to insert the address into ADRC table. Entries working for other tables such as LFA1, LFB1, etc.

Which BAPI would you recommend? I basically have my record in an itab that I need to insert into the ADRC table. This will be one record at a time.

I was just confused on why I was getting the duplicate key error when the ADDRNUMBER (a primary key) is certainly not in the table and is unique.

Read only

0 Likes
5,534

And even though I get the short dump, the entry still inserts.

Read only

DoanManhQuynh
Active Contributor
0 Likes
5,534

you may try notes 1600487.

or, i dont think it could be reason, but could you try submit after call fm.