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 Program Giving SAPSQL_ARRAY_INSERT_DUPREC Dump While Inserting Entries

Former Member
0 Likes
1,795

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
Read only

Former Member
0 Likes
1,589

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.

Read only

0 Likes
1,589

The table is Empty

Read only

0 Likes
1,589

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

Rob

Read only

0 Likes
1,589

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.

Read only

0 Likes
1,589

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

Read only

0 Likes
1,589

Ensure that Type ID is part of the primary key.

Rob

Read only

0 Likes
1,589

Yes It is.

Read only

0 Likes
1,589

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

Rob

Read only

0 Likes
1,589

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

Read only

0 Likes
1,589

Sorry - meant two bytes.

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

Rob

Read only

0 Likes
1,589

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

Read only

0 Likes
1,589

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

Read only

0 Likes
1,589

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.

Read only

0 Likes
1,589

Ok

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

Max

Read only

Former Member
0 Likes
1,589

Solved By Myself

priyesh Shah