<?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 the Characters in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525733#M1854677</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Philip, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not want to sort field3 as decscneding.&lt;/P&gt;&lt;P&gt;My question is :&lt;/P&gt;&lt;P&gt;I want to know the reason why it is sorting in descending order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Aug 2014 07:24:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-08-04T07:24:14Z</dc:date>
    <item>
      <title>Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525725#M1854669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got an issue while sorting the Character values. Not sure why the same sort statement working differently with the same code in different systems (Dev and quality servers).Example of the issue is described below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In quality:&lt;/P&gt;&lt;P&gt;We have &lt;STRONG style="text-decoration: underline;"&gt;internal table itab1&lt;/STRONG&gt; with the below format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field3&lt;/P&gt;&lt;P&gt;1001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ab1&amp;nbsp; &lt;/P&gt;&lt;P&gt;1001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ab2 &lt;/P&gt;&lt;P&gt;1001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ab3&lt;/P&gt;&lt;P&gt;1001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ab4&lt;/P&gt;&lt;P&gt;1001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ab5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above internal table, after sorting with field1 and field2 , it sorted as below: (SORT itab1 BY field1 field2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field3&lt;/P&gt;&lt;P&gt;1001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ab5&amp;nbsp; &lt;/P&gt;&lt;P&gt;1001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ab4 &lt;/P&gt;&lt;P&gt;1001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ab3&lt;/P&gt;&lt;P&gt;1001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ab2&lt;/P&gt;&lt;P&gt;1001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ab1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whereas, in dev server, it is not getting sorted, since the values inbotht the fields are same. And this is how it should work in quality server.&lt;/P&gt;&lt;P&gt;Could you please helpme in finding out the reason? Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 06:33:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525725#M1854669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-04T06:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525726#M1854670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;Did you add Sort &lt;STRONG&gt;Field3&lt;/STRONG&gt; Descending.&amp;nbsp; ?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 06:38:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525726#M1854670</guid>
      <dc:creator>philipdavy</dc:creator>
      <dc:date>2014-08-04T06:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525727#M1854671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kavi,&lt;/P&gt;&lt;P&gt;Try this, SORT itab1 BY field1 field2 STABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Archer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 06:49:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525727#M1854671</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-04T06:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525728#M1854672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Philip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No....only I have field1 and field2 in the sort statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 06:50:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525728#M1854672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-04T06:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525729#M1854673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dengyong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion. But this issue is not the code changes, I have to analyse and need to give them the reason on why the same statement is working like that in Quality server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 06:53:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525729#M1854673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-04T06:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525730#M1854674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kavi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do as Dengyong said use SORT with STABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this link will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiki.scn.sap.com/wiki/display/snippets/difference+between+sort+and+sort+stable?original_fqdn=wiki.sdn.sap.com&amp;amp;bc=true" title="http://wiki.scn.sap.com/wiki/display/snippets/difference+between+sort+and+sort+stable?original_fqdn=wiki.sdn.sap.com&amp;amp;bc=true"&gt;Difference Between SORT and SORT STABLE - Code Gallery - SCN Wiki&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF I did not know STABLE, I would use SORT itab1&amp;nbsp; by field1 field2 field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vidyasagar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 07:00:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525730#M1854674</guid>
      <dc:creator>former_member212124</dc:creator>
      <dc:date>2014-08-04T07:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525731#M1854675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But you need Field 3 to be sorted descending right? Then why are you not adding Field3 into the sort criteria?&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;Philip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 07:00:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525731#M1854675</guid>
      <dc:creator>philipdavy</dc:creator>
      <dc:date>2014-08-04T07:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525732#M1854676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check data types of fields in both system.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 07:06:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525732#M1854676</guid>
      <dc:creator>former_member202818</dc:creator>
      <dc:date>2014-08-04T07:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525733#M1854677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Philip, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not want to sort field3 as decscneding.&lt;/P&gt;&lt;P&gt;My question is :&lt;/P&gt;&lt;P&gt;I want to know the reason why it is sorting in descending order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 07:24:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525733#M1854677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-04T07:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525734#M1854678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data types are same in both the systems.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 07:24:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525734#M1854678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-04T07:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525735#M1854679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kavi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you are looking for the root cause to make an explanation to someone who is asking you and I don't see an answer get the point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guess it's related to the sorting algorithm(quick sort &lt;A href="http://en.wikipedia.org/wiki/Quicksort"&gt;http://en.wikipedia.org/wiki/Quicksort&lt;/A&gt;) which is used by SAP.&lt;/P&gt;&lt;P&gt;For the sorting algorithm , the quick sort will be executed based on a &lt;STRONG&gt;pivot&lt;/STRONG&gt; which will be &lt;STRONG&gt;randomly picked&lt;/STRONG&gt; and be affected by &lt;STRONG&gt;the content of the internal table&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Probably that's the reason why you can see different results in different systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 07:47:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525735#M1854679</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-04T07:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525736#M1854680</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; The link I provided will explain the reason with example.&lt;/P&gt;&lt;P&gt;Please refer that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 11px;"&gt;&lt;STRONG&gt;SORT keyword sorts the internal table by the field we mention in the statement, either it can be ascending or descending. But the sort sequence will not be preserved, i.e, if we have a field with similar values for more than once the sort sequence might differ everytime we sort the table on that particular field. To preserve the sequence we can use keyword SORT STABLE.&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-top: 10px; font-size: 11px;"&gt;&lt;STRONG&gt;SORT STABLE keyword sorts the internal table and preserves the sort sequence. When we try to re-sort the table on the same sort criteria the sequence will not changed.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 07:49:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525736#M1854680</guid>
      <dc:creator>former_member212124</dc:creator>
      <dc:date>2014-08-04T07:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting the Characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525737#M1854681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Vidhyasagar...it is very helpful for me to findout the reason..thanks much...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 08:45:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-the-characters/m-p/10525737#M1854681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-04T08:45:43Z</dc:date>
    </item>
  </channel>
</rss>

