<?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! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347101#M174635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to dynamically assign the field name chosen by the user to a variable and use that in your sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: v_fieldname like dd03l-fieldname.

move user_choice to v_fieldname.

sort itab by (v_user_choice).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 May 2006 20:54:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-23T20:54:41Z</dc:date>
    <item>
      <title>Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347099#M174633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have an internal table and using a report i list all the fields of the internal table. Now I have a sort button in the pf-status. when i click this button it asks for three fields to sort from. So how do i sort the internal table by using the fields given by the user in the slection screen. Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vicky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2006 20:42:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347099#M174633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T20:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347100#M174634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vicky Vicky!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...sort internaltablename by field1 field2...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you not just sort the itab and then redisplay?  If that's not what you meant, please ask again.&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;Den&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2006 20:50:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347100#M174634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T20:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347101#M174635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to dynamically assign the field name chosen by the user to a variable and use that in your sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: v_fieldname like dd03l-fieldname.

move user_choice to v_fieldname.

sort itab by (v_user_choice).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2006 20:54:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347101#M174635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T20:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347102#M174636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And... maybe you'll need to use field-symbols.  Consult the help page for this in your abap program or refer to&lt;/P&gt;&lt;P&gt; &lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2006 20:54:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347102#M174636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T20:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347103#M174637</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 is the info copied from help.sap.com.&lt;/P&gt;&lt;P&gt;yes, we can give the sorting field names dynamically at runtime. here is the way.&lt;/P&gt;&lt;P&gt;for further help,refer,&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm"&amp;gt;SAP Help&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;explanation :&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt; you have an internal table with a structured line type that you want sort by a different key, you can specify the key in the SORT statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT &amp;lt;itab&amp;gt; [ASCENDING|DESCENDING] [AS TEXT] [STABLE]&lt;/P&gt;&lt;P&gt;             BY &amp;lt;f1&amp;gt; [ASCENDING|DESCENDING] [AS TEXT]&lt;/P&gt;&lt;P&gt;                ...&lt;/P&gt;&lt;P&gt;                &amp;lt;fn&amp;gt; [ASCENDING|DESCENDING] [AS TEXT].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table is now sorted by the specified components &amp;lt;f 1 &amp;gt; ... &amp;lt;f n &amp;gt; instead of by the table key. The number of sort fields is limited to 250. The sort order depends on the sequence of the fields &amp;lt;f i &amp;gt;. The sort sequence specified before BY applies to all fields. The sort sequence after a field applies only to that column of the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify a sort field dynamically by specifying (&amp;lt;f&amp;gt;) instead of &amp;lt;f i &amp;gt;. The contents of the field &amp;lt;f&amp;gt; determines the name of the sort field. If &amp;lt;f&amp;gt; is empty when the statement is executed, the field is ignored in the sort. If it contains an invalid component name, a runtime error occurs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2006 20:55:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347103#M174637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T20:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347104#M174638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to read the report back in, evaluate the fields and sort the table based on those results.&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, 23 May 2006 20:55:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347104#M174638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T20:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347105#M174639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it seems that you want to sort the data prior to displaying on the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that's easy - just sort itab by parameter1 parameter2 parameter3 as mentioned by Den.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can also remove that sort button from your PF status so the users don't get confused.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2006 20:57:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347105#M174639</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T20:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347106#M174640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When the user presses the button to do the sort, is he or she presented with a screen that has the fields and a number for a sort sequence? If not, what is on the screen?&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, 23 May 2006 21:07:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort/m-p/1347106#M174640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T21:07:20Z</dc:date>
    </item>
  </channel>
</rss>

