<?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: sort order in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-order/m-p/2999663#M708620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you wnat perfect sort than you can convert this date to system formatted date and than sort it. I know, this is cumbersome but this is the only way .. I think so..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this sort of code to make your in date to system date for all records and than use the SORT ITAB BY SY_DATE for sorting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: L_DATE(20) TYPE C.
DATA: L_SY_DATE TYPE D.


L_DATE = 'MAR 15 2006'.


SELECT SINGLE MNR
FROM T247
INTO L_SY_DATE+4(2)
WHERE KTX = L_DATE+0(3).

L_SY_DATE+0(4) = L_DATE+7(4).
L_SY_DATE+6(2) = L_DATE+4(2).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Nov 2007 17:19:01 GMT</pubDate>
    <dc:creator>naimesh_patel</dc:creator>
    <dc:date>2007-11-09T17:19:01Z</dc:date>
    <item>
      <title>sort order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-order/m-p/2999662#M708619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have to sort the date field which is in [eg MAR 15 2006] &lt;/P&gt;&lt;P&gt;the data is coming in this way , when i am sorting the ITAb it is not sorting &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sending this data to EXCEL sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you please any one tell me the way how to sort the data when date comes in this manner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 17:07:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-order/m-p/2999662#M708619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-09T17:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: sort order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-order/m-p/2999663#M708620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you wnat perfect sort than you can convert this date to system formatted date and than sort it. I know, this is cumbersome but this is the only way .. I think so..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this sort of code to make your in date to system date for all records and than use the SORT ITAB BY SY_DATE for sorting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: L_DATE(20) TYPE C.
DATA: L_SY_DATE TYPE D.


L_DATE = 'MAR 15 2006'.


SELECT SINGLE MNR
FROM T247
INTO L_SY_DATE+4(2)
WHERE KTX = L_DATE+0(3).

L_SY_DATE+0(4) = L_DATE+7(4).
L_SY_DATE+6(2) = L_DATE+4(2).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 17:19:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-order/m-p/2999663#M708620</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2007-11-09T17:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: sort order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-order/m-p/2999664#M708621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should fix the date data...Convert MAR to 03 and concatenate the other values so you end with...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
20060315
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use an internal table to get the range...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
JAN --&amp;gt; 01
FEB --&amp;gt; 02
MAR --&amp;gt; 03

and so on...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way, you could use SORT without any problems -:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 17:20:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-order/m-p/2999664#M708621</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-09T17:20:47Z</dc:date>
    </item>
  </channel>
</rss>

