<?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 Find the difference between two internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731646#M1110496</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how can i see the difference between two interal tables?&lt;/P&gt;&lt;P&gt;The requirement is as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. We have a transparent table, which stores the employee data with EMP ID as key.&lt;/P&gt;&lt;P&gt;2. We load the transp table data into a interal table (B). &lt;/P&gt;&lt;P&gt;3. We get data from legecy system as file and it gets loaded into another internal table (A) (this also has the same EMP ID key and this will have latest addition/update to those emplyees).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now we need to seperate out these data into three interal table Inserted (I), Deleted (D) and Updated (U).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want to do followign things&lt;/P&gt;&lt;P&gt;I = A - B&lt;/P&gt;&lt;P&gt;D = B - A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both A and B will have around 40k records. Hence we are trying to avoid the looping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest the best option for us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;Raghavendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Nov 2008 06:19:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-14T06:19:41Z</dc:date>
    <item>
      <title>Find the difference between two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731646#M1110496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how can i see the difference between two interal tables?&lt;/P&gt;&lt;P&gt;The requirement is as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. We have a transparent table, which stores the employee data with EMP ID as key.&lt;/P&gt;&lt;P&gt;2. We load the transp table data into a interal table (B). &lt;/P&gt;&lt;P&gt;3. We get data from legecy system as file and it gets loaded into another internal table (A) (this also has the same EMP ID key and this will have latest addition/update to those emplyees).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now we need to seperate out these data into three interal table Inserted (I), Deleted (D) and Updated (U).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want to do followign things&lt;/P&gt;&lt;P&gt;I = A - B&lt;/P&gt;&lt;P&gt;D = B - A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both A and B will have around 40k records. Hence we are trying to avoid the looping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest the best option for us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;Raghavendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 06:19:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731646#M1110496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T06:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Find the difference between two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731647#M1110497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; how can i see the difference between two interal tables?&lt;/P&gt;&lt;P&gt;&amp;gt; The requirement is as follows&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; 1. We have a transparent table, which stores the employee data with EMP ID as key.&lt;/P&gt;&lt;P&gt;&amp;gt; 2. We load the transp table data into a interal table (B). &lt;/P&gt;&lt;P&gt;&amp;gt; 3. We get data from legecy system as file and it gets loaded into another internal table (A) (this also has the same EMP ID key and this will have latest addition/update to those emplyees).&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Now we need to seperate out these data into three interal table Inserted (I), Deleted (D) and Updated (U).&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; We want to do followign things&lt;/P&gt;&lt;P&gt;&amp;gt; I = A - B&lt;/P&gt;&lt;P&gt;&amp;gt; D = B - A&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Both A and B will have around 40k records. Hence we are trying to avoid the looping.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Please suggest the best option for us.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;gt; Raghavendra&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Raghavendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Currently as of my knowledge, these operations are only possible through LOOPs. But LOOPign can be really fast here if you properly utilize the SORTING, READ with BINARY SEARCH and FIELD-SYMBOLS usage. I would say:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Steps for Insert&lt;/U&gt;:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT: A, B.&lt;/P&gt;&lt;P&gt;LOOP AT A ASSIGNING &amp;lt;WA_A&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE B WITH TABLE KEY key = &amp;lt;WA_A&amp;gt;-key BINARY SEARCH.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;    APPEND &amp;lt;WA_A&amp;gt; TO I.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Steps for Delete&lt;/U&gt;:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT: A, B.&lt;/P&gt;&lt;P&gt;LOOP AT B ASSIGNING &amp;lt;WA_B&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE A WITH TABLE KEY key = &amp;lt;WA_B&amp;gt;-key BINARY SEARCH.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;    APPEND &amp;lt;WA_B&amp;gt; TO D.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 06:30:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731647#M1110497</guid>
      <dc:creator>raviprakash</dc:creator>
      <dc:date>2008-11-14T06:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Find the difference between two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731648#M1110498</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;If you want to seperate out these data into three interal tables then you must use LOOP. In this situation you can use hash tables for big internal tables for better performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you only need to update the database it's sometimes the best and fastest to delete it first and then to insert the new data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 07:48:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731648#M1110498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T07:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find the difference between two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731649#M1110499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;looping is not a bad option and u have to loop it only once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at internal table A.&lt;/P&gt;&lt;P&gt;Read B with records of A.&lt;/P&gt;&lt;P&gt;If sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;Store it in internal table i_delete.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;Store it in internal table i_insert.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Neha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 07:59:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731649#M1110499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T07:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Find the difference between two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731650#M1110500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks everyone for your quick response.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 08:34:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-the-difference-between-two-internal-table/m-p/4731650#M1110500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T08:34:07Z</dc:date>
    </item>
  </channel>
</rss>

