<?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 data in internal table based on select-option inputs in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726080#M1299032</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;Just practice as below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE i_tab3 WHERE bukrs IN s_bukrs.&lt;/P&gt;&lt;P&gt;DELETE i_tab3 WHERE anln1 IN s_anln1. etc......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raju.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Jun 2009 12:10:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-01T12:10:42Z</dc:date>
    <item>
      <title>Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726071#M1299023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear forumers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm in the midst of coding a rather complex data retrieval logics for an ALV report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the report, I have 10 select-options (all are with ranges). At one point, I would like to filter the data in an internal table based on the select-option inputs there. All the other data retrievals from this point forward will be based on the filtered internal table (i.e i_tab4 in the codes below).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've coded this segment in such a way, but there seems to be problems with the read statement here (I think it's rather impossible to code it this way as well because the compiler complained on a syntax error at the IN word used). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if i_tab3 is not initial.

  read i_tab3 into w_wa_3
  with key bukrs IN s_bukrs and
           anln1 IN s_anln1 and
           invnr IN s_invnr and 
           deakt IN s_deakt and 
           prctr IN s_prctr and 
                ...
           matnr IN s_matnr.

  if sy-subrc = 0.
    " Codes for moving the contents in w_wa_3 to w_wa_4 and finally to i_tab4
  endif.

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any better ways to filter data in an internal table? Please help (as I'm still a newbie). I'd really appreciate any inputs here at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 11:59:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726071#M1299023</guid>
      <dc:creator>former_member367551</dc:creator>
      <dc:date>2009-06-01T11:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726072#M1299024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannit use READ this way, use a LOOP AT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:03:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726072#M1299024</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-06-01T12:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726073#M1299025</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;You can use the Loop and Endloop statmenst to filter some date while you are read the table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB INTO WA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ I_TAB3 INTO WA_TAB3 with KEY BUKRS = WA-BUKRS &lt;/P&gt;&lt;P&gt;                                                             ANLN  = WA-ANLAN........&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like above you can filter the data ver well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Thiru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:06:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726073#M1299025</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-01T12:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726074#M1299026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Raymond..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, I'm a little hesitant to use the LOOP method (&lt;STRONG&gt;LOOP AT i_tab3 into w_wa_3 where &amp;lt;condition&amp;gt;&lt;/STRONG&gt;) because it might just mean using a lot of loops with multiple conditions, thus affecting the program's performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are your thoughts on this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:06:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726074#M1299026</guid>
      <dc:creator>former_member367551</dc:creator>
      <dc:date>2009-06-01T12:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726075#M1299027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it's not posible to use the IN while reading an internal table try somthing like following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if i_tab3 is not initial.
  loop at i_tab3 into w_wa_3
     where bukrs IN s_bukrs and
         and anln1 IN s_anln1 and
         and invnr  IN s_invnr and 
         and deakt IN s_deakt and 
         and prctr  IN s_prctr and 
          .
         and matnr IN s_matnr.
   endloop.
  if sy-subrc = 0.
    " Codes for moving the contents in w_wa_3 to w_wa_4 and finally to i_tab4
  endif.
 
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:07:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726075#M1299027</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-01T12:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726076#M1299028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete itab3 where bukrs NOT IN s_bukrs or&lt;/P&gt;&lt;P&gt;                          anln1  NOT IN s_anln1 or&lt;/P&gt;&lt;P&gt;                          invnr    NOT IN s_invnr or &lt;/P&gt;&lt;P&gt;                         deakt   NOT IN s_deakt or &lt;/P&gt;&lt;P&gt;                         prctr    NOT IN s_prctr or &lt;/P&gt;&lt;P&gt;                                 ...&lt;/P&gt;&lt;P&gt;                         matnr IN s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:08:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726076#M1299028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-01T12:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726077#M1299029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Code should look like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF i_tab3 IS NOT INITIAL.
  LOOP AT i_tab3 INTO w_wa_3
    WHERE bukrs IN s_bukrs AND
          anln1 IN s_anln1 AND
          invnr IN s_invnr AND
          deakt IN s_deakt AND
          prctr IN s_prctr AND
          ...
          matnr in s_matnr.
    " Codes for moving the contents in w_wa_3 to w_wa_4 and finally to i_tab4
  ENDLOOP.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;- If only first record is required, put an EXIT statement in the LOOP/ENDLOOP block.&lt;/P&gt;&lt;P&gt;- Try to filter the database SELECT before filling the internal table&lt;/P&gt;&lt;P&gt;- if you have several level of LOOP, you may copy internal table, and delete record already processed&lt;/P&gt;&lt;P&gt;- The only optimization in LOOP WHERE comes when the internal table as a sorted type, and the where criteria are the first sequential keys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:09:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726077#M1299029</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-06-01T12:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726078#M1299030</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;At the Select statement level u can sort the data based on above condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from &amp;lt;table_name&amp;gt; into table i_tab3&lt;/P&gt;&lt;P&gt;where  bukrs IN s_bukrs and&lt;/P&gt;&lt;P&gt;           anln1 IN s_anln1 and&lt;/P&gt;&lt;P&gt;           invnr IN s_invnr and &lt;/P&gt;&lt;P&gt;           deakt IN s_deakt and &lt;/P&gt;&lt;P&gt;           prctr IN s_prctr and &lt;/P&gt;&lt;P&gt;                ...&lt;/P&gt;&lt;P&gt;           matnr IN s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc is initial.&lt;/P&gt;&lt;P&gt;itab4[] = itab3[].&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:09:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726078#M1299030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-01T12:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726079#M1299031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can filter by this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_tab3 into w_wa_3 where bukrs IN s_bukrs and&lt;/P&gt;&lt;P&gt;                                                 anln1 IN s_anln1 and&lt;/P&gt;&lt;P&gt;                                                 invnr IN s_invnr and &lt;/P&gt;&lt;P&gt;                                                 deakt IN s_deakt and &lt;/P&gt;&lt;P&gt;                                                 prctr IN s_prctr and &lt;/P&gt;&lt;P&gt;                                                       ...&lt;/P&gt;&lt;P&gt;                                               matnr IN s_matnr.&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;regards,&lt;/P&gt;&lt;P&gt;ravibabu.a&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:10:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726079#M1299031</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-01T12:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726080#M1299032</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;Just practice as below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE i_tab3 WHERE bukrs IN s_bukrs.&lt;/P&gt;&lt;P&gt;DELETE i_tab3 WHERE anln1 IN s_anln1. etc......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raju.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:10:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726080#M1299032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-01T12:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726081#M1299033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Thirupathy..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem here is, all the 10 select-options have ranges and I need to filter my data in the internal table based on them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As similar to coding a SELECT statement, I would code "SELECT ... WHERE BUKRS IN S_BUKRS ...". But, isn't "READ TABLE ... WITH KEY BUKRS = S_BUKRS" less accurate here (considering that the S_BUKRS is a range and not a single value)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help. &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:12:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726081#M1299033</guid>
      <dc:creator>former_member367551</dc:creator>
      <dc:date>2009-06-01T12:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726082#M1299034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;if i_tab3 is not initial.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  read i_tab3 into w_wa_3&lt;/P&gt;&lt;P&gt;  with key bukrs IN s_bukrs and&lt;/P&gt;&lt;P&gt;           anln1 IN s_anln1 and&lt;/P&gt;&lt;P&gt;           invnr IN s_invnr and &lt;/P&gt;&lt;P&gt;           deakt IN s_deakt and &lt;/P&gt;&lt;P&gt;           prctr IN s_prctr and &lt;/P&gt;&lt;P&gt;                ...&lt;/P&gt;&lt;P&gt;           matnr IN s_matnr.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    " Codes for moving the contents in w_wa_3 to w_wa_4 and finally to i_tab4&lt;/P&gt;&lt;P&gt;  endif.&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;For this you can try logic as below mention.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append all ranges at selection screen output. then sort this by appropriate field and then use read statement for filtering data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is useful for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:20:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726082#M1299034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-01T12:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726083#M1299035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A huge thanks to everyone, for the generous inputs provided here.. I really do appreciate it a lot..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GTREN, Kiran, Ravibabu, I'll definitely consider your suggestions there..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raymond, thanks for the good tips and advice given.. Really appreciate it as well..&lt;/P&gt;&lt;P&gt;- If only first record is required, put an EXIT statement in the LOOP/ENDLOOP block.&lt;/P&gt;&lt;P&gt;  &lt;EM&gt;--&amp;gt; All the records are needed, not just the first&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- Try to filter the database SELECT before filling the internal table&lt;/P&gt;&lt;P&gt;  &lt;EM&gt;--&amp;gt; This is done already&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- if you have several level of LOOP, you may copy internal table, and delete record already processed&lt;/P&gt;&lt;P&gt;  &lt;EM&gt;--&amp;gt; Will probably do this too&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- The only optimization in LOOP WHERE comes when the internal table as a sorted type, and the where criteria are the first sequential keys&lt;/P&gt;&lt;P&gt;  &lt;EM&gt;--&amp;gt; Will take note of it&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usha, unfortunately, there are about 7 database tables to select data from, and it isn't as simple / straightforward to just do the data retrieval in one select statement. I have however, filtered the data accordingly in my earlier SELECT statements too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;S Raju, I'll also consider your suggestions, but perhaps by using just one delete statement with multiple conditions in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vijay, this is an interesting way too, will definitely consider your suggestion here as well..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 12:35:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726083#M1299035</guid>
      <dc:creator>former_member367551</dc:creator>
      <dc:date>2009-06-01T12:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data in internal table based on select-option inputs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726084#M1299036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just an update here..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After much tests, I found that the following method works the fastest (and most straight-forward) too:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    DELETE i_tab3
    WHERE bukrs NOT IN s_bukrs.

    DELETE i_tab3
    WHERE anln1 NOT IN s_anln1.

    DELETE i_tab3
    WHERE invnr NOT IN s_invnr.

    DELETE i_tab3
    WHERE prctr NOT IN s_prctr.

    DELETE i_tab3
    WHERE matnr NOT IN s_matnr.
    
    ...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks once again for all the help and inputs given! &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2009 08:19:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-data-in-internal-table-based-on-select-option-inputs/m-p/5726084#M1299036</guid>
      <dc:creator>former_member367551</dc:creator>
      <dc:date>2009-06-05T08:19:26Z</dc:date>
    </item>
  </channel>
</rss>

