<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Runtime Errors  SAPSQL_ARRAY_INSERT_DUPREC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586608#M1435157</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the below exception daily in ST22. Please suggest any resolution &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Runtime Errors         SAPSQL_ARRAY_INSERT_DUPREC&lt;/P&gt;&lt;P&gt;Exception              CX_SY_OPEN_SQL_DB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Short text&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    The ABAP/4 Open SQL array insert results in duplicate database records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What happened?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    Error in the ABAP Application Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    The current ABAP program "SAPLCRM_ORDERADM_H_DU" had to be terminated because&lt;/P&gt;&lt;P&gt;     it has&lt;/P&gt;&lt;P&gt;    come across a statement that unfortunately cannot be executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error analysis&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    An exception occurred that is explained in detail below.&lt;/P&gt;&lt;P&gt;    The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught&lt;/P&gt;&lt;P&gt;     in&lt;/P&gt;&lt;P&gt;    procedure "CRM_ORDERADM_H_UPDATE_DU" "(FUNCTION)", nor was it propagated by a&lt;/P&gt;&lt;P&gt;     RAISING clause.&lt;/P&gt;&lt;P&gt;    Since the caller of the procedure could not have anticipated that the&lt;/P&gt;&lt;P&gt;    exception would occur, the current program is terminated.&lt;/P&gt;&lt;P&gt;    The reason for the exception is:&lt;/P&gt;&lt;P&gt;    If you use an ABAP/4 Open SQL array insert to insert a record in&lt;/P&gt;&lt;P&gt;    the database and that record already exists with the same key,&lt;/P&gt;&lt;P&gt;    this results in a termination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    (With an ABAP/4 Open SQL single record insert in the same error&lt;/P&gt;&lt;P&gt;    situation, processing does not terminate, but SY-SUBRC is set to 4.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit nanda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Feb 2010 09:59:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-17T09:59:21Z</dc:date>
    <item>
      <title>Runtime Errors  SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586608#M1435157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the below exception daily in ST22. Please suggest any resolution &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Runtime Errors         SAPSQL_ARRAY_INSERT_DUPREC&lt;/P&gt;&lt;P&gt;Exception              CX_SY_OPEN_SQL_DB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Short text&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    The ABAP/4 Open SQL array insert results in duplicate database records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What happened?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    Error in the ABAP Application Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    The current ABAP program "SAPLCRM_ORDERADM_H_DU" had to be terminated because&lt;/P&gt;&lt;P&gt;     it has&lt;/P&gt;&lt;P&gt;    come across a statement that unfortunately cannot be executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error analysis&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    An exception occurred that is explained in detail below.&lt;/P&gt;&lt;P&gt;    The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught&lt;/P&gt;&lt;P&gt;     in&lt;/P&gt;&lt;P&gt;    procedure "CRM_ORDERADM_H_UPDATE_DU" "(FUNCTION)", nor was it propagated by a&lt;/P&gt;&lt;P&gt;     RAISING clause.&lt;/P&gt;&lt;P&gt;    Since the caller of the procedure could not have anticipated that the&lt;/P&gt;&lt;P&gt;    exception would occur, the current program is terminated.&lt;/P&gt;&lt;P&gt;    The reason for the exception is:&lt;/P&gt;&lt;P&gt;    If you use an ABAP/4 Open SQL array insert to insert a record in&lt;/P&gt;&lt;P&gt;    the database and that record already exists with the same key,&lt;/P&gt;&lt;P&gt;    this results in a termination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    (With an ABAP/4 Open SQL single record insert in the same error&lt;/P&gt;&lt;P&gt;    situation, processing does not terminate, but SY-SUBRC is set to 4.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit nanda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2010 09:59:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586608#M1435157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-17T09:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Errors  SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586609#M1435158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Problem is that you are trying to insert a record which is already present in the database table with the same combination of primary keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg,&lt;/P&gt;&lt;P&gt;in table Z_TAB in database&lt;/P&gt;&lt;P&gt;Primary keys are : A &lt;/P&gt;&lt;P&gt;                              B&lt;/P&gt;&lt;P&gt;                              C &lt;/P&gt;&lt;P&gt;and there is a record in the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;      &lt;STRONG&gt;B&lt;/STRONG&gt;      &lt;STRONG&gt;C&lt;/STRONG&gt;      D       E&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you try to insert the record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;      &lt;STRONG&gt;B&lt;/STRONG&gt;     &lt;STRONG&gt;C&lt;/STRONG&gt;      F     G&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then as the primary keys are matching, according to the database rule it is not allowed to insert 2 records with same primary key combination and the program dumps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2010 10:22:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586609#M1435158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-17T10:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Errors  SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586610#M1435159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your program logic entry of fields repeated through sql statement .....you can come over to this exception through by check in condition by which you are inserting the data.....OR Simply catch the  given exception between the Try ...Endtry. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2010 11:25:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586610#M1435159</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-17T11:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Errors  SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586611#M1435160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are getting this dump becuase program is trying to update the entry in database table but the entry with same primary key is already exist in database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To avoid this dump you shold follow the below procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Sort your internal table &lt;/P&gt;&lt;P&gt;2. Now delete all the duplicate entries from this table by comparing key fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2010 12:15:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586611#M1435160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-17T12:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Errors  SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586612#M1435161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are trying to insert duplicate records which might be present in DB either while updating itselt you must be having duplicate records..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check primary keys..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please check...if second case then use Delete adjacent duplicates...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2010 12:58:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-errors-sapsql-array-insert-duprec/m-p/6586612#M1435161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-17T12:58:10Z</dc:date>
    </item>
  </channel>
</rss>

