<?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: Internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146124#M116192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just write this st. after the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete i_final where normrt = space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KIndly reward points if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jan 2006 08:19:13 GMT</pubDate>
    <dc:creator>jayanthi_jayaraman</dc:creator>
    <dc:date>2006-01-09T08:19:13Z</dc:date>
    <item>
      <title>Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146121#M116189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I want to delete some reocrds from the internal table where for a particular field there is not data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SORT i_mara BY matnr.
  LOOP AT i_final1 INTO is_final1.

    READ TABLE i_mara INTO is_mara WITH KEY
               matnr = is_final1-matnr BINARY SEARCH.
    IF sy-subrc EQ 0.
      CLEAR is_final1.

      MOVE is_mara-normt TO is_final1-normt.

      MODIFY i_final1 FROM is_final1 TRANSPORTING normt.

    ENDIF.

  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say before entering the loop i have 3 records in the internal table i_final1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the loop is processed i will still have 3 records but the field normt is filled in only one record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to delete the those records for which the field normrt is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can  I do that in the same loop or do I have to write one more loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one help me regarding this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2006 07:41:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146121#M116189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-09T07:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146122#M116190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do it in the same loop as follows,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT i_mara BY matnr. &lt;/P&gt;&lt;P&gt; LOOP AT i_final1 INTO is_final1.   &lt;/P&gt;&lt;P&gt;   READ TABLE i_mara INTO is_mara WITH KEY  &lt;/P&gt;&lt;P&gt;             matnr = is_final1-matnr BINARY SEARCH. &lt;/P&gt;&lt;P&gt;   IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;      IF is_mara-normt IS INITIAL.&lt;/P&gt;&lt;P&gt;        DELETE i_final1.&lt;/P&gt;&lt;P&gt;        CONTINUE.&lt;/P&gt;&lt;P&gt;      ENDIF.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;      CLEAR is_final1.&lt;/P&gt;&lt;P&gt;      MOVE is_mara-normt TO is_final1-normt.&lt;/P&gt;&lt;P&gt;      MODIFY i_final1 FROM is_final1 TRANSPORTING normt.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ELSE.&lt;/P&gt;&lt;P&gt;  DELETE i_final1.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;ENDIF.&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;Hope this helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2006 07:46:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146122#M116190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-09T07:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146123#M116191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of that you can do this way..&lt;/P&gt;&lt;P&gt;delete i_final1 where normrt = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2006 07:48:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146123#M116191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-09T07:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146124#M116192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just write this st. after the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete i_final where normrt = space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KIndly reward points if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2006 08:19:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146124#M116192</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-01-09T08:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146125#M116193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. U want to delete record from internal table&lt;/P&gt;&lt;P&gt;   ( IN A LOOP)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Simply using &lt;/P&gt;&lt;P&gt;  IF is_mara-normt IS INITIAL.&lt;/P&gt;&lt;P&gt;  and DELETE&lt;/P&gt;&lt;P&gt;  will do your work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. BUT,&lt;/P&gt;&lt;P&gt;   U MAY FACE PROBLEM BCOS OF LOOP.&lt;/P&gt;&lt;P&gt;   (IN BETWEEN RECORDS ARE DELETED)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Hence, i suggest the following :&lt;/P&gt;&lt;P&gt;  (i had also faced similar problem,&lt;/P&gt;&lt;P&gt;   hence, this is one good approach &lt;/P&gt;&lt;P&gt;  for such delete record problems)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------" /&gt;&lt;P&gt;5. In your internal table,&lt;/P&gt;&lt;P&gt;   declare one EXTRA Field (say FLAG)&lt;/P&gt;&lt;P&gt;   type c.&lt;/P&gt;&lt;P&gt;6. Loop at your logic,&lt;/P&gt;&lt;P&gt;   and if &lt;/P&gt;&lt;P&gt;IF is_mara-normt IS INITIAL&lt;/P&gt;&lt;P&gt;  Mark FLAG = 'X'.&lt;/P&gt;&lt;P&gt;  and modify the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.  Let the loop ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------" /&gt;&lt;P&gt;7. After this, &lt;/P&gt;&lt;P&gt;   Loop at ITAB.&lt;/P&gt;&lt;P&gt;   If itab-flag = 'X'.&lt;/P&gt;&lt;P&gt;   DELETE ITAB.&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt;   ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8. Whenever we have to apply logic&lt;/P&gt;&lt;P&gt;  for deleting records in internal table(in a loop)&lt;/P&gt;&lt;P&gt;,  always follow this FLAG concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2006 08:50:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1146125#M116193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-09T08:50:05Z</dc:date>
    </item>
  </channel>
</rss>

