<?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: Sorting an internal table by date. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514321#M236891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello J.J&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The explicit version of your SORT statement is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT it_stpo BY andat ASCENDING
                stpoz DESCENDING.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because ASCENDING is the default sorting direction.&lt;/P&gt;&lt;P&gt;If you want to sort all fields of your itab in descending order your statement must look like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT it_stpo DESCENDING BY andat
                           stpoz.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;    Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Aug 2006 20:02:53 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2006-08-14T20:02:53Z</dc:date>
    <item>
      <title>Sorting an internal table by date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514314#M236884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SORT it_stpo BY andat stpoz DESCENDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      before sort&lt;/P&gt;&lt;P&gt;    DATUV    ANDAT    STLKN    STPOZ    &lt;/P&gt;&lt;P&gt;1. 20020118|20020118|00000002|00000004|&lt;/P&gt;&lt;P&gt;2. 20060711|20060811|00000004|00000008|&lt;/P&gt;&lt;P&gt;3. 20060801|20060811|00000005|00000011&lt;/P&gt;&lt;P&gt;4. 20020515|20020515|00000003|00000006&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AFTER SORT..&lt;/P&gt;&lt;P&gt;   DATUV    ANDAT    STLKN    STPOZ    &lt;/P&gt;&lt;P&gt;1.  20020118|20020118|00000002|00000004&lt;/P&gt;&lt;P&gt;2.  20020515|20020515|00000003|00000006|&lt;/P&gt;&lt;P&gt;3. 20060801|20060811|00000005|00000011&lt;/P&gt;&lt;P&gt;4. 20060711|20060811|00000004|00000008|&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I expected was to see Record # 3 as my first record after the sort ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2006 19:55:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514314#M236884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-14T19:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an internal table by date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514315#M236885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure DATUV &amp;amp; ANDAT are of type DATS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2006 19:58:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514315#M236885</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-08-14T19:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an internal table by date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514316#M236886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You either need to explicitly state "descending" after each filed in the sort statement or one time before all fields.  Your statement actually translates to sort it_stpo by andat ascending stpoz descending.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2006 20:00:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514316#M236886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-14T20:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an internal table by date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514317#M236887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;typed as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   BEGIN OF it_stpo OCCURS 10,&lt;/P&gt;&lt;P&gt;      datuv TYPE stpo-datuv,&lt;/P&gt;&lt;P&gt;      andat TYPE stpo-andat,&lt;/P&gt;&lt;P&gt;      stlkn TYPE stpo-stlkn,&lt;/P&gt;&lt;P&gt;      stpoz TYPE stpo-stpoz,&lt;/P&gt;&lt;P&gt;      ltxsp TYPE stpo-ltxsp,&lt;/P&gt;&lt;P&gt;      potx1 TYPE stpo-potx1,&lt;/P&gt;&lt;P&gt;   END OF it_stpo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2006 20:00:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514317#M236887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-14T20:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an internal table by date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514318#M236888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please try this statement instead.&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 it_stpo descending by andat stpoz .

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2006 20:00:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514318#M236888</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-14T20:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an internal table by date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514319#M236889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SORT it_stpo BY andat DESCENDING stpoz DESCENDING.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2006 20:01:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514319#M236889</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-14T20:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an internal table by date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514320#M236890</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;Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT it_stpo BY andat DESCENDING
                      stpoz DESCENDING.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2006 20:02:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514320#M236890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-14T20:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an internal table by date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514321#M236891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello J.J&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The explicit version of your SORT statement is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT it_stpo BY andat ASCENDING
                stpoz DESCENDING.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because ASCENDING is the default sorting direction.&lt;/P&gt;&lt;P&gt;If you want to sort all fields of your itab in descending order your statement must look like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT it_stpo DESCENDING BY andat
                           stpoz.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;    Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2006 20:02:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-an-internal-table-by-date/m-p/1514321#M236891</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-08-14T20:02:53Z</dc:date>
    </item>
  </channel>
</rss>

