<?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 Modify DB table from internal table or work area in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834185#M1884214</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two ways to updata a DB table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option1:&lt;/P&gt;&lt;P&gt;LOOP gt_01 INTO gs_01.&lt;/P&gt;&lt;P&gt;&amp;nbsp; gs_02-xxx = gs_01-xxx.&lt;/P&gt;&lt;P&gt;&amp;nbsp; gs_02-yyy = gs_01-yyy.&lt;/P&gt;&lt;P&gt;&amp;nbsp; APPEND gs_02 TO gt_02.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE DB FROM TABLE gt_02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option2:&lt;/P&gt;&lt;P&gt;LOOP gt_01 INTO gs_01.&lt;/P&gt;&lt;P&gt;&amp;nbsp; gs_02-xxx = gs_01-xxx.&lt;/P&gt;&lt;P&gt;&amp;nbsp; gs_02-yyy = gs_01-yyy.&lt;/P&gt;&lt;P&gt;&amp;nbsp; UPDATE DB FROM&amp;nbsp; gs_02.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I prefer Option2, but it needs an extra internal table and in my real problem, this table could be very large.&lt;/P&gt;&lt;P&gt;So does it matter if I write UPDATE in the LOOP(Option2), would it cause some DB related performance issues?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2015 15:43:50 GMT</pubDate>
    <dc:creator>raffinkira</dc:creator>
    <dc:date>2015-01-14T15:43:50Z</dc:date>
    <item>
      <title>Modify DB table from internal table or work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834185#M1884214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two ways to updata a DB table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option1:&lt;/P&gt;&lt;P&gt;LOOP gt_01 INTO gs_01.&lt;/P&gt;&lt;P&gt;&amp;nbsp; gs_02-xxx = gs_01-xxx.&lt;/P&gt;&lt;P&gt;&amp;nbsp; gs_02-yyy = gs_01-yyy.&lt;/P&gt;&lt;P&gt;&amp;nbsp; APPEND gs_02 TO gt_02.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE DB FROM TABLE gt_02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option2:&lt;/P&gt;&lt;P&gt;LOOP gt_01 INTO gs_01.&lt;/P&gt;&lt;P&gt;&amp;nbsp; gs_02-xxx = gs_01-xxx.&lt;/P&gt;&lt;P&gt;&amp;nbsp; gs_02-yyy = gs_01-yyy.&lt;/P&gt;&lt;P&gt;&amp;nbsp; UPDATE DB FROM&amp;nbsp; gs_02.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I prefer Option2, but it needs an extra internal table and in my real problem, this table could be very large.&lt;/P&gt;&lt;P&gt;So does it matter if I write UPDATE in the LOOP(Option2), would it cause some DB related performance issues?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 15:43:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834185#M1884214</guid>
      <dc:creator>raffinkira</dc:creator>
      <dc:date>2015-01-14T15:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Modify DB table from internal table or work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834186#M1884215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ming,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think first option is better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;internal table is appended then in one go database table will be updated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 15:50:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834186#M1884215</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-14T15:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Modify DB table from internal table or work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834187#M1884216</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;did you have read the Tips &amp;amp; Tricks from the trans. SE30 ? &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;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 15:54:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834187#M1884216</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2015-01-14T15:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Modify DB table from internal table or work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834188#M1884217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the array to update database shouldl give better performance, you should generate less communication between application server and database server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In case of error with an internal table you can get some difficulty to identify which record(s) generated the error.&lt;/LI&gt;&lt;LI&gt;The internal table may require too many memory, case where you worked with a subset of database fields, but require the whole set fo fields to update the table.&lt;/LI&gt;&lt;LI&gt;Sometimes it is better to build some batch of records to update, to prevent a bottleneck in communication between servers if you actually have a huge volumn of data to update or not enough memory.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 16:02:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834188#M1884217</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2015-01-14T16:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Modify DB table from internal table or work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834189#M1884218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes is better option the First, and why you dont use Field-Symbols?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 22:44:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834189#M1884218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-14T22:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Modify DB table from internal table or work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834190#M1884219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, your reply helps.&lt;/P&gt;&lt;P&gt;And as far as I tried, if you insert from an internal table, you will get a dump if the internal table contains some duplicate-key records with the DB table.&lt;/P&gt;&lt;P&gt;However, you won't get a dump if you insert from a work area even if the key of the work area has been already existing in the DB table, you just get a sy-subrc 4 instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 00:55:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834190#M1884219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-15T00:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Modify DB table from internal table or work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834191#M1884220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the real problem, the logic of gs_01 and gs_02 is not that simple.&lt;/P&gt;&lt;P&gt;Besides, the point is not field-symbol but comparing modifying from internal table or work area.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 00:58:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834191#M1884220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-15T00:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Modify DB table from internal table or work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834192#M1884221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;STRONG&gt;insert ztable&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;SPAN class="L0S52"&gt;from &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;table &lt;/SPAN&gt;itab accepting duplicate keys.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will not display error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it Helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 02:54:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834192#M1884221</guid>
      <dc:creator>VenkatRamesh_V</dc:creator>
      <dc:date>2015-01-15T02:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Modify DB table from internal table or work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834193#M1884222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know in which case we should insert duplicate key record, it breaks the rule of the database.&lt;/P&gt;&lt;P&gt;And I think that you can use MODIFY instead of INSERT to avoid dump.(Maybe yet the result we need)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 03:45:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-db-table-from-internal-table-or-work-area/m-p/10834193#M1884222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-15T03:45:00Z</dc:date>
    </item>
  </channel>
</rss>

