<?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: Read internal table in reverse order in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689715#M1102400</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;Consider the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Data: v_cntr  type i.
   Data: v_lines type i.

 *  use describe to get the number of records in internal table
    Describe table itab lines v_lines.

    v_cntr  = v_lines.
    do v_lines times.
    
       check v_cntr &amp;gt; 0. "not really needed
       read table itab into wa index v_cntr.
*      do the further operation here with wa...
*      you must not delete any record from itab here.If you do, this code gives a dump       
       v_cntr = v_cntr - 1.

    enddo.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Regards,&lt;/P&gt;&lt;P&gt;  Prasad.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Oct 2008 22:34:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-28T22:34:02Z</dc:date>
    <item>
      <title>Read internal table in reverse order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689712#M1102397</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 have got a problem. This may be very simple for you guys but just wanted to know how do I read internal table in reverse order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg. Internal table holds values 05,01,03 then I want to read them as 03,01,05.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Murtuza Kharodawala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 22:04:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689712#M1102397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T22:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Read internal table in reverse order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689713#M1102398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

DATA: BEGIN OF itab OCCURS 0,
        f1(02),
      END   OF itab.

DATA no_lines TYPE sy-tabix.

MOVE: '05' TO itab-f1.
APPEND itab.
MOVE: '01' TO itab-f1.
APPEND itab.
MOVE: '03' TO itab-f1.
APPEND itab.

DESCRIBE TABLE itab LINES no_lines.

DO.
  READ TABLE itab INDEX no_lines.
  WRITE: /001 itab-f1.
  no_lines = no_lines - 1.
  IF no_lines &amp;lt; 1.
    EXIT.
  ENDIF.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 22:24:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689713#M1102398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T22:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Read internal table in reverse order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689714#M1102399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read rows in reverse order? or columns in reverse?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;find the total # of records in the table using describe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab index id1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id1 = id1 - 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if id1 = 0. exit. endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end do&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 22:24:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689714#M1102399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T22:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Read internal table in reverse order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689715#M1102400</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;Consider the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Data: v_cntr  type i.
   Data: v_lines type i.

 *  use describe to get the number of records in internal table
    Describe table itab lines v_lines.

    v_cntr  = v_lines.
    do v_lines times.
    
       check v_cntr &amp;gt; 0. "not really needed
       read table itab into wa index v_cntr.
*      do the further operation here with wa...
*      you must not delete any record from itab here.If you do, this code gives a dump       
       v_cntr = v_cntr - 1.

    enddo.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Regards,&lt;/P&gt;&lt;P&gt;  Prasad.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 22:34:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689715#M1102400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T22:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Read internal table in reverse order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689716#M1102401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;was your code different than the above 2?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 22:35:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table-in-reverse-order/m-p/4689716#M1102401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T22:35:50Z</dc:date>
    </item>
  </channel>
</rss>

