<?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>Question Re: create inline a filter table with new abap syntax in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629464#M4820868</link>
    <description>EXCEPT IN</description>
    <pubDate>Wed, 06 Mar 2024 09:21:50 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2024-03-06T09:21:50Z</dc:date>
    <item>
      <title>create inline a filter table with new abap syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaq-p/13629416</link>
      <description>&lt;P&gt;Hi experts!&lt;/P&gt;&lt;P&gt;I have a table productions containing, among others, article ids. Now I want to loop over all entries for which no Article ID exists in the articleIs table. Can I do this inline with the new abap syntax.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;LOOP AT filter #( productions IN articles where ArticleId not in articles-ArticleId ) INTO DATA(production).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know if this is possible.&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 08:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaq-p/13629416</guid>
      <dc:creator>sebastian_wilhelm1</dc:creator>
      <dc:date>2024-03-06T08:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: create inline a filter table with new abap syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629464#M4820868</link>
      <description>EXCEPT IN</description>
      <pubDate>Wed, 06 Mar 2024 09:21:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629464#M4820868</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-03-06T09:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: create inline a filter table with new abap syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629488#M4820872</link>
      <description>&lt;P&gt;Hi Sandra! Thanks for you answer but it seems that it is not working.&lt;/P&gt;&lt;P&gt;I tried&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;filter #( productions EXCEPT IN articles where ArticleId = ArticleId )&lt;/LI-CODE&gt;&lt;P&gt;and got an error "&lt;SPAN&gt;The operation requires a key (SORTED or HASHED) on table column(s)". None of the table is a sorted or hashed table.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 09:39:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629488#M4820872</guid>
      <dc:creator>sebastian_wilhelm1</dc:creator>
      <dc:date>2024-03-06T09:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: create inline a filter table with new abap syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629516#M4820877</link>
      <description>With FILTER, articles MUST BE a sorted or hashed table, whatever it's IN or EXCEPT IN. See ABAP documentation for more information.</description>
      <pubDate>Wed, 06 Mar 2024 09:48:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629516#M4820877</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-03-06T09:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: create inline a filter table with new abap syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629544#M4820881</link>
      <description>Okay thanks. Then filter doesn't help. In most cases I don't have a sorted or hashed table. When I have to create one and map the data, the implementation effort is higher than doing a nested loop. Do you know if there is another inline syntax achiving the desired result?</description>
      <pubDate>Wed, 06 Mar 2024 10:01:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629544#M4820881</guid>
      <dc:creator>sebastian_wilhelm1</dc:creator>
      <dc:date>2024-03-06T10:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: create inline a filter table with new abap syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629663#M4820891</link>
      <description>&lt;P&gt;It's a problem if you don't use sorted/hashed tables for the kind of operation you want to do, you'll get bad performance.&lt;/P&gt;&lt;P&gt;Can't you simply define a secondary key for your standard table articles?&lt;/P&gt;&lt;P&gt;I REALLY DON'T recommend this solution if articles is a standard table, but you can do it this way (VALUE, REDUCE, NEW):&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;VALUE #( FOR &amp;lt;production&amp;gt; IN productions
         LET article = REF #( articles[ ArticleId = &amp;lt;production&amp;gt;-ArticleId ] OPTIONAL )
         IN
         ( LINES OF COND #( WHEN article IS BOUND THEN ... ) ) )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 10:48:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629663#M4820891</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-03-06T10:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: create inline a filter table with new abap syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629824#M4820902</link>
      <description>Thanks for you help. I'm wokring on BTP and the tables are all SAP Standard Tables, so creating a secondary key is no usefull option. How can I mark your comment as a correct answer?</description>
      <pubDate>Wed, 06 Mar 2024 11:41:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13629824#M4820902</guid>
      <dc:creator>sebastian_wilhelm1</dc:creator>
      <dc:date>2024-03-06T11:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: create inline a filter table with new abap syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13630134#M4820967</link>
      <description>Do you mean S/4HANA Public Cloud? I don't understand why you are limited to use only standard internal tables. At worst, you can copy to a sorted table and free immediately the memory of the standard table, the copy is very fast compared to repeated linear search.</description>
      <pubDate>Wed, 06 Mar 2024 15:49:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13630134#M4820967</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-03-06T15:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: create inline a filter table with new abap syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13632187#M4821222</link>
      <description>Hi Sandra! I'm not limited to standard tables. The intention of my question was to find a short way to create a filter like described - without creating extra tables with secondary keys and doing some mapping. The mentioned tables articles and productions will only contain 1-5 entries, so I shouldn't get a performance issue.</description>
      <pubDate>Fri, 08 Mar 2024 10:25:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13632187#M4821222</guid>
      <dc:creator>sebastian_wilhelm1</dc:creator>
      <dc:date>2024-03-08T10:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: create inline a filter table with new abap syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13632386#M4821240</link>
      <description>&lt;LI-CODE lang="abap"&gt;    TYPES: BEGIN OF ty_production,
             prod_id    TYPE string,
             article_id TYPE string,
           END OF ty_production,
           BEGIN OF ty_article,
             article_id TYPE string,
           END OF ty_article,
           tt_productions TYPE SORTED TABLE OF ty_production WITH UNIQUE KEY prod_id,
           tt_articles    TYPE SORTED TABLE OF ty_article    WITH UNIQUE KEY article_id.

    DATA(productions) = VALUE tt_productions( ( prod_id = 'P1' article_id = 'A1' )
                                              ( prod_id = 'P2' article_id = 'A2' )
                                              ( prod_id = 'P3' article_id = 'A3' ) ).
    DATA(articles) = VALUE tt_articles( ( article_id = 'A1' )
                                        ( article_id = 'A3' )
                                        ( article_id = 'A4' ) ).

    LOOP AT FILTER #(  productions EXCEPT IN articles WHERE article_id = article_id )
      ASSIGNING FIELD-SYMBOL(&amp;lt;prod_with_not_exst_art&amp;gt;).
      out-&amp;gt;write( &amp;lt;prod_with_not_exst_art&amp;gt;-prod_id ).
    ENDLOOP.&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Mar 2024 14:00:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/create-inline-a-filter-table-with-new-abap-syntax/qaa-p/13632386#M4821240</guid>
      <dc:creator>patrick_winkler</dc:creator>
      <dc:date>2024-03-08T14:00:28Z</dc:date>
    </item>
  </channel>
</rss>

