<?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: Compare two internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735497#M319865</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can try like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab3 with key matnr = itab1-matnr charg = itab1-charg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to itab2.&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;delete itab3 index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&amp;lt;now your itab3 contains which are not common in itab1&amp;gt;&lt;/P&gt;&lt;P&gt;append lines of itab3 to itab4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Dec 2006 04:02:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-21T04:02:02Z</dc:date>
    <item>
      <title>Compare two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735492#M319860</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;Iam having two internal tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab,&lt;/P&gt;&lt;P&gt;matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;maktx like makt-maktx,&lt;/P&gt;&lt;P&gt;charg like mch1-charg,&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;data: itab1 like itab occurs 0 with header line,&lt;/P&gt;&lt;P&gt;        itab2 like itab occurs 0 with header line,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of jtab,&lt;/P&gt;&lt;P&gt;matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;charg like makt-charg,&lt;/P&gt;&lt;P&gt;end of jtab.&lt;/P&gt;&lt;P&gt;data: itab3 like jtab occurs 0 with header line,&lt;/P&gt;&lt;P&gt;        itab4 like jtab occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;[ both itab1 and itab3 contains records.they can be different or same records. now i have compare both the tables with matnr and charg.For one matnr number we can have multiple charg numbers. &lt;/P&gt;&lt;P&gt;1.when compared if the record is found in itab1 and not in itab3 then we have to pull out that record into itab2.&lt;/P&gt;&lt;P&gt;2.if the record is not found in itab1 and found in itab3 then we have to pull that record into itab4&lt;/P&gt;&lt;P&gt;3. if they are same nothing to be done.]&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CAN ANY ONE POST WITH EXAMPLE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 01:20:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735492#M319860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T01:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735493#M319861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First loop at itab1 and read against itab3.  Then reverse it.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Loop at itab1.
   
   read table itab3 with key matnr = itab1-matnr
                                       charg = itab1-charg.
   if sy-subrc &amp;lt;&amp;gt; 0.
     append itab1 to itab2.
   endif.

endloop.

Loop at itab3.
   
   read table itab1 with key matnr = itab3-matnr
                                       charg = itab3-charg.
   if sy-subrc &amp;lt;&amp;gt; 0.
     append itab3 to itab4.
   endif.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 01:30:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735493#M319861</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-12-21T01:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735494#M319862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any function module which can compare two internal tables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 02:36:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735494#M319862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T02:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735495#M319863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think there are any function modules that can compare two tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note - Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 03:00:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735495#M319863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T03:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735496#M319864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi satya,  &lt;/P&gt;&lt;P&gt;sort : itab1 by matnr charg,&lt;/P&gt;&lt;P&gt;         itab3 by matnr charg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;   read table itab3 with key matnr = itab1-matnr&lt;/P&gt;&lt;P&gt;                                       charg = itab1-charg bynary search.&lt;/P&gt;&lt;P&gt;   if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;     append itab1 to itab2.&lt;/P&gt;&lt;P&gt;     clear itab2.&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;Loop at itab3.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;   read table itab1 with key matnr = itab3-matnr&lt;/P&gt;&lt;P&gt;                                       charg = itab3-charg bynary search.&lt;/P&gt;&lt;P&gt;   if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;     append itab3 to itab4.&lt;/P&gt;&lt;P&gt;     clear itab4.&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;Pls. reward points for useful answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 03:44:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735496#M319864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T03:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735497#M319865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can try like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab3 with key matnr = itab1-matnr charg = itab1-charg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to itab2.&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;delete itab3 index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&amp;lt;now your itab3 contains which are not common in itab1&amp;gt;&lt;/P&gt;&lt;P&gt;append lines of itab3 to itab4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 04:02:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735497#M319865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T04:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735498#M319866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SOLVED&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 18:14:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735498#M319866</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T18:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735499#M319867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CTVB_COMPARE_TABLES&lt;/STRONG&gt; --- function module to compare tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here u should give 2 internal tables as input and 3 as output&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Inputs:&lt;/STRONG&gt; comparing tables&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt; modifications/changes, Additions and error tables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 10:49:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-internal-tables/m-p/1735499#M319867</guid>
      <dc:creator>former_member518598</dc:creator>
      <dc:date>2011-01-18T10:49:28Z</dc:date>
    </item>
  </channel>
</rss>

