<?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 iNternal table for multiple field values in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654501#M1866575</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Abaper G,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field values are not in order as per your priority. It is better you do it as per Mr. &lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="854200" data-username="stefanseeburger" href="https://answers.sap.com/people/stefanseeburger"&gt;Stefan Seeburger &lt;/A&gt;&lt;/STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="854200" data-username="stefanseeburger" href="https://answers.sap.com/people/stefanseeburger"&gt;comment.&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Oct 2014 07:15:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-10-09T07:15:52Z</dc:date>
    <item>
      <title>Sort iNternal table for multiple field values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654495#M1866569</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; I want to sort internal table single field but based on this fields values preioritised.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fields priority are:&lt;/P&gt;&lt;P&gt;Field = 'aabb'&lt;/P&gt;&lt;P&gt;Field = 'aaaa'&lt;/P&gt;&lt;P&gt;Field = 'aacc'&lt;/P&gt;&lt;P&gt;Field = 'ddgg'.&lt;/P&gt;&lt;P&gt;interbale table should sort accoring to above values coming&lt;/P&gt;&lt;P&gt;. please suggest how to achive this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abaper&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 19:38:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654495#M1866569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-08T19:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sort iNternal table for multiple field values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654496#M1866570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the past I have built a sort field that I concatenated the fields that I wanted to sort on into.&amp;nbsp; I think a variation on this theme would work fine.&amp;nbsp; Please note, in this case, concatenate is a euphamism.&amp;nbsp; So, say that field 1 was at max 10 characters long.&amp;nbsp; then field 2 started in the 11th character.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 19:55:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654496#M1866570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-08T19:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sort iNternal table for multiple field values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654497#M1866571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sort itab by field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 19:55:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654497#M1866571</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2014-10-08T19:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sort iNternal table for multiple field values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654498#M1866572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi neal,&lt;/P&gt;&lt;P&gt;But I have internal table with 50 fields but want to sort table based on only one fields values menationed above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 20:06:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654498#M1866572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-08T20:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sort iNternal table for multiple field values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654499#M1866573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the below code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SORT &lt;/STRONG&gt;Internal_table &lt;STRONG&gt;BY &lt;/STRONG&gt;aabb aaaa aacc ddgg.&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>Thu, 09 Oct 2014 06:48:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654499#M1866573</guid>
      <dc:creator>former_member1716</dc:creator>
      <dc:date>2014-10-09T06:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sort iNternal table for multiple field values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654500#M1866574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class="j-post-author"&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="145928" data-username="gita.patil" href="https://answers.sap.com/people/gita.patil"&gt;Abaper G&lt;/A&gt;&lt;/STRONG&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;is your field a field of the internal table or a separate field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also what is the difference between 'aabb' and 'aacc'&lt;/P&gt;&lt;P&gt;both are ascending. or did you want to explain sort by value1, value2, value3?&lt;/P&gt;&lt;P&gt;or for "aacc" you dont want "bb" to be part of the result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it sounds like you want a sort that cant be done by "sort"-command.&lt;/P&gt;&lt;P&gt;easiest way is to add a field to the tab named "prio" (or something like that)&lt;/P&gt;&lt;P&gt;that you fill with "int"-values ond sort by them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Stefan Seeburger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 07:04:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654500#M1866574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-09T07:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sort iNternal table for multiple field values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654501#M1866575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Abaper G,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field values are not in order as per your priority. It is better you do it as per Mr. &lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="854200" data-username="stefanseeburger" href="https://answers.sap.com/people/stefanseeburger"&gt;Stefan Seeburger &lt;/A&gt;&lt;/STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="854200" data-username="stefanseeburger" href="https://answers.sap.com/people/stefanseeburger"&gt;comment.&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 07:15:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654501#M1866575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-09T07:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sort iNternal table for multiple field values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654502#M1866576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt; I doubt whether I got your question correctly, but you could try to build one sort order using some concatenate statements, and adding a sort alphabet.&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Something like aa&lt;STRONG&gt;a&lt;/STRONG&gt;bb&lt;STRONG&gt; - &lt;/STRONG&gt;First sort value, &lt;STRONG&gt;a in third position&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;aa&lt;STRONG&gt;b&lt;/STRONG&gt;aa - Second sort value&lt;STRONG&gt; b in third position&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aa&lt;STRONG&gt;d&lt;/STRONG&gt;cc - Third sort value &lt;STRONG&gt;d in&lt;/STRONG&gt; &lt;STRONG&gt;third position&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dd&lt;STRONG&gt;e&lt;/STRONG&gt;gg - Fourth sort value &lt;STRONG&gt;e in third positon.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;Then you could use something like Sort As Text , &lt;/EM&gt;&lt;A href="http://help.sap.com/abapdocu_702/en/abapsort_itab.htm" title="http://help.sap.com/abapdocu_702/en/abapsort_itab.htm"&gt;Sort As Text&lt;/A&gt;&lt;EM&gt;&lt;A href="http://help.sap.com/saphelp_46c/helpdata/en/fc/eb3800358411d1829f0000e829fbfe/content.htm" title="http://help.sap.com/saphelp_46c/helpdata/en/fc/eb3800358411d1829f0000e829fbfe/content.htm"&gt; &lt;/A&gt;and later delete the extra alphabet used for sorting.&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;PS: 1) The idea all depends on assuming that your values (ie aabb, aaaa, aacc, ddgg) will be fixed.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 07:18:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654502#M1866576</guid>
      <dc:creator>philipdavy</dc:creator>
      <dc:date>2014-10-09T07:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sort iNternal table for multiple field values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654503#M1866577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If condition 1&lt;/P&gt;&lt;P&gt;Sort itab by fieldx&lt;/P&gt;&lt;P&gt;elseif condition2&lt;/P&gt;&lt;P&gt;Sort itab by fieldy&lt;/P&gt;&lt;P&gt;elseif condition3&lt;/P&gt;&lt;P&gt;Sort itab by fieldz&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That meets the explanations by the others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or mine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab&lt;/P&gt;&lt;P&gt;&amp;nbsp; move itab[filed chosen] to itab-sortfield&lt;/P&gt;&lt;P&gt;&amp;nbsp; modify&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;sort itab by sortfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mine then has you using field symbols to assign which field you are sorting on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've never tried a field symbol in a sort, so I didn't suggest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by &amp;lt;fs&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might work, but again I've never tried it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 14:16:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-for-multiple-field-values/m-p/10654503#M1866577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-09T14:16:54Z</dc:date>
    </item>
  </channel>
</rss>

