<?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: Filter on internal table with multiple Fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508466#M2003794</link>
    <description>&lt;P&gt;and why didn't you use directly the i_pit_input to filter the value of your table ? &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FILTER #( lit_x_all IN i_pit_input&lt;BR /&gt;                    WHERE extsystem = extsystem&lt;BR /&gt;                    AND   ekorg = ekor ....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(and I don't understand the usage of the * )&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 12:11:25 GMT</pubDate>
    <dc:creator>FredericGirod</dc:creator>
    <dc:date>2022-04-19T12:11:25Z</dc:date>
    <item>
      <title>Filter on internal table with multiple Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508459#M2003787</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;My requirement is to filter internal table using multiple fields. &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;CONTANTS:lc_star TYPE C VALUE '*'.

DATA:LIT_X_all TYPE STANDARD TABLE OF ZTT WITH NON-UNIQUE KEY EXTSYSTEM CCODE EKORG WERKS MATKL .
DATA: LIT_FILTER_E TYPE SORTED TABLE OF ZTT-EXTSYSTEM WITH NON-UNIQUE KEY TABLE_LINE ,
      LIT_FILTER_o TYPE SORTED TABLE OF ZTT-EKORG WITH NON-UNIQUE KEY TABLE_LINE ,
      LIT_FILTER_c TYPE SORTED TABLE OF ZTT-ccode WITH NON-UNIQUE KEY TABLE_LINE ,
      LIT_FILTER_w TYPE SORTED TABLE OF ZTT-werks WITH NON-UNIQUE KEY TABLE_LINE .
	  
 SELECT * FROM ZTT WHERE A = @i_A&amp;lt;br&amp;gt; INTO TABLE @LIT_X_ALL.

 LOOP AT i_pit_input INTO DATA(lwa_input).
 "filter to avoid select statement in loop
 lit_filter_e = VALUE #( ( CONV #( lc_star ) ) ( lwa_input-extsystem ) ).
 DATA(lit_final_e) = FILTER #( LIT_APPROVER_ALL IN lit_filter_e WHERE extsystem = table_line ).
 
 lit_filter_o = VALUE #( ( CONV #( lc_star ) ) ( lwa_input-ekorg ) ).
 DATA(lit_final_o) = FILTER #( lit_final_e IN lit_filter_O WHERE ekorg = table_line ).
 
 lit_filter_c = VALUE #( ( CONV #( lc_star ) ) ( lwa_input-ccode ) ).
 DATA(lit_final_c) = FILTER #( lit_final_o IN lit_filter_c WHERE ccode = table_line ).
 
 lit_filter_w = VALUE #( ( CONV #( lc_star ) ) ( lwa_input-werks ) ).
 DATA(lit_final_w) = FILTER #( lit_final_c IN lit_filter_w WHERE werks = table_line ).

 APPEND LINES OF lit_filter_w TO lit_FINAL.
 ENDLOOP.&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; currently i am using above code with filter for each field . can we achieve same requirement with single filter instead of multiple filters.ThanksPhani&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 07:22:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508459#M2003787</guid>
      <dc:creator>former_member664730</dc:creator>
      <dc:date>2022-04-19T07:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on internal table with multiple Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508460#M2003788</link>
      <description>&lt;P&gt;Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you! &lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 07:41:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508460#M2003788</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-04-19T07:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on internal table with multiple Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508461#M2003789</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;phanikumar_y&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;do you mean something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select a~*
from @LIT_APPROVER_ALL as a 
where exists(
select @abap_true
from ztt as b
  where b~extsys = a~extsys
    and b~ekorg = a~ekorg
    and ...
)
into table @data(lt_result)

or 

select a~*
from @LIT_APPROVER_ALL as a 
inner join ztt as b
   on b~extsys = a~extsys
  and b~ekorg = a~ekorg
  and ....
into table @data(lt_result)&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Apr 2022 08:13:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508461#M2003789</guid>
      <dc:creator>ThorstenHoefer</dc:creator>
      <dc:date>2022-04-19T08:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on internal table with multiple Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508462#M2003790</link>
      <description>&lt;P&gt;No. My requirement is check particular combination exists or not .&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 09:30:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508462#M2003790</guid>
      <dc:creator>former_member664730</dc:creator>
      <dc:date>2022-04-19T09:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on internal table with multiple Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508463#M2003791</link>
      <description>&lt;P&gt;It seems your code is incomplete as I don't understand the goal: why do you loop at I_PIT_INPUT, because final result will only consider last line of I_PIT_INPUT...&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 10:47:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508463#M2003791</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-04-19T10:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on internal table with multiple Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508464#M2003792</link>
      <description>&lt;P&gt;My bad . i missed append staement in end . edited code now.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 11:56:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508464#M2003792</guid>
      <dc:creator>former_member664730</dc:creator>
      <dc:date>2022-04-19T11:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on internal table with multiple Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508465#M2003793</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;perhape can you use standard function 

LVC_FILTER_APPLY ...&lt;BR /&gt;Check it !&lt;BR /&gt;SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 11:57:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508465#M2003793</guid>
      <dc:creator>stanislaslemaire</dc:creator>
      <dc:date>2022-04-19T11:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on internal table with multiple Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508466#M2003794</link>
      <description>&lt;P&gt;and why didn't you use directly the i_pit_input to filter the value of your table ? &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FILTER #( lit_x_all IN i_pit_input&lt;BR /&gt;                    WHERE extsystem = extsystem&lt;BR /&gt;                    AND   ekorg = ekor ....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(and I don't understand the usage of the * )&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 12:11:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508466#M2003794</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-04-19T12:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on internal table with multiple Fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508467#M2003795</link>
      <description>&lt;P&gt;Hi Fredric,&lt;/P&gt;&lt;P&gt;i cannot use directly because i have use OR operation . check value or '*'  exits or not ?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Phani&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 14:25:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-on-internal-table-with-multiple-fields/m-p/12508467#M2003795</guid>
      <dc:creator>former_member664730</dc:creator>
      <dc:date>2022-04-19T14:25:08Z</dc:date>
    </item>
  </channel>
</rss>

