‎2010 Feb 20 7:50 AM
Dear all,
I am getting error "SAPSQL_ARRAY_INSERT_DUPREC" "CX_SY_OPEN_SQL_DB" for Transaction MD01 in procedure "INSERT_MDSBI_IN_MDSB" "(FORM)".
I have checked the same. But, eventhough the record with same key is not exists in the database table, system gives this error.
Can anyone pls help me on this?
Thanks a lot in advance.
‎2010 Feb 20 7:53 AM
Hi,
Try it this way:-
TRY.
INSERT <DB_TABLE> FROM TABLE <INTERNAL_TABLE>.
IF sy-subrc <> 0.
MESSAGE e001(zmm).
ENDIF.
CATCH cx_sy_open_sql_db.
MESSAGE e001(zmm).
ENDCASE.
ENDTRY.
Hope this helps you.
Regards,
Tarun
‎2010 Feb 20 7:56 AM
‎2010 Feb 20 7:59 AM
‎2010 Feb 20 8:06 AM
‎2010 Feb 20 8:07 AM
Statement which gives error is
INSERT MDSB
FROM TABLE MDSBI.
‎2010 Feb 20 8:11 AM
Hi,
It seems like the error is due to duplicate primary key. Can you please double check if an entry already exists in RESB for the key in MDSBI? Put a break point at that stmt and check it out.
Regards,
Ganga
‎2010 Feb 20 8:39 AM
Yes, I have checked the same. But, there is no entry with same key in RESB; still it gives error.
‎2010 Feb 20 8:46 AM
Check if MDSBI internal table contains multiple entries with same primary key.
‎2010 Feb 20 8:51 AM
Hi,
There is an OSS note "138108". Please check. Symptom is
Symptom
Material requirements planning, master production scheduling: Termination with "SAPSQL_ARRAY_INSERT_DUPREC" in program SAPLM61U, Include LM61UF20, FORM routine INSERT_MDSBI_IN_MDSB.
Long-term planning: Termination with "SAPSQL_ARRAY_INSERT_DUPREC" in program SAPLM61U, Include LM61UF20, FORM routine INSERT_MDSMI_IN_MDSM.
Hope this helps you!!!
Regards,
Ganga
‎2010 Feb 20 1:08 PM
‎2010 Feb 20 1:17 PM
This is applicable till 4.6C. As per your problem, it seems like this is not corrected in ECC6.0. May be team from SAP can help us.
Ganga
‎2010 Feb 20 4:40 PM
i guess you can statement as : "Insert dbtab from itab accepting duplicate keys" ....
use it one and check i think it should work fine
regards,
Shravanthi
‎2010 Feb 20 4:42 PM
‎2011 Jan 06 3:31 PM
The problema is "...when array inserts to view MDSB failed with SAPSQL_ARRAY_INSERT_DUPREC. The underlying table RESB had a number of fields on the database NOT NULL but without default. Some of these fields were missing in the projection view MDSB so each insert via this view resulted in a SQL515 erroneously displayed as duplicate key error...
Solution
Now this new dbsl will correct only the misleading error message. The inserts will still fail.
If you encounter such a problem you should run a forced conversion via SE14 (SE14, edit table, Extras->Forced Conversion). This will recreate the table and all the NOT NULL columns will be defined with a default bound. So the SQL515 won't occur anymore.
Please be aware: if the table is huge then the conversion will take a longer time.
Reference Note 1340371