<?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 Itab in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882656#M677086</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashwini,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Sort itab by field1 &lt;/P&gt;&lt;P&gt;   will sort the itab by field 1 i.e.,customer number.The other fields related to field1(i.e.description) also gets sorted automatically according to the key field (customer number).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt; Shanmugapriya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Oct 2007 12:19:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-08T12:19:42Z</dc:date>
    <item>
      <title>Sort Itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882653#M677083</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;Can anyone tell me how will this statement behave&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort itab by field1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where my itab has 2 fields 1 is customer no and 2 is description.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now , here the sort is sorting the itab by fields 1 as well by description.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anyone please tell me is this behavior normal for sap i:e after field one system will sort itab by field 2 also without mentioning in the SORT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks n Regards,&lt;/P&gt;&lt;P&gt;AShwini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2007 11:38:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882653#M677083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-08T11:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882654#M677084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashwini,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System will not automaticaly sort itab by field2 unless mentioned. It does happen if the entries in database tables are already in sorted form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else you need to mention both fields in sorting.&lt;/P&gt;&lt;P&gt;sort itab by field1 field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arati.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2007 12:02:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882654#M677084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-08T12:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882655#M677085</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;you can do that by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by field1 feild2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; simply sort itab &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if usefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2007 12:19:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882655#M677085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-08T12:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882656#M677086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashwini,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Sort itab by field1 &lt;/P&gt;&lt;P&gt;   will sort the itab by field 1 i.e.,customer number.The other fields related to field1(i.e.description) also gets sorted automatically according to the key field (customer number).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt; Shanmugapriya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2007 12:19:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882656#M677086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-08T12:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882657#M677087</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;when you use sort itab field1 field2 ... fieldn (you can use optional ascending or descending)&lt;/P&gt;&lt;P&gt;you specific the priority sort to your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Field1 Field2 Field3&lt;/P&gt;&lt;P&gt;A........104........2&lt;/P&gt;&lt;P&gt;A........105........2&lt;/P&gt;&lt;P&gt;A........106........6&lt;/P&gt;&lt;P&gt;B........107........7&lt;/P&gt;&lt;P&gt;B........108........7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you just use sort itab by field, the table is sorted by this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to see the abap help about sort, there are useful samples here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2007 19:50:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882657#M677087</guid>
      <dc:creator>rodrigo_paisante3</dc:creator>
      <dc:date>2007-10-08T19:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882658#M677088</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;supposse the IT has the following records,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cust-id        cust-desc&lt;/P&gt;&lt;P&gt;104             doctor&lt;/P&gt;&lt;P&gt;101             doctor&lt;/P&gt;&lt;P&gt;105             student&lt;/P&gt;&lt;P&gt;102             merchant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT tbl_cust by cust-id.&lt;/P&gt;&lt;P&gt;then tbl_cust contain records like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cust-id        cust-desc&lt;/P&gt;&lt;P&gt;101             doctor&lt;/P&gt;&lt;P&gt;102             merchant.&lt;/P&gt;&lt;P&gt;104             doctor&lt;/P&gt;&lt;P&gt;105             student&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In above sort statement sorth the records a/c to cust-id in acending order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT tbl_cust by cust-desc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then tbl_cust contain records like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cust-id        cust-desc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;104             doctor&lt;/P&gt;&lt;P&gt;101             doctor&lt;/P&gt;&lt;P&gt;102             merchant.&lt;/P&gt;&lt;P&gt;105             student&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In above sort statement  the records a/c to cust-description in alphabetical order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT tbl_cust by cust-desc cust-id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then tbl_cust contain records like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cust-id        cust-desc&lt;/P&gt;&lt;P&gt;101             doctor&lt;/P&gt;&lt;P&gt;104             doctor&lt;/P&gt;&lt;P&gt;102             merchant.&lt;/P&gt;&lt;P&gt;105             student&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In above sort statement, the records first sort a/c to cust-desc&lt;/P&gt;&lt;P&gt;104             doctor&lt;/P&gt;&lt;P&gt;101             doctor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; then it sort agian cust-id in acending order.then finally it sort into&lt;/P&gt;&lt;P&gt;101             doctor&lt;/P&gt;&lt;P&gt;104             doctor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope you can understand with above examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward with points if helpful.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2007 05:37:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882658#M677088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-09T05:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882659#M677089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It may be the case that your DB table (for where you are working on the internal table) is a sorted table and the sorted field is by default Field 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence, in your case, its better to write the sort statement as :&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;sort itab by field 1 field 2.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Anindita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2007 11:32:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-itab/m-p/2882659#M677089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-10T11:32:05Z</dc:date>
    </item>
  </channel>
</rss>

