<?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 an internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951936#M944717</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 using  read table as it can read an internal table. And then if the record is found, you copy the record and put it into another internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;itab&amp;gt; with key &amp;lt;field&amp;gt; = &amp;lt;eg.not1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;do you copy statement here&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Loo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jun 2008 02:08:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-03T02:08:44Z</dc:date>
    <item>
      <title>Filtering an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951935#M944716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I have an internal table like this :&lt;/P&gt;&lt;P&gt;Notru_id Remtype&lt;/P&gt;&lt;P&gt;NOT1     8000&lt;/P&gt;&lt;P&gt;NOT2     8000&lt;/P&gt;&lt;P&gt;NOT2     8100&lt;/P&gt;&lt;P&gt;NOT3     8000&lt;/P&gt;&lt;P&gt;where the key field is Notru_id ie : not1 , not2, not3 etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to filter this table such that i get all records of one Notru_id into another internal table and process t\it.&lt;/P&gt;&lt;P&gt;A select query can't be used since it is an internal table.&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Gayathri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 01:27:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951935#M944716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T01:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951936#M944717</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 using  read table as it can read an internal table. And then if the record is found, you copy the record and put it into another internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;itab&amp;gt; with key &amp;lt;field&amp;gt; = &amp;lt;eg.not1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;do you copy statement here&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Loo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 02:08:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951936#M944717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T02:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951937#M944718</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;As per your issue...Let say your internal table is like this&lt;/P&gt;&lt;P&gt;  NOT1 345&lt;/P&gt;&lt;P&gt;  NOT4 345&lt;/P&gt;&lt;P&gt;  NOT5 345&lt;/P&gt;&lt;P&gt;  NOT1 345&lt;/P&gt;&lt;P&gt;  NOT6 345&lt;/P&gt;&lt;P&gt;  NOT1 345&lt;/P&gt;&lt;P&gt;  NOT2 345&lt;/P&gt;&lt;P&gt;  NOT7 345&lt;/P&gt;&lt;P&gt;  NOT3 345&lt;/P&gt;&lt;P&gt;  NOT3 345 then your need all NOT1 should be in one Internal table right??like this&lt;/P&gt;&lt;P&gt;  NOT1 345&lt;/P&gt;&lt;P&gt;  NOT1 345&lt;/P&gt;&lt;P&gt;  NOT1 345&lt;/P&gt;&lt;P&gt; If so is that then How many internal tables You need. and How do we will come to know...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how will you come to know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 02:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951937#M944718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T02:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951938#M944719</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;Your question is not so clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below code, if i m not wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;         Notru_id  type char4,&lt;/P&gt;&lt;P&gt;         Remtype   type char5,&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_out like itab occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Assume that data is already available.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by notru_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab with key notru_id = 'NOT4'&lt;/P&gt;&lt;P&gt;                                     binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;   it_out = itab.&lt;/P&gt;&lt;P&gt;   append.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As long as notru_id is key field, even no need of it_out.  Because read itab itself have the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points, if it is useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 02:12:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951938#M944719</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T02:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951939#M944720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your internal table is not having any duplicate entries of notru_id then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab.&lt;/P&gt;&lt;P&gt;  Read table itab into wa_itab index sy-tabix.&lt;/P&gt;&lt;P&gt;   if sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;process the work area into other internal table..&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;append itab1 from wa_itab.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this your requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 02:34:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-an-internal-table/m-p/3951939#M944720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T02:34:09Z</dc:date>
    </item>
  </channel>
</rss>

