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

SAPSQL_ARRAY_INSERT_DUPREC Exception

Former Member
0 Likes
553

hi all

can anybody help me to get details regarding the exception

SAPSQL_ARRAY_INSERT_DUPREC exception

CX_SY_OPEN_SQL_DB.

the termination occured in abap program.............

hw i can rectify it????

rewards will be given for useful answers

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
530

You are trying to insert data into a database table for an entry that already exists. Before insert, make sure record is not yet in database table. If already existant, do an update of the record.

4 REPLIES 4
Read only

Sm1tje
Active Contributor
0 Likes
531

You are trying to insert data into a database table for an entry that already exists. Before insert, make sure record is not yet in database table. If already existant, do an update of the record.

Read only

Former Member
0 Likes
530

it is a standard sap program.i cant change it,

is there any solution?

Read only

Former Member
0 Likes
530

Hi there,

The reason for the exception is:

If you use an ABAP/4 Open SQL array insert to insert a record in

the database and that record already exists with the same key,

this results in a termination.

(With an ABAP/4 Open SQL single record insert in the same error

situation, processing does not terminate, but SY-SUBRC is set to 4.)

How to correct the error

Use an ABAP/4 Open SQL array insert only if you are sure that none of

the records passed already exists in the database.

You may able to find an interim solution to the problem

in the SAP note system. If you have access to the note system yourself,

I request you to take it on high priority basis as this is an daily load and because of the red request next request will not be activated.

I think this is due to duplicate entry but i have checked the data their is no duplicacy. In that request we have only 7 request and all are in Active table.

Do reward if helpful or get back if need further assistance.

Read only

Former Member
0 Likes
530

Hi,

This is due to primary key violation....U r trying to insert records which are already available in DB table..so best practice is to use MODIFY statement instead of INSERT.

MODIFY will insert records if not present in table and it will modify the record if present already

Regards,

Hari