<?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/1902113#M376570</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;Here I will give you one example try to understand the scenario...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let us take you have an internal table with two fields. WERKS, for the site, and ERZET, for time counts were created. ERZET will either have a valid time or be blank (article wasn't counted). You need the earliest time brought to the top of the internal table for each site, but not the blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If You sort descending by WERKS ERZET You will get the latest ERZET by site. If You sort ascending by WERKS ERZET you will  get the blank ERZET by site.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So based on the above scenario you r sorting based on two fields, even though you can sort with one filed the results would be different from the sorting with two fileds. First of all you will sort with one filed then sort with the second file and third field... So the out put will be different..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the piece of code for the above requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab2[] = itab1[].&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;delete itab2 where ERZET is initial.&lt;/P&gt;&lt;P&gt;sort itab2 ascending by WERKS ERZET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~~Guduri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Mar 2007 05:38:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-01T05:38:45Z</dc:date>
    <item>
      <title>SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902109#M376566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;         In SORT BY F1 F2 F3... statement although the sort is done using F1 field what is the use of F2 ,F3..?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 05:31:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902109#M376566</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T05:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902110#M376567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not sorted by field F1 only, the table is sorted by sequence of fields F1, F2 and F3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3800358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3800358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 05:35:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902110#M376567</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T05:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902111#M376568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you wants to do any operations on F2 and f3 using control break statments it will be useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: &lt;/P&gt;&lt;P&gt;Sort itab by F1 F2 f3.&lt;/P&gt;&lt;P&gt;Loop at itab.&lt;/P&gt;&lt;P&gt; at new F1.&lt;/P&gt;&lt;P&gt;  Do something  and..Write  something&lt;/P&gt;&lt;P&gt; at end of F1.&lt;/P&gt;&lt;P&gt;at new F2&lt;/P&gt;&lt;P&gt;  Do something  and..Write  something&lt;/P&gt;&lt;P&gt; at end of F2.&lt;/P&gt;&lt;P&gt;at new F3.&lt;/P&gt;&lt;P&gt;  Do something  and..Write  something&lt;/P&gt;&lt;P&gt; at end of F3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;Hope you understood.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 05:36:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902111#M376568</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T05:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902112#M376569</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 u just specify &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT itab by F1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;, it will sort based on F1 alone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say if u &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT itab by serialno DATE&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will sort first based on number then Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can try this out using a sample code.&lt;/P&gt;&lt;P&gt;Reward if this helsp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 05:38:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902112#M376569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T05:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902113#M376570</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;Here I will give you one example try to understand the scenario...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let us take you have an internal table with two fields. WERKS, for the site, and ERZET, for time counts were created. ERZET will either have a valid time or be blank (article wasn't counted). You need the earliest time brought to the top of the internal table for each site, but not the blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If You sort descending by WERKS ERZET You will get the latest ERZET by site. If You sort ascending by WERKS ERZET you will  get the blank ERZET by site.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So based on the above scenario you r sorting based on two fields, even though you can sort with one filed the results would be different from the sorting with two fileds. First of all you will sort with one filed then sort with the second file and third field... So the out put will be different..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the piece of code for the above requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab2[] = itab1[].&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;delete itab2 where ERZET is initial.&lt;/P&gt;&lt;P&gt;sort itab2 ascending by WERKS ERZET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~~Guduri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 05:38:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902113#M376570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T05:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902114#M376571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Prashanth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose u hav an internal table with these three fields and you want to sort it using f1 f2 and f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this means that the internal table will be sorted first by F1 then F2 and then F3 but here f3 values are dependent on f2 values and f2 on f1. Sort itab by f1 f2 f3 will fetch the relevant values or the order of fields on the output list will be f1 f2 and f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;shamim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 05:40:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902114#M376571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T05:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902115#M376572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;This statement determined the sort order f1, f2, fn (upto 250)..&lt;/P&gt;&lt;P&gt;It will sort according to this order , instead of the default tabke key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siddhi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 05:41:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902115#M376572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T05:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902116#M376573</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;Let us do it with an example.&lt;/P&gt;&lt;P&gt;We have a internal table itab consists of 3 fields - Name,Age, TotalIncome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we sort the the itab by Name Age Totalincome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data is first sorted by Name in alphabetic order and the age &amp;amp; Lastly by the Totalincome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose the data in itab is &lt;/P&gt;&lt;P&gt;sreejesh	30	320000&lt;/P&gt;&lt;P&gt;harsha	28	4500&lt;/P&gt;&lt;P&gt;vijay	45	8000&lt;/P&gt;&lt;P&gt;avinash	90	120000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After sorting &lt;/P&gt;&lt;P&gt;avinash	90	120000&lt;/P&gt;&lt;P&gt;harsha	28	4500&lt;/P&gt;&lt;P&gt;sreejesh	30	320000&lt;/P&gt;&lt;P&gt;vijay	45	8000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 05:46:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902116#M376573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T05:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: SORT BY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902117#M376574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Prasanth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  EX : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      F1       F2       F3&lt;/P&gt;&lt;P&gt;       A         1         101&lt;/P&gt;&lt;P&gt;       A         2         102&lt;/P&gt;&lt;P&gt;       A         1         103&lt;/P&gt;&lt;P&gt;       A         1         102&lt;/P&gt;&lt;P&gt;       B         1         101      &lt;/P&gt;&lt;P&gt;       A         2         101&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;If you sort by F1 only  records will be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       F1       F2       F3&lt;/P&gt;&lt;P&gt;       A         1         101&lt;/P&gt;&lt;P&gt;       A         2         102&lt;/P&gt;&lt;P&gt;       A         1         103&lt;/P&gt;&lt;P&gt;       A         1         102       &lt;/P&gt;&lt;P&gt;       A         2         101&lt;/P&gt;&lt;P&gt;       B         1         101      &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you sort by F1 F2 F3 only  records will be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       F1       F2       F3&lt;/P&gt;&lt;P&gt;       A         1         101&lt;/P&gt;&lt;P&gt;       A         1         102       &lt;/P&gt;&lt;P&gt;       A         1         103              &lt;/P&gt;&lt;P&gt;       A         2         101&lt;/P&gt;&lt;P&gt;       A         2         102&lt;/P&gt;&lt;P&gt;       B         1         101   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the order .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls. mark if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 05:51:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-by/m-p/1902117#M376574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T05:51:12Z</dc:date>
    </item>
  </channel>
</rss>

