‎2011 Oct 20 3:46 PM
Hi Expert,
I have a serieus problem in a specifique programm. during Execution i Have a SAPSQL_ARRAY_INSERT_DUPREC exception. when i check in the ST22 i have the details below :
error source : " >>>>> insert (x_tabname) from table x_profval."
Variable values a the time of the exception : X_TABNAME refers to " EPROFVALMONTH" table.
values of xprofval_ key fields are : 000000000001066507 and 20110801 as date.
when I check tha table X_PROFVAL for entries with this Key values, i don't found records. so i can't understand how can i have a duplicated ket Insert problem if no data exist in this Table.
Thanks a lot,
Omar.
‎2011 Oct 20 4:01 PM
‎2011 Oct 20 4:35 PM
Exectly. sorry for the writing mistak. i checked EPROFVALMONTH where no records found four my key fields.
‎2011 Oct 20 11:01 PM
The dump will not only be if the key entry already exist in the database table but also if the Internal table x_profval has two rows with same key values ( "000000000001066507" and "20110801" ) at the time of Insert.
‎2011 Oct 21 12:14 AM
To analysis the issue, I will suggest to add the try catch block.
TRY .
INSERT ZTAB FROM wa.
CATCH sapsql_array_insert_duprec.
Write : wa. " You can write the key fields only,
ENDTRY.
If you are inserting from internal table, then loop it and write the key fields. So from the output you can get the particular data.
Hope this will help your analysis.
Thanks
Subha
‎2011 Oct 21 1:34 AM
Hi,
Or you can use 'ACCEPTING DUPLICATE KEYS' in front of your insert statement. It won't give you dump at least. But make sure remove all duplicate entries for your table primary key. You can do this by sorting by primary key and using DELETE ADJACENT ENTRIES.
Thanks.
Ravi