<?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: conditional deletion in Internal Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294345#M1725464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sebastian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might be because u did not have another condition for your requirement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="text-decoration: underline;"&gt; If a Handling Code contains MULTIPLE rows with counter value '0', ONLY ONE row must be displayed. It could be the first or last. (0000379651) &lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And Plz be sure of data consistency after using merge by having diff test data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did u try the above logic I gave. &lt;SPAN style="text-decoration: underline;"&gt;It involves only one loop operation for the requirement&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Feb 2013 14:15:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-02-28T14:15:42Z</dc:date>
    <item>
      <title>conditional deletion in Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294339#M1725458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to delete selective rows based on the following conditions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As seen in the screenshot, the first column contains Handling Codes and the last column contains counter values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a Handling Code contains MULTIPLE rows with counter value '0', ONLY ONE row must be displayed. It could be the first or last. (0000379651)&lt;/P&gt;&lt;P&gt;If a Handling Code contains only a SINGLE row with counter value '0', it must be displayed. (0000379831)&lt;/P&gt;&lt;P&gt;If a Handling Code contains MULTIPLE rows with counter value '1', ALL rows must be displayed. (0000379834)&lt;/P&gt;&lt;P&gt;If a Handling Code contains MULTIPLE rows with counter values '1' and '0', ALL rows containing value '1' must be displayed and those containing '0' must be omitted. (0000380009)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plainly said all highlighted rows have to be deleted/suppressed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this in a routine which I am programming in an APD?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls Help. Many Thanks.&lt;/P&gt;&lt;P&gt;SD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/189413" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Moderator Message: &lt;SPAN style="font-size: 9pt; font-family: Tahoma, sans-serif;"&gt;We do not consider it good style to ask questions before trying to find the solution yourself. Please refer in your text also to what you have done already to solve the problem and what resources you have searched or used.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kesavadas Thekkillath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 12:36:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294339#M1725458</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-26T12:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: conditional deletion in Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294340#M1725459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sebastian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is internal table operation logic. Before passing the internal table to the FM display, use the following logic, U should be able to proceed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_final into wa_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at new vorgangsnummer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aflag = 1.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Aflag = 0 and wa_final-zahler eq 0 and Bflag = 1..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete table t_final from wa_final.&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;if wa_final-zahler eq 0.&lt;/P&gt;&lt;P&gt;Bflag = 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear Aflag.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 14:47:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294340#M1725459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-26T14:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: conditional deletion in Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294341#M1725460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sebastian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_tab INTO wa_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF &amp;lt;condition &amp;gt; = fullfilled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DELETE it_tab INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 14:57:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294341#M1725460</guid>
      <dc:creator>bishwajit_das</dc:creator>
      <dc:date>2013-02-26T14:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: conditional deletion in Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294342#M1725461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;delete &lt;SPAN class="L0S52"&gt;i &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;a &lt;SPAN class="L0S52"&gt;is &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INITIAL&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;AND &lt;/SPAN&gt;d &lt;SPAN class="L0S52"&gt;EQ &lt;/SPAN&gt;&lt;SPAN class="L0S32"&gt;0.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S32"&gt;Where A is first and D is last column.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check and let me know if there are any issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S32"&gt;Regards &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S32"&gt;Dnyan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 15:50:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294342#M1725461</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-26T15:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: conditional deletion in Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294343#M1725462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vivek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your reply. I have used the following logic...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. copied all records with counter value '0' in internal table it_1&lt;/P&gt;&lt;P&gt;2. deleted adjacent duplicates in it_1. Hence i am left with the desired records&lt;/P&gt;&lt;P&gt;3. copied all records with counter value '1' in internal table it_2&lt;/P&gt;&lt;P&gt;4. merged it_1 and it_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This logic works fine. The only problem is that in case of handling number 0000380009 I am left with 2 records i.e. one record with value '1' and the other with value '0'. How do I overcome this? I have attached the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 13:24:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294343#M1725462</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-28T13:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: conditional deletion in Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294344#M1725463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vivek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your reply. I have used the following logic...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. copied all records with counter value '0' in internal table it_1&lt;/P&gt;&lt;P&gt;2. deleted adjacent duplicates in it_1. Hence i am left with the desired records&lt;/P&gt;&lt;P&gt;3. copied all records with counter value '1' in internal table it_2&lt;/P&gt;&lt;P&gt;4. merged it_1 and it_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This logic works fine. The only problem is that in case of handling number 0000380009 I am left with 2 records i.e. one record with value '1' and the other with value '0'. How do I overcome this? I have attached the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 13:25:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294344#M1725463</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-28T13:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: conditional deletion in Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294345#M1725464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sebastian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might be because u did not have another condition for your requirement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="text-decoration: underline;"&gt; If a Handling Code contains MULTIPLE rows with counter value '0', ONLY ONE row must be displayed. It could be the first or last. (0000379651) &lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And Plz be sure of data consistency after using merge by having diff test data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did u try the above logic I gave. &lt;SPAN style="text-decoration: underline;"&gt;It involves only one loop operation for the requirement&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 14:15:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-deletion-in-internal-table/m-p/9294345#M1725464</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-28T14:15:42Z</dc:date>
    </item>
  </channel>
</rss>

