What to do if a SAP BI Runtime error ‘SAPSQL_ARRAY_INSERT_DUPREC’ occured?
When i got this error?
This popped up when dataload failed while loading from a DSO to an Infocube.
Various other reasons due to which this error occurs
Data load from datasource to an Infocube/ DSO.
Data load from DSO to IC and lookup of values from an another Infoobject.
While looping through an internal table and simultaneously looking up in another Infoproviders.
Loading data from the PSA into the cube using DTP.
Main reason this error shows is due to the lookups used in the routines. Main area to check in the routines are the select statement codes.
What is this error?
The SQL statement generated from the SAP Open SQL statement violates a restriction imposed by
The underlying database system of the ABAP system.
The maximum size of an SQL statement was exceeded.
The statement contains too many input variables.
The input data requires more space than is available.
What triggered it ?
Below are the various factors which makes this error to be triggered
- An SQL exception occurred
- An Open SQL exception occurred
- An exception occurred when accessing the database
- An error occurred when converting a database field to the target field
- The range of the statement to be passed to the database is too wide
- The maximum length of a STRING or RAWSTRING field was exceeded
- The system tried to insert a data record, even though a data record with the same primary key already exists
- A primary key was not completely specified
- The database cursor is invalid
- The database returned a value containing an error
- There are no more records in the database
- There are no records in the database matching these selection criteria
- There are no more resources available for creating another database connection
How to solve this?
From the BI perspective a check had to be made in the routines if any of the codes come under the “What triggered it?” section.
Another way is to implement OSS Notes. Around 65 OSS notes are found for this run-time exception.
The below ones were used in my project
SAP NOTE 1606565 – Deadlock:DBIF_RSQL_SQL_ERROR on table trfcqout or arfcsstate
SAP NOTE 22115 – SAPSQL_ARRAY_INSERT_DUPREC in prg.SAPLBSVU.
SAP NOTE : 873596 xception CX_SY_OPEN_SQL_DB occurs due to too many single values at selection.
Other OSS notes are : 805880 , 721808 , 745324 , 649259
Will this be repeated?
After implemention OSS notes, the runtime error would be solved.
Well rest of this run time error will not come, unless the routines used for look up are working against the topic section ‘What triggered it?’.