<?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: question about comparing 2 internal tables... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222988#M137029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just make  one  more internal table it_ekpo1&lt;/P&gt;&lt;P&gt; of   same type it_ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort it_mseg2.&lt;/P&gt;&lt;P&gt;LOOP AT it_ekpo.&lt;/P&gt;&lt;P&gt;READ TABLE it_mseg2 binary search WITH KEY ebeln = it_ekpo-ebeln.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;it_ekpo1 = it_ekpo.&lt;/P&gt;&lt;P&gt;append it_ekpo1.&lt;/P&gt;&lt;P&gt;clear it_ekpo1.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Apr 2006 07:43:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-11T07:43:31Z</dc:date>
    <item>
      <title>question about comparing 2 internal tables...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222983#M137024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 internal tables, it_ekpo and it_mseg2. now, what I want to do is delete records from itab it_ekpo that doesn't exist in itab it_mseg2. Bewlo is the code that I made. Please let me know if it's wrong or if it can be done in a better way. Thank you guys and take care!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_ekpo.&lt;/P&gt;&lt;P&gt;          READ TABLE it_mseg2 WITH KEY ebeln = it_ekpo-ebeln.&lt;/P&gt;&lt;P&gt;          IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;            DELETE it_ekpo.&lt;/P&gt;&lt;P&gt;            CLEAR it_ekpo.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2006 07:37:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222983#M137024</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-04-11T07:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: question about comparing 2 internal tables...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222984#M137025</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;Try like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_ekpo.&lt;/P&gt;&lt;P&gt;READ TABLE it_mseg2 WITH KEY ebeln = it_ekpo-ebeln.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;DELETE it_ekpo.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;continue.&amp;lt;/b&amp;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;Regards,&lt;/P&gt;&lt;P&gt;Naimesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points, if it is useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2006 07:39:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222984#M137025</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2006-04-11T07:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: question about comparing 2 internal tables...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222985#M137026</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;I think what you have done is right. Just a small change.&lt;/P&gt;&lt;P&gt;DELETE it_ekpo index sy-tabix.&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;&lt;/P&gt;&lt;P&gt;Note : Please mark the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2006 07:41:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222985#M137026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-11T07:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: question about comparing 2 internal tables...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222986#M137027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi viray,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think it would be better if u wud write as&lt;/P&gt;&lt;P&gt;DELETE it_ekpo index sy-tabix.&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;DELETE it_ekpo where ebeln = it_ekpo-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps,&lt;/P&gt;&lt;P&gt;priya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2006 07:41:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222986#M137027</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-11T07:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: question about comparing 2 internal tables...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222987#M137028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should use Binary Search to speed up the read statement. Also if we are trying to remove the amount of lines of code being executed then you should use: -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_ekpo.&lt;/P&gt;&lt;P&gt;  READ TABLE it_mseg2 WITH KEY ebeln = it_ekpo-ebeln&lt;/P&gt;&lt;P&gt;    BINARY SEARCH&lt;/P&gt;&lt;P&gt;  CHECK sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  DELETE it_ekpo.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure the table it_mseg2 is sorted to enable the binary search to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2006 07:42:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222987#M137028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-11T07:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: question about comparing 2 internal tables...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222988#M137029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just make  one  more internal table it_ekpo1&lt;/P&gt;&lt;P&gt; of   same type it_ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort it_mseg2.&lt;/P&gt;&lt;P&gt;LOOP AT it_ekpo.&lt;/P&gt;&lt;P&gt;READ TABLE it_mseg2 binary search WITH KEY ebeln = it_ekpo-ebeln.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;it_ekpo1 = it_ekpo.&lt;/P&gt;&lt;P&gt;append it_ekpo1.&lt;/P&gt;&lt;P&gt;clear it_ekpo1.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2006 07:43:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-comparing-2-internal-tables/m-p/1222988#M137029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-11T07:43:31Z</dc:date>
    </item>
  </channel>
</rss>

