<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790089#M650810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the structure or field sequence of your table ipos?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When sorting a table, be sure that the fields are listed as first, second, third.... index in your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example your ipos should be contain:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of ipos occurs 0,
        kda like ...,
        pos like ...,
        udate  like ...,
        UTIME like ...,
        fieldxxx like ...,
        fieldxxx like ...,
        fieldxxx like ...,
end of ipos.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Sep 2007 08:11:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-07T08:11:40Z</dc:date>
    <item>
      <title>sort</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790086#M650807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i have done sorting as follows, but its not working properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort ipos by kda pos udate UTIME descending.&lt;/P&gt;&lt;P&gt;loop at it_final.&lt;/P&gt;&lt;P&gt;read table ipos with key kda = it_final-kdauf pos = it_final-kdpos.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;it_final-budat = ipos-udate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;55002964      10   20070907     124549            &lt;/P&gt;&lt;P&gt;55002964      20   20070907     124519            &lt;/P&gt;&lt;P&gt;55002964      20   20070907     112943            &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   what could be the reason, how to solve this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajaram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 08:04:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790086#M650807</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T08:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790087#M650808</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;sometimes the sequense of your fields are relevant.&lt;/P&gt;&lt;P&gt;Take a look to your definition IPOS and set at first the field KDA.&lt;/P&gt;&lt;P&gt;It should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nicole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 08:07:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790087#M650808</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T08:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790088#M650809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajaram..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do this way...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort ipos by kda pos  &amp;lt;b&amp;gt;Ascending &amp;lt;/b&amp;gt; UDATE  UTIME descending.&lt;/P&gt;&lt;P&gt;loop at it_final.&lt;/P&gt;&lt;P&gt;read table ipos with key kda = it_final-kdauf pos = it_final-kdpos &amp;lt;b&amp;gt;binary search.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;it_final-budat = ipos-udate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;REWARD IF HELPFUL.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 08:08:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790088#M650809</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-09-07T08:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790089#M650810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the structure or field sequence of your table ipos?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When sorting a table, be sure that the fields are listed as first, second, third.... index in your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example your ipos should be contain:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of ipos occurs 0,
        kda like ...,
        pos like ...,
        udate  like ...,
        UTIME like ...,
        fieldxxx like ...,
        fieldxxx like ...,
        fieldxxx like ...,
end of ipos.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 08:11:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790089#M650810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T08:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790090#M650811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi rajaram,&lt;/P&gt;&lt;P&gt;    as per ur coding it is getting sorted by the utime descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u want to do sorting descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then u can use this kind of coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;sort ipos descending by kda pos udate.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 08:13:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790090#M650811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T08:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790091#M650812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort ipos by udate UTIME descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_final.&lt;/P&gt;&lt;P&gt;read table ipos with key kda = it_final-kdauf pos = it_final-kdpos binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;it_final-budat = ipos-udate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i tried this way also, but the descending is not working properly yar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 08:17:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790091#M650812</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T08:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790092#M650813</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;If this is the result you are getting when you execute the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort ipos by udate UTIME descending&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      udate     utime &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;55002964 10 20070907 124549 &lt;/P&gt;&lt;P&gt;55002964 20 20070907 124519 &lt;/P&gt;&lt;P&gt;55002964 20 20070907 112943 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;then it is correct.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time is sorted correctly 12:45:49&amp;gt; 12:45:19&amp;gt; 11:29:43.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 08:22:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790092#M650813</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-09-07T08:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790093#M650814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why don't you look into the documentation ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort ipos {ascending| descending} by ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;has an effect on ALL fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort ipos by field1 field2 descending&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;works only on field2, acending is default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; Everything is fine!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any you should use binary search for the read, then you must sort ipos by kda and pos, and you sort it acending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; from my side your program would be o.k., if you add binary search to the read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 08:37:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/2790093#M650814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T08:37:34Z</dc:date>
    </item>
  </channel>
</rss>

