<?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 Internal Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199839#M762626</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have an Internal table which is reading the data from different sources and inserting the data into the database table locally. I ma doing this through INSERT command but if any entry already exists in the database table this command raising a short Dump "Insert Duplicate".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me the easiest way to check the data or to solve this problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Dec 2007 04:51:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-17T04:51:15Z</dc:date>
    <item>
      <title>Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199839#M762626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have an Internal table which is reading the data from different sources and inserting the data into the database table locally. I ma doing this through INSERT command but if any entry already exists in the database table this command raising a short Dump "Insert Duplicate".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me the easiest way to check the data or to solve this problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2007 04:51:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199839#M762626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-17T04:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199840#M762627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is because the primary key duplicate...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the issues can be solved by checking whether the table contains the entries before insertion....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ex:folow this steps:&lt;/P&gt;&lt;P&gt;check whether the entry exists in table.&lt;/P&gt;&lt;P&gt;if not exits:&lt;/P&gt;&lt;P&gt;insert&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;endif...&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;/P&gt;&lt;P&gt;insert into table.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;rollback work.&lt;/P&gt;&lt;P&gt;if u nedd print a error message here....&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;commitwork.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any way its better to check whether a entry exists in table before insertion&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2007 04:57:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199840#M762627</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2007-12-17T04:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199841#M762628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;correct code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because the primary key duplicate...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the issues can be solved by checking whether the table contains the entries before insertion....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ex:follow this steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert into table&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;rollback work.&lt;/P&gt;&lt;P&gt;if u nedd print a error message here....&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any way its better to check whether the same entry exists in table before and the steps above&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2007 05:03:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199841#M762628</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2007-12-17T05:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199842#M762629</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;You can use &lt;STRONG&gt;UPDATE dbtab or MODIFY dbtab commands&lt;/STRONG&gt; &lt;STRONG&gt;instead of Insert command&lt;/STRONG&gt; as insert command can insert a wrong value into the database table (it is going to just insert a record which you specify). So, go for either UPDATE or MODIFY commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify command and Update commands will make changes in already existing record.If it could not find that perticular record, it just inserts it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2007 05:04:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199842#M762629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-17T05:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199843#M762630</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;i think the way is checking sy-subrc ..if that dont work before inserting the rescord do a select query if the sy-subrc ne 0 then u can insert...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from table..&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if sy-subrc ne 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;   &lt;STRONG&gt;insert into table.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endif&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2007 05:05:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199843#M762630</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-17T05:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199844#M762631</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 occured due to duplicate insertion of primary key. Check whether record already exist or not in the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Select * from dbtb where  key =  itab-key.&lt;/P&gt;&lt;P&gt;   If sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;     Insert  internal table data.&lt;/P&gt;&lt;P&gt;    if sy-subrc =0.&lt;/P&gt;&lt;P&gt;     commit work.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise you can check for the sy-subrc value after insertion.&lt;/P&gt;&lt;P&gt;INSERT  .....into dbtable&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  Message&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt; COMMIT WORK.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2007 05:05:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199844#M762631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-17T05:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199845#M762632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Moni,&lt;/P&gt;&lt;P&gt;            Before inserting ITAB into table check duplicate entries in iternal table and INSERT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT &amp;lt;flds&amp;gt; FROM &amp;lt;table&amp;gt; where field=&amp;lt;itab-fld&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 4.&lt;/P&gt;&lt;P&gt; INSERT &amp;lt;into ur table&amp;gt;&lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2007 05:19:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3199845#M762632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-17T05:19:29Z</dc:date>
    </item>
  </channel>
</rss>

