<?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 Delete internal table rows without using loop statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949784#M1335939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have an internal table which consists of 100 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to keep only first 5 records. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;without using the loop statement i need to delete the rest of the records. how can we achieve this result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.  delete itab1 where  "recordno"  &amp;gt; 5.&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;ZG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jul 2009 14:20:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-21T14:20:29Z</dc:date>
    <item>
      <title>Delete internal table rows without using loop statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949784#M1335939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have an internal table which consists of 100 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to keep only first 5 records. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;without using the loop statement i need to delete the rest of the records. how can we achieve this result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.  delete itab1 where  "recordno"  &amp;gt; 5.&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;ZG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 14:20:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949784#M1335939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-21T14:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Delete internal table rows without using loop statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949785#M1335940</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;Use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
delete table itab from 6.  "delete all data where index &amp;gt; 5
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 14:22:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949785#M1335940</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-07-21T14:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Delete internal table rows without using loop statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949786#M1335941</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;SORT itab  BY "field name" DESCENDING. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE itab FROM 6. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 14:24:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949786#M1335941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-21T14:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Delete internal table rows without using loop statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949787#M1335942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use as :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete itab1 from 5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 14:24:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949787#M1335942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-21T14:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Delete internal table rows without using loop statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949788#M1335943</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;Delete itab [FROM idx1] [TO idx2] {Where (log_exp)]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To delete several lines at once, you have to specify at least one of the additions FROM, TO, or WHERE. You can only use the additions FROM and TO with standard tables and sorted tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete itab [FROM idx1]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you specify FROM, all the table rows from the table index idx1 onwards are included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete itab [TO idx2]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you specify TO, all the table rows from the table index idx2 onwards are included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_carrid TYPE sflight-carrid, &lt;/P&gt;&lt;P&gt;            p_connid TYPE sflight-connid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF seats, &lt;/P&gt;&lt;P&gt;        fldate    TYPE sflight-fldate, &lt;/P&gt;&lt;P&gt;        seatsocc  TYPE sflight-seatsocc, &lt;/P&gt;&lt;P&gt;        seatsmax  TYPE sflight-seatsmax, &lt;/P&gt;&lt;P&gt;        seatsfree TYPE sflight-seatsocc, &lt;/P&gt;&lt;P&gt;      END OF seats. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA seats_tab LIKE STANDARD TABLE OF seats. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT fldate seatsocc seatsmax &lt;/P&gt;&lt;P&gt;       FROM sflight &lt;/P&gt;&lt;P&gt;       INTO TABLE seats_tab &lt;/P&gt;&lt;P&gt;       WHERE carrid = p_carrid AND &lt;/P&gt;&lt;P&gt;             connid = p_connid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT seats_tab INTO seats. &lt;/P&gt;&lt;P&gt;  seats-seatsfree = seats-seatsmax - seats-seatsocc. &lt;/P&gt;&lt;P&gt;  MODIFY seats_tab INDEX sy-tabix FROM seats. &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT seats_tab BY seatsfree DESCENDING. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE seats_tab FROM 5. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;ShreeMohan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ShreeMohan Pugalia on Jul 21, 2009 4:28 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 14:26:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-internal-table-rows-without-using-loop-statement/m-p/5949788#M1335943</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-21T14:26:51Z</dc:date>
    </item>
  </channel>
</rss>

