How to resolve error sapsql_array_insert_duprec
BY SAPPOSTS · PUBLISHED FEBRUARY 1, 2017 · UPDATED FEBRUARY 2, 2017
How to resolve error sapsql_array_insert_duprec
In this post I would like to share as how to resolve the error sapsql_array_insert_duprec in SAP systems. I hope many of us seen the error “sapsql_array_insert_duprec” atleast once while working in the SAP systems. Here I would like to summarize all the possible solutions for the error sapsql_array_insert_duprec.
IMPORTANT: The error may occur in various situations, kindly look at the ST22 dump for more information about the terminated program, function module, tables, reports, and transactions, based on the information please refer below for possible solution.
SAPSQL_ARRAY_INSERT_DUPREC in saving settlement rule
Integration model generation Error SAPSQL_ARRAY_INSERT_DUPREC
SAPSQL_ARRAY_INSERT_DUPREC while posting Ad Valorem Valuation document
SAPSQL_ARRAY_INSERT_DUPREC in the SAP_NOTIFADMIN_SYNC_DLS job
sapsql_array_insert_duprec while storing or saving the documents
SAPSQL_ARRAY_INSERT_DUPREC (Program SAPLCLVF) when saving a document
SAPSQL_ARRAY_INSERT_DUPREC while creating purchase order in ME21, ME59n
SAPSQL_ARRAY_INSERT_DUPREC or DBSQL_DUPLICATE_KEY_ERROR dump in transaction SU01
SAPSQL_ARRAY_INSERT_DUPREC in CAT2 or CATS_APPR_LITE
SAPSQL_ARRAY_INSERT_DUPREC dump in PPM tables during CIF integration
ME41: SAPSQL_ARRAY_INSERT_DUPREC dump when creating RFQ
SAPSQL_ARRAY_INSERT_DUPREC (GL_RECID changed) while posting documents
SAPSQL_ARRAY_INSERT_DUPREC for NEW_INSERT_GLPCA
You may face the update termination SAPSQL_ARRAY_INSERT_DUPREC in program SAPLGIV1 (or SAPLGIV2, SAPLGIV3, SAPLGIVA as well) in Form NEW_INSERT_GLPCA When you post to the profit center line item table GLPCA using Transactions FB01, MR01, MB01 etc..
Reason and Prerequisites
The situation occurs generally always if number range objects and transaction data no longer match. The number range object thus delivers a number, which has already been used in the transaction data. The reasons for this are mostly of a technical nature, and cannot be found in the application. Possible causes are described in the related Note 62150.
In Profit Center Accounting, three number range objects exist, which are used for the actual data update.
- GL_RECID: this is a consecutive number for the unambiguous identification of a GLPCA record (GLPCA-GL_SIRID)
- COPCA_OBJ: delivers the document number (GLPCA-DOCNR) for documents which are copied from other applications (FI/CO/MM/SD)
- GL_LOCAL: delivers the document number (GLPCA-DOCNR) for documents which are created in Profit Center Accounting itself (PCA allocations, manual postings)
Note the following:
GL_RECID and GL_LOCAL are jointly used by special purpose ledgers (FI-SL) and Profit Center Accounting. In particular GL_RECID, thus should be modified manually only if object number inconsistencies or update terminations occur.
Solution
Transfer the attached report (in SAP Note 209141) from the advance corrections with the name ZPCA_CHECK_NUMBER_RANGE_OBJECT (Releases later than 4.0) or ZPCACNRO respectively (Releases earlier than 4.0) into your system.
Maintain the following selection texts:
COPCA_OB COPCA_OBJ
GL_LOCAL GL_LOCAL
GL_RECID GL_RECID
RBUKRS Company code
RYEAR Fiscal year
Maintain the following text symbols:
010 No data
020 Object
030 GLPCA
040 Number range
050 Status
060 Messages
100 GLPCA contains no data
110 Error: NUMBER_GET_NEXT ! SY-SUBRC:
If you start the report now, the maximum entry is selected in table GLPCA (column GLPCA) for every number range object selected by you and compared with the next number from the number range object (column Number range). If the GLPCA entry is larger than the number range entry, you should raise the corresponding counter.
With a double-click on the respective line, you get directly to the maintenance of the number range object and can change there the counter reading. The new counter reading should be at least larger by 10 than the entry in the GLPCA column.
If you have to start the report due to the long runtime in the background, the direct navigation to the number range objects is not available to you. In this case, maintain the counter readings via Transaction SNUM.
If you have problems with the through-posting into PCA, you should start this report for the objects GL_SIRID and COPCA_OBJ. The analysis of GL_LOCAL is only necessary if you have problems with direct PCA postings (allocations, manual postings).
Kindly check the below notes as well.
62150 SAPSQL_ARRAY_INSERT_DUPREC in FI-SL table (line item)
491265 KB31N: SAPSQL_ARRAY_INSERT_DUPREC with table GLPCA
490147 SAPSQL_ARRAY_INSERT_DUPREC for online postings
485868 ALLOCATION: DUPREC error for plan assessment/distribution
395496 SAPSQL_ARRAY_INSERT_DUPREC with GLPCA
1156279 EC-PCA/FI-SL: SAPSQL_ARRAY_INSERT_DUPREC INS_GLPCA