<?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: ABAP new Syntax - DELETE inside FOR-Loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-new-syntax-delete-inside-for-loop/m-p/12131540#M1975196</link>
    <description>&lt;UL&gt;
&lt;/UL&gt;&lt;P&gt;Excuse me, but there is no relationship between lt_tab and lt_tab_1, is it normal? Or is your question only about DELETE lt_tab?&lt;/P&gt;&lt;P&gt;If your question is about DELETE:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Generally speaking, the "new syntax" (what does it mean?), probably you mean the "constructor expressions" introduced in ABAP 7.40, are used to construct (= initialize/append), not to "deconstruct" (= delete)&lt;/LI&gt;&lt;LI&gt;So, a workaround may be to reconstruct the internal table with all the lines except the ones to "delete", for instance using the constructor operator FILTER.&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Tue, 07 Apr 2020 16:55:51 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2020-04-07T16:55:51Z</dc:date>
    <item>
      <title>ABAP new Syntax - DELETE inside FOR-Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-new-syntax-delete-inside-for-loop/m-p/12131539#M1975195</link>
      <description>&lt;P&gt;Hello together,&lt;/P&gt;
  &lt;P&gt;is there a new syntax statement to do the following?&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;LOOP AT lt_tab ASSIGNING &amp;lt;ls_ine&amp;gt; WHERE vbeln = &amp;lt;ls_dlv&amp;gt;-dlv_id.           

DELETE lt_tab_1 WHERE vbeln = &amp;lt;ls_dlv_split_request&amp;gt;-vbeln_new.           

DELETE lt_tab.         

ENDLOOP.
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Apr 2020 09:44:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-new-syntax-delete-inside-for-loop/m-p/12131539#M1975195</guid>
      <dc:creator>former_member647100</dc:creator>
      <dc:date>2020-04-07T09:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP new Syntax - DELETE inside FOR-Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-new-syntax-delete-inside-for-loop/m-p/12131540#M1975196</link>
      <description>&lt;UL&gt;
&lt;/UL&gt;&lt;P&gt;Excuse me, but there is no relationship between lt_tab and lt_tab_1, is it normal? Or is your question only about DELETE lt_tab?&lt;/P&gt;&lt;P&gt;If your question is about DELETE:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Generally speaking, the "new syntax" (what does it mean?), probably you mean the "constructor expressions" introduced in ABAP 7.40, are used to construct (= initialize/append), not to "deconstruct" (= delete)&lt;/LI&gt;&lt;LI&gt;So, a workaround may be to reconstruct the internal table with all the lines except the ones to "delete", for instance using the constructor operator FILTER.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 07 Apr 2020 16:55:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-new-syntax-delete-inside-for-loop/m-p/12131540#M1975196</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-04-07T16:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP new Syntax - DELETE inside FOR-Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-new-syntax-delete-inside-for-loop/m-p/12131541#M1975197</link>
      <description>&lt;UL&gt;&lt;LI&gt;The "new syntax" doesnt make the "old syntax" obsolete, even though there might be some instances of 'old syntax' that shouldnt be used any more (e.g. explicit option BINARY SEARCH).&lt;/LI&gt;&lt;LI&gt;The new available expressions do have the capability, of making certain codings shorter, especially when help variables (fields, structures, tables) are necessary to perform a task.&lt;/LI&gt;&lt;LI&gt;I do not see a value however, in trying to force a few lines of coding into coding that represents the so called "new syntax".&lt;/LI&gt;&lt;LI&gt;The delete statement does not have a real corresponding expression for the "new syntax"&lt;/LI&gt;&lt;LI&gt;The lines of code you give obviously have a necessary 'looping' functionality around it, that should give more sense to your coding then the way it is presented right now, therefore, any attempt to apply the new more sophisticated expressions, should also include the surrounding logic as well, and not just concentrate on those few seemingly unrelated lines of code&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here are some examples with the new expressions that could help you with rewriting the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;" VALUE expression
" New lt_tab_2 has only values from Old lt_tab_1 that are not in lt_tab based on vbeln&lt;BR /&gt;TYPES: rty_vbeln TYPE RANGE OF vbeln.
DATA(lt_tab_2) = VALUE tty_tab_1( FOR wa1 IN lt_tab_1 
                WHERE ( KEY NOT IN VALUE rty_vbeln( FOR wa2 IN lt_tab 
                             ( SIGN = 'I' OPTION = 'EQ' LOW = wa2-vbeln ) ) ) 
               ( vbeln = wa1-vbeln ) ).

" FILTER expression
" Table lt_tab is filtered by not having a specific value
lt_tab = filter #( lt_tab WHERE vbeln &amp;lt;&amp;gt; &amp;lt;ls_dlv&amp;gt;-dlv_id ).


" Table lt_tab_1 is filtered by values that are not in table lt_tab based on vbeln
lt_tab_1 = filter #( lt_tab_1 EXCEPT in lt_tab where vbeln = vbeln ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Apr 2020 10:15:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-new-syntax-delete-inside-for-loop/m-p/12131541#M1975197</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-04-08T10:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP new Syntax - DELETE inside FOR-Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-new-syntax-delete-inside-for-loop/m-p/12131542#M1975198</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;coding1407&lt;/SPAN&gt;, please follow up on your open question.&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;comment answers or your question if there are still open issues.&lt;/LI&gt;&lt;LI&gt;otherwise mark an answer as accepted if it helped you solve your problem&lt;/LI&gt;&lt;LI&gt;or post an answer of yourself and accept it if you found another useful solution yourself&lt;/LI&gt;&lt;LI&gt;or redirect your question to another question that is related and was useful to solve your problem&lt;/LI&gt;&lt;LI&gt;in the end, close your question&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 13 May 2020 15:06:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-new-syntax-delete-inside-for-loop/m-p/12131542#M1975198</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-05-13T15:06:35Z</dc:date>
    </item>
  </channel>
</rss>

