‎2009 Jun 25 7:01 AM
Dear Friends,
While executing T.code F.50, I am getting the following Error
Runtime Errors SAPSQL_ARRAY_INSERT_DUPREC
Exceptn CX_SY_OPEN_SQL_DB
Date and Time 25.06.2009 11:27:31
ShrtText
The ABAP/4 Open SQL array insert results in duplicate database records.
What happened?
Error in ABAP application program.
The current ABAP program "SAPLF049" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Error analysis
An exception occurred. This exception is dealt with in more detail below
. The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', was
neither
caught nor passed along using a RAISING clause, in the procedure
"SICHERN_IN_DB" "(FORM)"
.
Since the caller of the procedure could not have expected this exception
to occur, the running program was terminated.
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.)
Program SAPLF049
Include LF049F00
Row 74
Module type (FORM)
Module Name SICHERN_IN_DB
gger Location of Exception
Program SAPLF049
Include LF049F00
Row 86
Module type (FORM)
Module Name SICHERN_IN_DB
rce Code Extract
e SourceCde
56 * Insert von RF048 aus CRF048 (bei Commit Work) *
57 *----
*
58 FORM RELATION_SAVE.
59
60 CHECK NOT CRF048[] IS INITIAL.
61 INSERT RF048 FROM TABLE CRF048.
62 REFRESH CRF048.
63
64 ENDFORM. "RELATION_SAVE
65
66
67
68 *eject
69 *----
*
70 * Form SICHERN_IN_DB *
71 *----
*
72 * Masseninsert/update aus Z-Tabellen *
73 *----
*
74 FORM SICHERN_IN_DB.
75
76 * Lokale Daten
77 DATA:
78 ld_xnetb TYPE xnetb,
79 anz_belnr TYPE i.
80
81 *------ Aufteilungstabellen -
*
82
83 * Einfügen *
84
85 * BFIT_A0
>>> INSERT BFIT_A0 FROM TABLE ZBFIT_A0.
87 IF SY-SUBRC <> 0.
88 MESSAGE A153.
89 ENDIF.
90
91 * BFIT_A
92 INSERT BFIT_A FROM TABLE ZBFIT_A.
93 IF SY-SUBRC <> 0.
94 MESSAGE A154.
95 ENDIF.
96
97 * BFOD_A
98 INSERT BFOD_A FROM TABLE ZBFOD_A.
99 IF SY-SUBRC <> 0.
100 MESSAGE A155.
101 ENDIF.
102
103 * BFOD_AB
104 INSERT BFOD_AB FROM TABLE ZBFOD_AB.
105 IF SY-SUBRC <> 0.
How to reslove the error? Please advise.
Thanks and Regards
Sridhar
‎2009 Jun 25 7:08 AM
Hi,
Well it looks quite difficult to understand.......The only thing it says clearly that this is happening because of duplicate Primary Key insertion.
‎2009 Jul 27 8:46 AM