<?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 BY in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597681#M866382</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in ABAP editor, on statement SORT, you may press F1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remaining questions to be posted here.&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 22 Mar 2008 18:57:55 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2008-03-22T18:57:55Z</dc:date>
    <item>
      <title>SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597678#M866379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could u  plz tell me what is the purpose of using SORT statement before the loop statement??????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Priya.S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Mar 2008 17:02:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597678#M866379</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-22T17:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597679#M866380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Priya,&lt;/P&gt;&lt;P&gt;Sorting before looping is important ....take for eg that u will be sorting u r internal table by VBELN..&lt;/P&gt;&lt;P&gt;Now in u r internal table all u r VBELN will be one below the other..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose inside the loop u use AT END OF VBELN event...&lt;/P&gt;&lt;P&gt;and if u have not sorted it then this event will get trigggered even though it should not as u wont desire it..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is just an eg.&lt;/P&gt;&lt;P&gt;c if this helps you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Mar 2008 17:16:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597679#M866380</guid>
      <dc:creator>rahul2000</dc:creator>
      <dc:date>2008-03-22T17:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597680#M866381</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;By using sort statement, accessing the data from the internal will be fast, by this performance will be improved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Mar 2008 18:01:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597680#M866381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-22T18:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597681#M866382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in ABAP editor, on statement SORT, you may press F1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remaining questions to be posted here.&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Mar 2008 18:57:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597681#M866382</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2008-03-22T18:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597682#M866383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly sort statement is used to increase the performance of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is must if we are going to use the Read statement with binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It shole be used whenever we use control break statements like AT FIRST , AT LAST etc.&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;Viveks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Mar 2008 20:47:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597682#M866383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-22T20:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597683#M866384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya,&lt;/P&gt;&lt;P&gt;When ever we select data from data base table to internal table it may/maynot come in sorted order by primary keys of the table. Same SELECT Query may return different order of records for different executions.To ensure that our records in internal table are in proper order before using them we will use the statement &lt;STRONG&gt;SORT&lt;/STRONG&gt;. Also if u want to arrange the records of the internal table based on non primary keys or combination of primary and nonprimary keys then we will use sort statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Take an example. U have been given a bunch of papers&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;having page numbers on each paper and u need to find some&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;page having page number 123. IF ur bunch is not arranged as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;per the page number then it will be very difficult for u to find&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;out where page 123 will be. But if it is sorted by page number&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and given then u can easily locate the page by searching the&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pages in between 100-150.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SORT&lt;/STRONG&gt; plays an important role when u are using &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;READ TABLE WITH BINARY SEARCH.&lt;/STRONG&gt; Never Read an internal table with out binary search if ur table has more than 100 records. It will &lt;STRONG&gt;degrade the performance a lot&lt;/STRONG&gt;. And it is mandatory to sort the internal table by the same fields which are used in READ TABLE WITH KEY addition. Also BINARY SEARCH Will not work if u sort the table by descending order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coming to sorting table before loop, If u are using any AT events in the loop like AT NEW, AT END OF etc then it is mandatory to sort the internal table by the field used in the AT EVENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this clarified ur doubts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2008 04:53:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597683#M866384</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-03-23T04:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597684#M866385</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;By using sort before going to loop the internal table is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it uses BINARY SEARCH instead of linear search for accessing the data.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    if ur internal table having 16 records without sorting it takes around 16 searches to find ur need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if ur internal table is sorted it uses 4 searches to find ur need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     it raises the performance of ur access to internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Angi Reddy Somala on Mar 23, 2008 8:49 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2008 07:49:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597684#M866385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-23T07:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597685#M866386</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;sort with key is a must for the read table with key binary search statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also for control break statements to get the correct results sort above the loop is a must.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort is a must for the loop at where clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also if you use sort the performance will be better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2008 10:42:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/3597685#M866386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-23T10:42:33Z</dc:date>
    </item>
  </channel>
</rss>

