<?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: Delete pattern in range from internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755887#M2022135</link>
    <description>&lt;P&gt;'E' being Exclude.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2023 07:31:16 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2023-09-29T07:31:16Z</dc:date>
    <item>
      <title>Delete pattern in range from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755881#M2022129</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;
  &lt;P&gt;If I get a pattern from selection screen as a range, how can I use the range to remove lines with patterns in range from internal table?&lt;/P&gt;
  &lt;P&gt;For example:&lt;/P&gt;
  &lt;P&gt;I have r_dummy as a range &lt;/P&gt;
  &lt;P&gt;r_dummy-low = Dummy&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;Recorded data in the field in the internal table be like: [ Dummy_aaaaaa, Dummy_123, name2, name2]&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;how to remove the line?&lt;/P&gt;
  &lt;P&gt;I tried add * to r_dummy-low &lt;BR /&gt;then try like below but it doesn’t work:&lt;/P&gt;
  &lt;P&gt;DELETE lt_data WHARE field NP r_dummy-low.&lt;/P&gt;
  &lt;P&gt;And I try use it as a part of selection statement like :&lt;/P&gt;
  &lt;P&gt;SELECT *&lt;BR /&gt;FROM table&lt;/P&gt;
  &lt;P&gt;INTO TABLE lt_data&lt;/P&gt;
  &lt;P&gt;WHERE field NOT IN r_dummy&lt;/P&gt;
  &lt;P&gt;it doesn’t work either.&lt;/P&gt;
  &lt;P&gt;I need a clue.&lt;/P&gt;
  &lt;P&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 18:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755881#M2022129</guid>
      <dc:creator>suth1</dc:creator>
      <dc:date>2023-09-28T18:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Delete pattern in range from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755882#M2022130</link>
      <description>&lt;P&gt;Please use the CODE formatting button. The question would be much more legible:&lt;/P&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;If I get a pattern from selection screen as a range, how can I use the range to remove lines with patterns in range from internal table?&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;I have r_dummy as a range&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;r_dummy-low = Dummy&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Recorded data in the field in the internal table be like: [ Dummy_aaaaaa, Dummy_123, name2, name2]&lt;/P&gt;&lt;P&gt;how to remove the line?&lt;/P&gt;&lt;P&gt;I tried add * to r_dummy-low&lt;BR /&gt;then try like below but it doesn’t work:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DELETE lt_data WHARE field NP r_dummy-low.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I try use it as a part of selection statement like :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT *&lt;BR /&gt;FROM table&lt;BR /&gt;INTO TABLE lt_data&lt;BR /&gt;WHERE field NOT IN r_dummy&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;it doesn’t work either.&lt;/P&gt;&lt;P&gt;I need a clue.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 19:16:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755882#M2022130</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-09-28T19:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Delete pattern in range from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755883#M2022131</link>
      <description>&lt;P&gt;I don't understand your question at all. Why "dummy"? Why do you need to transform your selection screen criteria into something else before using it in SELECT?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 19:21:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755883#M2022131</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-09-28T19:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Delete pattern in range from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755884#M2022132</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;range table (or SELECT-OPTION, which is also range table) has four fields:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SIGN&lt;/LI&gt;&lt;LI&gt;OPTION&lt;/LI&gt;&lt;LI&gt;LOW&lt;/LI&gt;&lt;LI&gt;HIGH&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If you want to use pattern correctly, then OPTION field needs to have value (operator) "CP" or "NP". These two are explained here: &lt;A href="https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abenlogexp_strings.htm" target="test_blank"&gt;https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abenlogexp_strings.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In your example r_dummy table should have:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SIGN = I&lt;/LI&gt;&lt;LI&gt;OPTION = CP&lt;/LI&gt;&lt;LI&gt;LOW = Dummy*  (Asterisk character is important here!)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If it is SELECT-OPTION, then user can enter "Dummy*" and this entry will automatically be with OPTION = CP.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 06:40:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755884#M2022132</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2023-09-29T06:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Delete pattern in range from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755885#M2022133</link>
      <description>&lt;P&gt;First prepare your range accordingly to your requirement, so if you want to have Dummy* filtered it should be&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;r_dummy-sign = `I`. "Include
r_dummy-option = `CP`. "Contains pattern
r_dummy-low = `Dummy*`.
APPEND r_dummy TO rt_dummy.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And then you can either use FILTER statement for it:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(filtered_data) = FILTER #( lt_data WHERE field IN rt_dummy ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Or you can delete unwanted entries from the internal table instead.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DELETE lt_data WHERE field NOT IN rt_dummy.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Sep 2023 06:41:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755885#M2022133</guid>
      <dc:creator>fprokopiuk</dc:creator>
      <dc:date>2023-09-29T06:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Delete pattern in range from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755886#M2022134</link>
      <description>&lt;P&gt;It seems that your question is clear for other people, if I merge their interpretations and what I partly understand from your question, I would opt for a third "answer" which might correspond to what you're looking for:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(r_range_without_dummy) = r_range.

r_range_without_dummy = VALUE #(
    ( LINES OF r_range_without_dummy )
    ( sign   = 'E' 
      option = 'CP'              " CP is case-insensitive
      low    = 'dummy*' ) ).

SELECT *
FROM table
INTO TABLE lt_data
WHERE field IN r_range_without_dummy.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Sep 2023 07:31:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755886#M2022134</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-09-29T07:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Delete pattern in range from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755887#M2022135</link>
      <description>&lt;P&gt;'E' being Exclude.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 07:31:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-pattern-in-range-from-internal-table/m-p/12755887#M2022135</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-09-29T07:31:16Z</dc:date>
    </item>
  </channel>
</rss>

