<?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: filtering the internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439571#M209258</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 believe the problem is in WHERE condition, infact:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you have 1 2 3 4 5 6 in first table 4 5 6 in second table, in the first loop the system'll load all record not equal to 4 (so 1,2,3,5,6), for the secod loop all record not equal to 5 (so 1,2,3,4,6) and so.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab_new into wa_itab_new.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check all records with ID not equal to NEW_ID&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop at itab into wa_itab where id ne wa_itab_new-id.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Now check if the ID isn't in ITAB_NEW&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  READ TABLE ITAB_NEW WITH KEY ID = WA_ITAB-ID&lt;/P&gt;&lt;P&gt;                                  TRANSPORTING NO FIELDS.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Here you're sure this ID isn't in new table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    READ TABLE ITAB2 WITH KEY ID = = WA_ITAB-ID&lt;/P&gt;&lt;P&gt;                                  TRANSPORTING NO FIELDS.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Here you're sure this ID is loaded once      &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      move-corresponding wa_itab to itab2.&lt;/P&gt;&lt;P&gt;      append itab2.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Jun 2006 10:38:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-20T10:38:34Z</dc:date>
    <item>
      <title>filtering the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439570#M209257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear friends &lt;/P&gt;&lt;P&gt;  I am trying to filter the internal table but it gaves me not proper values...&lt;/P&gt;&lt;P&gt;say i have three internal table&lt;/P&gt;&lt;P&gt;itab1        itab2           itab3&lt;/P&gt;&lt;P&gt;id details  id details     id details&lt;/P&gt;&lt;P&gt;1 ABCD      1  ABCD        2 EFGH&lt;/P&gt;&lt;P&gt;2 EFGH                     3 IJKL&lt;/P&gt;&lt;P&gt;3 IJKL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here the above scenario i have main internal table called itab1 which has 3 entries where itab2 has 1 entry. I wish to move all the entry which is not in the itab2 from the itab1.&lt;/P&gt;&lt;P&gt; i have return a code but it gaves me repetative not correct entries... say&lt;/P&gt;&lt;P&gt;1 3 4 are the correct entries.. but after that it gaves me&lt;/P&gt;&lt;P&gt;5 1 2 3 4... in this manner  1 3 4 5 1 2 3 4... instead of this it should 1 3 4 ... please help me to sort out this problem .... any suggestion or code will be greate help of mine... I am giving you my code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at itab_new into wa_itab_new.&lt;/P&gt;&lt;P&gt;       loop at itab into wa_itab where id ne wa_itab_new-id.&lt;/P&gt;&lt;P&gt;            move-corresponding wa_itab to itab2.&lt;/P&gt;&lt;P&gt;            append itab2.&lt;/P&gt;&lt;P&gt;       endloop.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Naim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 10:26:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439570#M209257</guid>
      <dc:creator>naimkhans_babi</dc:creator>
      <dc:date>2006-06-20T10:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: filtering the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439571#M209258</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 believe the problem is in WHERE condition, infact:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you have 1 2 3 4 5 6 in first table 4 5 6 in second table, in the first loop the system'll load all record not equal to 4 (so 1,2,3,5,6), for the secod loop all record not equal to 5 (so 1,2,3,4,6) and so.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab_new into wa_itab_new.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check all records with ID not equal to NEW_ID&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop at itab into wa_itab where id ne wa_itab_new-id.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Now check if the ID isn't in ITAB_NEW&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  READ TABLE ITAB_NEW WITH KEY ID = WA_ITAB-ID&lt;/P&gt;&lt;P&gt;                                  TRANSPORTING NO FIELDS.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Here you're sure this ID isn't in new table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    READ TABLE ITAB2 WITH KEY ID = = WA_ITAB-ID&lt;/P&gt;&lt;P&gt;                                  TRANSPORTING NO FIELDS.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Here you're sure this ID is loaded once      &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      move-corresponding wa_itab to itab2.&lt;/P&gt;&lt;P&gt;      append itab2.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 10:38:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439571#M209258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-20T10:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: filtering the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439572#M209259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ table itab_new with key id = wa_itab-id.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;move-corresponding wa_itab to itab2.&lt;/P&gt;&lt;P&gt;append itab2.&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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wasim Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 10:40:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439572#M209259</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-06-20T10:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: filtering the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439573#M209260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this code it may work.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; itab1-id = 1.&lt;/P&gt;&lt;P&gt; itab1-detail = 'abcd'.&lt;/P&gt;&lt;P&gt; append itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; itab1-id = 2.&lt;/P&gt;&lt;P&gt; itab1-detail = 'hhhh'.&lt;/P&gt;&lt;P&gt; append itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; itab1-id = 3.&lt;/P&gt;&lt;P&gt; itab1-detail = 'gggg'.&lt;/P&gt;&lt;P&gt; append itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; itab1-id = 4.&lt;/P&gt;&lt;P&gt; itab1-detail = 'rere'.&lt;/P&gt;&lt;P&gt; append itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; itab2-id = 1.&lt;/P&gt;&lt;P&gt; itab2-detail = 'abcd'.&lt;/P&gt;&lt;P&gt; append itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt;loop at itab1.&lt;/P&gt;&lt;P&gt;   read table itab2 with key id = itab1-id.&lt;/P&gt;&lt;P&gt;   if sy-subrc &amp;lt;&amp;gt; 0.&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;   endif.&lt;/P&gt;&lt;P&gt; endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 10:54:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439573#M209260</guid>
      <dc:creator>santhosh_patil</dc:creator>
      <dc:date>2006-06-20T10:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: filtering the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439574#M209261</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;Do the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB BY ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at ITAB_NEW into wa_itab_new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Now check if the ID is in ITAB or not&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     READ TABLE ITAB WITH KEY ID = WA_ITAB_NEW-ID&lt;/P&gt;&lt;P&gt;                          BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Here you're sure this ID isn't in ITAB&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       move-corresponding wa_itab_new to 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;Sameena&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: sameena attarwala&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 10:59:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-internal-table/m-p/1439574#M209261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-20T10:59:39Z</dc:date>
    </item>
  </channel>
</rss>

