<?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: comparing two internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336295#M1033016</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;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1 into wa_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab2 into wa_itab2 with key f1 = wa_itab1-f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt; carry out ur requirement&amp;gt;&lt;/P&gt;&lt;P&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sharin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Aug 2008 09:34:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-22T09:34:18Z</dc:date>
    <item>
      <title>comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336289#M1033010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to compare two internal tables based on specific fields?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2008 09:06:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336289#M1033010</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-22T09:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336290#M1033011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="412941"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/comparing%2btwo%2binternal%2btables%2b-%2ba%2bgeneric%2bapproach" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/comparing%2btwo%2binternal%2btables%2b-%2ba%2bgeneric%2bapproach&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2008 09:11:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336290#M1033011</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-22T09:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336291#M1033012</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;Check out these links...&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;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2008 09:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336291#M1033012</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-22T09:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336292#M1033013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Mathew Parera  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chk this sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Entries: 100 (ITAB1), 1000 (ITAB2)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Line width: 100&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Both tables sorted by key K&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1 INTO WA1.&lt;/P&gt;&lt;P&gt;  LOOP AT ITAB2 INTO WA2&lt;/P&gt;&lt;P&gt;                WHERE K = WA1-K.&lt;/P&gt;&lt;P&gt;    " ...&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Entries: 1000 (ITAB1), 300 (ITAB2)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Line width: 100&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Both tables sorted by unique key K ascending&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1 INTO WA1.&lt;/P&gt;&lt;P&gt;  READ TABLE ITAB2 INTO WA2&lt;/P&gt;&lt;P&gt;             WITH KEY K = WA1-K BINARY SEARCH.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    " ...&lt;/P&gt;&lt;P&gt;  ENDIF.&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;regards&lt;/P&gt;&lt;P&gt;Deva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2008 09:16:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336292#M1033013</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-22T09:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336293#M1033014</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;plz try this way :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort : itab1 by num,&lt;/P&gt;&lt;P&gt;itab2 by num.&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;read table itab2 with key num = itab1-num binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;flag = 'X'.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx,&lt;/P&gt;&lt;P&gt;dhanashri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2008 09:18:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336293#M1033014</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-22T09:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336294#M1033015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try it this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab1 into wa1.

  describe table itab2 lines w_line.
  
 do w_line times.

   read table itab2 into wa2 index counter.

   if wa2-field = wa1-field.
   .........
   endif.
  counter = counter + 1.  
 enddo.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2008 09:25:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336294#M1033015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-22T09:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336295#M1033016</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;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1 into wa_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab2 into wa_itab2 with key f1 = wa_itab1-f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt; carry out ur requirement&amp;gt;&lt;/P&gt;&lt;P&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sharin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2008 09:34:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336295#M1033016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-22T09:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: comparing two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336296#M1033017</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;check out this code. i am giving the raw idea to compare internal table field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of gs_vbak,&lt;/P&gt;&lt;P&gt;        vbeln TYPE vbak-vbeln,&lt;/P&gt;&lt;P&gt;        erdat TYPE vbak-erdat,&lt;/P&gt;&lt;P&gt;         end of gs_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_vbak type standard table of gs_vbak,&lt;/P&gt;&lt;P&gt;      wa_vbak type gs_vbak.&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;types: begin of gs_vbap,&lt;/P&gt;&lt;P&gt;       VBELN type vbap-VBELN,  "sales order&lt;/P&gt;&lt;P&gt;       MATNR type vbap-MATNR,  "material no&lt;/P&gt;&lt;P&gt;       ARKTX type vbap-ARKTX,  "material description&lt;/P&gt;&lt;P&gt;       end of gs_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_vbap type standard table of gs_vbap,&lt;/P&gt;&lt;P&gt;      wa_vbap type gs_vbap.&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;select-options:  s_vbeln for vbak-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbeln&lt;/P&gt;&lt;P&gt;       erdat&lt;/P&gt;&lt;P&gt;       kunnr&lt;/P&gt;&lt;P&gt;       ernam  from vbak into table it_vbak where vbeln in s_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select VBELN&lt;/P&gt;&lt;P&gt;       MATNR&lt;/P&gt;&lt;P&gt;       ARKTX&lt;/P&gt;&lt;P&gt;       from vbap into table it_vbap up to 20 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbak into wa_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  read table it_vbap into wa_vbap INDEX sy-index.&lt;/P&gt;&lt;P&gt;   if wa_vbak-vbeln = wa_vbap-vbeln.&lt;/P&gt;&lt;P&gt;     write: 'vbeln for both table are equal'.&lt;/P&gt;&lt;P&gt;   elseif wa_vbak-vbeln GT wa_vbap-vbeln. &lt;/P&gt;&lt;P&gt;      write: -&lt;/P&gt;&lt;HR originaltext="-----------------------" /&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;      write: -&lt;/P&gt;&lt;HR originaltext="--------------------" /&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>Fri, 22 Aug 2008 09:35:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/4336296#M1033017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-22T09:35:02Z</dc:date>
    </item>
  </channel>
</rss>

