<?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/2691730#M622710</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  K K,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think we can not compare the internal table if their structure is diffrent but i think we can compare the internal table fields whic is common in  both the internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If IT_tab-field = IT_tab1-field.&lt;/P&gt;&lt;P&gt;business logic.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if helpfull reward points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anees Ahmed&lt;/P&gt;&lt;P&gt;9886358645&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Aug 2007 05:40:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-18T05:40:14Z</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/2691728#M622708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to compare two internal tables?Can we do even if they have different structure but some similar data?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Kiran K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Aug 2007 05:26:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/2691728#M622708</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2007-08-18T05:26:10Z</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/2691729#M622709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If they have the same structure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF it_1[] = it_2[].
   " Tables contents are the same
ELSE.
   " Tables contents are different
ENDIF. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If they have different structure, you probably must loop one of the tables, and inside read the other, then compare field by field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if you don't need the contents (just comparing) you can do this, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT it_1 INTO wa_1.
   READ TABLE it_2 WITH KEY field2 = wa_1-field2
                            field5 = wa_1-field5
                   TRANSPORTING NO FIELDS.
   IF sy-subrc = 0.
      " Record is on both tables (field2 and field5 are the fields in common for both tables).
   ENDIF.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Aug 2007 05:37:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/2691729#M622709</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2007-08-18T05:37: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/2691730#M622710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  K K,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think we can not compare the internal table if their structure is diffrent but i think we can compare the internal table fields whic is common in  both the internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If IT_tab-field = IT_tab1-field.&lt;/P&gt;&lt;P&gt;business logic.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if helpfull reward points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anees Ahmed&lt;/P&gt;&lt;P&gt;9886358645&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Aug 2007 05:40:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables/m-p/2691730#M622710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-18T05:40:14Z</dc:date>
    </item>
  </channel>
</rss>

