<?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 Internal Table sort order in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310578#M1636431</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 some problem with my program.&lt;/P&gt;&lt;P&gt;When I sort an internal data, result is different depends on application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB BY STR1 STR2.&lt;/P&gt;&lt;P&gt;&amp;lt;APP1&amp;gt;&lt;/P&gt;&lt;P&gt;STR1	STR2	STR3	STR4	INT1&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	CCCC1	DDDD1	1&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	EEEE1	CCCC1	2&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	DDDD1	CCCC1	2&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	DDDD1	CCCC1	1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;APP2&amp;gt;&lt;/P&gt;&lt;P&gt;STR1	STR2	STR3	STR4	INT1&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	CCCC1	DDDD1	1&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	DDDD1	CCCC1	2&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	DDDD1	CCCC1	1&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	EEEE1	CCCC1	1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can be the reason for this situation?&lt;/P&gt;&lt;P&gt;(any SAP/DB parameter? DB setting?)&lt;/P&gt;&lt;P&gt;*APP1 is oracle 10g and APP2 is oracle 11g System.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Nov 2011 08:23:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-11-10T08:23:47Z</dc:date>
    <item>
      <title>Internal Table sort order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310578#M1636431</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 some problem with my program.&lt;/P&gt;&lt;P&gt;When I sort an internal data, result is different depends on application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB BY STR1 STR2.&lt;/P&gt;&lt;P&gt;&amp;lt;APP1&amp;gt;&lt;/P&gt;&lt;P&gt;STR1	STR2	STR3	STR4	INT1&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	CCCC1	DDDD1	1&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	EEEE1	CCCC1	2&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	DDDD1	CCCC1	2&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	DDDD1	CCCC1	1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;APP2&amp;gt;&lt;/P&gt;&lt;P&gt;STR1	STR2	STR3	STR4	INT1&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	CCCC1	DDDD1	1&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	DDDD1	CCCC1	2&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	DDDD1	CCCC1	1&lt;/P&gt;&lt;P&gt;AAAAA	BBBBB	EEEE1	CCCC1	1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can be the reason for this situation?&lt;/P&gt;&lt;P&gt;(any SAP/DB parameter? DB setting?)&lt;/P&gt;&lt;P&gt;*APP1 is oracle 10g and APP2 is oracle 11g System.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 08:23:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310578#M1636431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-10T08:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table sort order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310579#M1636432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This has nothing to do with application server. Even within the same server the same table if it is sorted twice will show different order for records that are duplicated on the sort key fields, after each sorting. The order of records that are duplicated on the sort key is not guaranteed with normal SORT command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is STABLE addition to SORT statement which will guarantee you that the record order is maintained even if the records are duplicated on SORT keys. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer SAP documentation for SORT with STABLE addition. Though, STABLE edition makes the SORT slower&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer this: &lt;A href="http://help.sap.com/abapdocu_70/en/ABAPSORT_ITAB.htm#&amp;amp;ABAP_ADDITION_1@1@" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABAPSORT_ITAB.htm#&amp;amp;ABAP_ADDITION_1@1@&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 08:30:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310579#M1636432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-10T08:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table sort order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310580#M1636433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;But in this case, the sort result is always same on the same server.&lt;/P&gt;&lt;P&gt;So.. I`m thinking that the reason could be DB version or SAP/DB Parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any information about this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 09:16:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310580#M1636433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-10T09:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table sort order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310581#M1636434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In addition, the default LOCALE (language settings) of the application server can lead to differences in sorting. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer the last secton of SET LOCALE command, where this is explained: &lt;A href="http://help.sap.com/abapdocu_70/en/ABAPSET_LOCALE.htm" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABAPSET_LOCALE.htm&lt;/A&gt;. So you can play around with SET LOCAL and force the LOCALE setting to one value on both the servers rather than letting them to default to possibly different values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want your sorting to be more predictable may be you can consider using the other fields in the sort key so that the record positions are guaranteed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 09:28:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310581#M1636434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-10T09:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table sort order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310582#M1636435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I agree with Vishnu, if you are interested in record positions of column STR3, include it in your sort key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 10:04:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-sort-order/m-p/8310582#M1636435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-10T10:04:25Z</dc:date>
    </item>
  </channel>
</rss>

