<?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 Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658988#M1867047</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Veena, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this dump comes when we are trying to insert duplicate records with same primary key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Oct 2014 09:44:10 GMT</pubDate>
    <dc:creator>former_member202771</dc:creator>
    <dc:date>2014-10-24T09:44:10Z</dc:date>
    <item>
      <title>Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658985#M1867044</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'm executing a program in background to fetch data from file and then inserts records to four Z tables. When I run this program with small files, all the records were inserted successfully. But when I try to run with larger files (almost 80mb), I'm getting runtime error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/570277" width="450" /&gt;&lt;/P&gt;&lt;P&gt;I checked in all the tables for duplicate entries, but couldn't find any duplicate keys. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have checked related scn posts also. I'm not getting why it is not working for larger files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Thank you for any help !&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Veena&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 09:26:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658985#M1867044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-24T09:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658986#M1867045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i do not think it's a matter of file size.&lt;/P&gt;&lt;P&gt;The dump is clear: insert with already existing key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can put a TRY..CATCH on insert and write on output the record that fails.&lt;/P&gt;&lt;P&gt;Or, before INSERT statemente, you can do a SELECT COUNT for the keys and, if sy-dbcnt &amp;gt;1,&lt;/P&gt;&lt;P&gt;write on output the record and skip the insert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 09:30:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658986#M1867045</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2014-10-24T09:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658987#M1867046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your quick reply.&lt;/P&gt;&lt;P&gt;When i try the same file with less number of records, it is inserting successfully. Why it is happening so ? Any idea ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 09:37:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658987#M1867046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-24T09:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658988#M1867047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Veena, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this dump comes when we are trying to insert duplicate records with same primary key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 09:44:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658988#M1867047</guid>
      <dc:creator>former_member202771</dc:creator>
      <dc:date>2014-10-24T09:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658989#M1867048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked in tables for the key. Those keys doesn't exist in my Z tables. And it is working when I try with smaller files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 09:49:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658989#M1867048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-24T09:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658990#M1867049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Veena,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is clear that, either you have duplicate records in the file which you are uploading or duplicate records already exists in the DB with same primary keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think when you upload file with lesser number of records, you would have removed the record which actually caused the problem. So the insert operation succeeds.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Try whet Simone has suggested and find out the records which causes the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 09:50:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658990#M1867049</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-24T09:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658991#M1867050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think its just by chance that it works with smaller files, goto st22 open the dump n hit long text here you'll have some program variable dumps analyze to see if u get any hints on the values or which ztable is causing the issue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 09:57:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658991#M1867050</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-24T09:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658992#M1867051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in your larger file, try sorting it by the key you are wanting after uploading it - and check entries in debugger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it could also be a bit of program logic is incorrect - for example, say the file &lt;EM&gt;is&lt;/EM&gt; correct, you may actually trying to create the record incorrectly if your logic is not assigning part of the key properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find 9 times out of 10 the problem may well be because you have a couple of 'rogue records/permutations not yet seen' - and you may find it is dropping through any logic you have and you are in fact creating a duplicate key with a blank or part blank if there is more than one part of the key!! Check this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try a test online and not in background - straight after the short dump enter the debugger and check the variables at the create point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Work through the above - I am sure you will find the problem, my bet is permutation in input file or error data lines in there not seen before and you are creating the entry with a part/whole incorrect key due to that. Probably a blank/null key and hence a duplicate will occur.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 10:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658992#M1867051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-24T10:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658993#M1867052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As i told, maybe with huge number of record, you got some duplicate record you do not recognize.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition to my previous reply, add "commit work" after the insert so you check if you get the duplicates in the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ATTENTION!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Adding Commit work for each insert will kill performances! i suggest you to use it just in development to check the file and then to implement some check logic like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;SORT tb_file BY &amp;lt;keys of tables&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOOP AT tb_file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AT NEW key&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLEAR lv_counter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDAT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADD 1 to lv_counter.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AT END OF key&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF lv_counter &amp;gt; 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; duplicate records key&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDAT:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;ENDLOOP.&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 10:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658993#M1867052</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2014-10-24T10:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658994#M1867053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As your error is related to duplicate entries, it can occur in 2 cases...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. DB has entry for the same primary key .&lt;/P&gt;&lt;P&gt;2. Internal table which is used for insertion might have duplicate entries...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using internal table for inserting entries into table (single insert statement with internal table), you can solve this in any of 2 ways..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Use Sort the records in the internal table by the key fields of the table. Then, use "&lt;SPAN class="L0S52"&gt;DELETE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;ADJACENT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;DUPLICATES &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;FROM &amp;lt;itab&amp;gt; COMPARARING &amp;lt;key fields list&amp;gt;" for deleting the duplicate entries ....This will be helpful if DB table does not have existing entries for the same keys in the internal table..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;2. use MODIFY statement for updating the database table instead of using INSERT statement. This will keep to have duplicate entries in the internal table. But the last duplicate key result will be updated in the DB table..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 10:38:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658994#M1867053</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-24T10:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Program dumps for larger files - SAPSQL_ARRAY_INSERT_DUPREC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658995#M1867054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem solved.&lt;/P&gt;&lt;P&gt;Issue was with the internal table which had multiple entries with same key.&lt;/P&gt;&lt;P&gt;Thanks to all. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 11:13:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-dumps-for-larger-files-sapsql-array-insert-duprec/m-p/10658995#M1867054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-24T11:13:41Z</dc:date>
    </item>
  </channel>
</rss>

