<?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: To delete an internal table based on two column value condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709265#M32624</link>
    <description>&lt;P&gt;Hi Mohan,&lt;/P&gt;&lt;P&gt;That is not my requirement.&lt;/P&gt;&lt;P&gt;I need to check first movement type 102 and it's document number , if it's inital and then I should check 101 and it's document number.&lt;/P&gt;&lt;P&gt;If both document number is initial , I will delete both the rows&lt;/P&gt;</description>
    <pubDate>Thu, 04 Oct 2018 16:27:55 GMT</pubDate>
    <dc:creator>former_member291971</dc:creator>
    <dc:date>2018-10-04T16:27:55Z</dc:date>
    <item>
      <title>To delete an internal table based on two column value condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709263#M32622</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
  &lt;P&gt;I have a internal table having 17 records&lt;/P&gt;
  &lt;P&gt;I need to delete two rows based on two field column values&lt;/P&gt;
  &lt;P&gt;For example:&lt;/P&gt;
  &lt;P&gt;Condition is , If movement type-bwart is 102 and its document number-belnr is initial, it shud check 101 movement type and if its document number is also initial.&lt;/P&gt;
  &lt;P&gt;It should delete both the line items from the internal table.How could we achieve this?&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 16:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709263#M32622</guid>
      <dc:creator>former_member291971</dc:creator>
      <dc:date>2018-10-04T16:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: To delete an internal table based on two column value condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709264#M32623</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I modified- check this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at it_tab into data(ls_tab1) where bwart = 102 and belnr = ' '.&lt;/P&gt;&lt;P&gt;Lv_tabix1 = sy-tabix.&lt;/P&gt;&lt;P&gt;Read it_tab into data(ls_tab2) with key 101 and belnr = space..&lt;/P&gt;&lt;P&gt;if sy-subrc is initial.&lt;/P&gt;&lt;P&gt;lv_tabix2 = sy-tabix.&lt;/P&gt;&lt;P&gt;Delete it_tab index index lv_tabix1.   " delete 102&lt;/P&gt;&lt;P&gt;Delete it_tab index index lv_tabix2.  " delete 101&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mohan&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 16:18:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709264#M32623</guid>
      <dc:creator>TMSingh_SAP</dc:creator>
      <dc:date>2018-10-04T16:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: To delete an internal table based on two column value condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709265#M32624</link>
      <description>&lt;P&gt;Hi Mohan,&lt;/P&gt;&lt;P&gt;That is not my requirement.&lt;/P&gt;&lt;P&gt;I need to check first movement type 102 and it's document number , if it's inital and then I should check 101 and it's document number.&lt;/P&gt;&lt;P&gt;If both document number is initial , I will delete both the rows&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 16:27:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709265#M32624</guid>
      <dc:creator>former_member291971</dc:creator>
      <dc:date>2018-10-04T16:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: To delete an internal table based on two column value condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709266#M32625</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;* Syntax may be wrong, please rewrite yourself...

LOOP AT ITAB ASSIGNING &amp;lt;FS&amp;gt; WHERE BWART = '102'
                              AND BELNR IS INITIAL.
READ TABLE ITAB TRANSPORTING NO FIELDS WITH KEY BWART = '101'
                                                BELNR = ' '.
IF SY-SUBRC EQ 0.
   FLAG = 'X'.
ENDIF.
ENDLOOP.


IF FLAG EQ ABAP_TRUE.
   DELETE ITAB WHERE BWART = '102' AND '101'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Oct 2018 17:05:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709266#M32625</guid>
      <dc:creator>Muthu_raja</dc:creator>
      <dc:date>2018-10-04T17:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: To delete an internal table based on two column value condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709267#M32626</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT: &amp;lt;internal_table&amp;gt; BY &amp;lt;primary_key&amp;gt;.

READ TABLE &amp;lt;internal_table&amp;gt; INTO &amp;lt;work_area1&amp;gt; WITH KEY BWART = '102'
                                                       BELNR = space
                                                       BINARY SEARCH.
IF sy-subrc EQ 0.
  READ TABLE &amp;lt;internal_table&amp;gt; INTO &amp;lt;work_area2&amp;gt; WITH KEY BWART = '101'
                                                         BELNR = space
                                                         BINARY SEARCH.
  IF sy-subrc EQ 0.
     DELETE &amp;lt;work_area1&amp;gt; FROM &amp;lt;internal_table&amp;gt;.
     DELETE &amp;lt;work_area2&amp;gt; FROM &amp;lt;internal_table&amp;gt;.
  ENDIF.
ENDIF.
                                                            &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Oct 2018 00:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709267#M32626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-10-05T00:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: To delete an internal table based on two column value condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709268#M32627</link>
      <description>&lt;P&gt;I think there are alot of solution for this, just add one of mine &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT itab INTO wa group by ( vbeln = wa-vbeln ) ASSIGNING &amp;lt;fs_grp_key&amp;gt;.
  IF &amp;lt;fs_grp_key&amp;gt;-vbeln IS INITIAL.
 LOOP AT GROUP &amp;lt;fs_grp_key&amp;gt; INTO wa2.
 IF wa2-bwart = '102' AND line_exist( &amp;lt;fs_grp_key&amp;gt;[ bwart = '101' ] ).
 ELSE.
 it_final = VALUE #( BASE ( it_final ) ( wa2 ) ).
 ENDIF.
 ENDLOOP.
 ELSE.
 it_final = VALUE #( BASE ( it_final ) FOR m in GROUP &amp;lt;fs_grp_key&amp;gt; ( m ) ).
 ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 02:11:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709268#M32627</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-10-05T02:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: To delete an internal table based on two column value condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709269#M32628</link>
      <description>&lt;P&gt;Sorted!&lt;/P&gt;&lt;P&gt;Thanks Everyone..&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 11:13:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-delete-an-internal-table-based-on-two-column-value-condition/m-p/709269#M32628</guid>
      <dc:creator>former_member291971</dc:creator>
      <dc:date>2018-10-18T11:13:48Z</dc:date>
    </item>
  </channel>
</rss>

