<?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 Error: SAPSQL_ARRAY_INSERT_DUPREC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-sapsql-array-insert-duprec/m-p/7026789#M1498751</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all, &lt;/P&gt;&lt;P&gt;I try to test a little program that I use for my training in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My target is to copy all content of table USR02 into another table (ZUSR02 yet created into ABAP Dictionary with transaction SE11, and with the same schema of USR02 table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code that I try to execute is the follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZTEST.

TABLES: USR02,ZUSR02.

DATA all_users LIKE USR02 OCCURS 1000 WITH HEADER LINE.

DELETE FROM ZUSR02 client specified.

SELECT * FROM USR02  client specified  INTO TABLE all_users .

insert ZUSR02 from table all_users.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I try to execute, I obtain this DUMP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Runtime Errors         SAPSQL_ARRAY_INSERT_DUPREC&lt;/P&gt;&lt;P&gt;Except.                CX_SY_OPEN_SQL_DB&lt;/P&gt;&lt;P&gt;Date and Time          06.06.2010 22:41:31&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Short text&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; What happened?&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 "!PROVA" had to be terminated because 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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Error analysis&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;      and&lt;/P&gt;&lt;P&gt;     therefore caused a runtime error.&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 06 Jun 2010 20:42:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-06-06T20:42:05Z</dc:date>
    <item>
      <title>Error: SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-sapsql-array-insert-duprec/m-p/7026789#M1498751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all, &lt;/P&gt;&lt;P&gt;I try to test a little program that I use for my training in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My target is to copy all content of table USR02 into another table (ZUSR02 yet created into ABAP Dictionary with transaction SE11, and with the same schema of USR02 table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code that I try to execute is the follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZTEST.

TABLES: USR02,ZUSR02.

DATA all_users LIKE USR02 OCCURS 1000 WITH HEADER LINE.

DELETE FROM ZUSR02 client specified.

SELECT * FROM USR02  client specified  INTO TABLE all_users .

insert ZUSR02 from table all_users.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I try to execute, I obtain this DUMP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Runtime Errors         SAPSQL_ARRAY_INSERT_DUPREC&lt;/P&gt;&lt;P&gt;Except.                CX_SY_OPEN_SQL_DB&lt;/P&gt;&lt;P&gt;Date and Time          06.06.2010 22:41:31&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Short text&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; What happened?&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 "!PROVA" had to be terminated because 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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Error analysis&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;      and&lt;/P&gt;&lt;P&gt;     therefore caused a runtime error.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Jun 2010 20:42:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-sapsql-array-insert-duprec/m-p/7026789#M1498751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-06T20:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error: SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-sapsql-array-insert-duprec/m-p/7026790#M1498752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all, this isn't a training forum for ABAP. You should get some books and do some training.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, you should check sy-subrc after each database operation so that you know if you want to continue or do something else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Jun 2010 21:11:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-sapsql-array-insert-duprec/m-p/7026790#M1498752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-06T21:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error: SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-sapsql-array-insert-duprec/m-p/7026791#M1498753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;closed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Nov 2010 14:56:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-sapsql-array-insert-duprec/m-p/7026791#M1498753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-20T14:56:02Z</dc:date>
    </item>
  </channel>
</rss>

