<?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: Strange Problem in sorting an internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701414#M1670906</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ohh sorry..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dint notice that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Jan 2016 18:28:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-01-05T18:28:14Z</dc:date>
    <item>
      <title>Strange Problem in sorting an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701409#M1670901</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;I am really confused with how the below sorting is working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple statement: SORT ITAB by LIFNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st Scenario: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I have around 13-14 records in my internal table &lt;/P&gt;&lt;P&gt;1.Vendor&amp;nbsp; 2000000029 Company Code 1176&amp;nbsp;&amp;nbsp;&amp;nbsp; EKORG 1176&amp;nbsp; Name1 Test&lt;/P&gt;&lt;P&gt;2.Vendor 2000000021&amp;nbsp; Company Code 1176&amp;nbsp;&amp;nbsp;&amp;nbsp; EKORG 1176&amp;nbsp; Name1 test2&lt;/P&gt;&lt;P&gt;3.Vendor&amp;nbsp; 2000000029 Company Code 1176&amp;nbsp;&amp;nbsp;&amp;nbsp; EKORG 1176&amp;nbsp; Name1 BLANK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when i sort the above results i get the 3rd record at second place where name1 is blank i dnt know why this happened, i was expecting &lt;/P&gt;&lt;P&gt;2nd record then 1st then 3rd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i increased the range of my selection it worked , strange how sort mechanism is working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should i add more keys here i mean i wanted to know what is wrong here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 16:14:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701409#M1670901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-05-03T16:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Problem in sorting an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701410#M1670902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to maintain the original order where the sort field has the same value, you have to add the keyword STABLE to the SORT command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 16:22:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701410#M1670902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-05-03T16:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Problem in sorting an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701411#M1670903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok i will try with stable and look into it.&lt;/P&gt;&lt;P&gt;One more question i have is in debugging i skipped the sort statement on internal table&lt;/P&gt;&lt;P&gt;and since i am displaying the data in ALV i am sorting my output using method Add_SOrt on lfinr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i skip the sort statement and let the method do it , its giving correct results.&lt;/P&gt;&lt;P&gt;So is the sort in Add_sort do the stable sorting and not the sort statement??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 16:27:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701411#M1670903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-05-03T16:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Problem in sorting an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701412#M1670904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi B M,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code must as given below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT itab STABLE BY lifnr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Satish &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 17:11:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701412#M1670904</guid>
      <dc:creator>former_member1716</dc:creator>
      <dc:date>2016-01-05T17:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Problem in sorting an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701413#M1670905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please note the date of the OP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 18:20:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701413#M1670905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-01-05T18:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Problem in sorting an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701414#M1670906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ohh sorry..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dint notice that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 18:28:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strange-problem-in-sorting-an-internal-table/m-p/8701414#M1670906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-01-05T18:28:14Z</dc:date>
    </item>
  </channel>
</rss>

