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: 

ABAP Program Giving SAPSQL_ARRAY_INSERT_DUPREC Dump While Inserting Entries

former_member184155
Participant
0 Kudos

Hi Experts,

I had z table in which i had made three fields as primary key combination , i also had a custom program in which i am inserting values into the z table using Insert statement. during the execution of the program it is going for a short dump giving "SAPSQL_ARRAY_INSERT_DUPREC" With Exception CX_SY_OPEN_SQL_DB.

The Delivery Class of the Table is "C".

The thing is that i want if 1st field is "ORG ID" second Field is "Material" & the third field is "Type Id". then the system should allow entries like

-


ORG ID

Material Id

Type Id

-


|"0001" | "100'' | "R1" |

-


"0001"

"100''

"R2"

-


|"0001" | "100'' | "R3" |

-


"0001"

"100''

"R4"

-


Is there any OSS note for Corrections.

Thanks & regards

Priyesh Shah.

15 REPLIES 15

Former Member
0 Kudos

Did u check if the table already has the entries that you are trying to insert? You cannot insert a new row with the same key.

0 Kudos

The table is Empty

0 Kudos

Then the internal table that you are using to do the inserts has duplicate entries.

Rob

0 Kudos

Did you check the internal table in your program at the time of insert? Maybe the internal table has multiple entries with the same primary key.

0 Kudos

Hi All,

The internal Table that i am using is having the same entries that i had given in the example only the Type Id field is different else

Org Id & Material Id Fields are same .

Also i would like to Correct Every body here that the Table has a key field combination made up of these three fields.

Edited by: priyeshosi on Oct 27, 2011 9:58 PM

0 Kudos

Ensure that Type ID is part of the primary key.

Rob

0 Kudos

Yes It is.

0 Kudos

Ensure that Type id is character and at least three characters. And make sure the domain does not have a conversion exit.

Rob

0 Kudos

Not Using any Coversion Exit or Routines & Type Id is only 2 Character Long field

Edited by: priyeshosi on Oct 27, 2011 10:12 PM

0 Kudos

Sorry - meant two bytes.

Well, the error messatge is self explanatory. You are trying to insert duplicates.

Rob

0 Kudos

Guys i had already checked the internal Table doesnot have any duplicate entries.

0 Kudos

Hi

Are you sure your table has those 3 fields as key fields?

I means you make sure the fields: ORG ID, Material Id, Type Id are key fields.

If you are sure the internal table has not duplicated records and your z-table is empty: It can only suppose some field is not a key.

If you have made some modification, try to check the database defination of your z-table is equal to dictionary defination

Max

0 Kudos

Hi All,

Thanks for all of your Quick Update, really Appreciate that.

I had looped the internal Table into a work area with an insert statement inside it.

problem solved.

0 Kudos

Ok

That's a solution in order to avoid the dump, but probably some insert will fail

Max

former_member184155
Participant
0 Kudos

Solved By Myself

priyesh Shah