<?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: Sorting Character string numerically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844151#M1957666</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;It sorts the data as :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&amp;nbsp; 1. 740,000mm &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&amp;nbsp; 2.&amp;nbsp;&amp;nbsp; 77,000 mm &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&amp;nbsp; 3. 850,000 mm &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Instead it should sort data as: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;1. 77,000mm &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;2.740,000 mm &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;3. 850,000 mm&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If the columns is of type QUAN for quantity field, it will sort as required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably the ALV output field is type character.&lt;/P&gt;&lt;P&gt;Regards, Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jul 2016 15:26:29 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2016-07-26T15:26:29Z</dc:date>
    <item>
      <title>Sorting Character string numerically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844147#M1957662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Hey guys, I have an ALV Grid that needs to display a column of numbers with units at the end. the unit may change example Kg, mm, cm. Within the ALV, if they click on the sorting buttons, it does not sort correctly.It is because as a string it sorts differently from how numbers sort.. Example data: 1. 850,000 mm 2. 77,000 mm 3. 740,000 mm It sorts the data as : 1. 740,000mm 2.77,000 mm 3. 850,000 mm Instead it should sort data as: 1. 77,000mm 2.740,000 mm 3. 850,000 mm. Please help me. I have checked the following discussion, but was not helpful. &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://scn.sap.com/thread/3429747"&gt;https://scn.sap.com/thread/3429747&lt;/A&gt;&lt;SPAN&gt; Regards Dilip S&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 14:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844147#M1957662</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-07-26T14:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Character string numerically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844148#M1957663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dilip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest adding an additional numeric column that represents each of the number values and then sort the ALV table by that field but make it a hidden field.&amp;nbsp; Treating the output as String instead of numeric will affect how the data is sorted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ryan Crosby&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 14:16:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844148#M1957663</guid>
      <dc:creator>Ryan-Crosby</dc:creator>
      <dc:date>2016-07-26T14:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Character string numerically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844149#M1957664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding one more column to the ALV is not feasible in my situation. It would be great , if there ais any other way.&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;Dilip S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 14:23:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844149#M1957664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-07-26T14:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Character string numerically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844150#M1957665</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;I think that you can use &lt;A href="https://scn.sap.com/thread/3429747" title="https://scn.sap.com/thread/3429747"&gt;Sorting Numeric Characters as numbers | SCN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as a base but in your case you need to format the data differently:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;unit measure&amp;gt; &amp;lt;SPACE&amp;gt; &amp;lt;numeric value&amp;gt; . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 14:29:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844150#M1957665</guid>
      <dc:creator>rosenberg_eitan</dc:creator>
      <dc:date>2016-07-26T14:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Character string numerically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844151#M1957666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;It sorts the data as :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&amp;nbsp; 1. 740,000mm &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&amp;nbsp; 2.&amp;nbsp;&amp;nbsp; 77,000 mm &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&amp;nbsp; 3. 850,000 mm &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Instead it should sort data as: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;1. 77,000mm &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;2.740,000 mm &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;3. 850,000 mm&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If the columns is of type QUAN for quantity field, it will sort as required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably the ALV output field is type character.&lt;/P&gt;&lt;P&gt;Regards, Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 15:26:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844151#M1957666</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2016-07-26T15:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Character string numerically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844152#M1957667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;Dilip Kumar Subramaniam wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have checked the following discussion, but was not helpful. &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://scn.sap.com/thread/3429747"&gt;https://scn.sap.com/thread/3429747&lt;/A&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(the thread is proposing a numeric field + a conversion routine)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May we know why you can't implement the solution in that thread, which is obviously the best choice?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although I'm not fan of adding a column to the ALV, may we know why you can't add it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to know, because it will avoid us proposing useless solutions again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 15:48:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844152#M1957667</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-07-26T15:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Character string numerically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844153#M1957668</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;For your knowledge the sorting is done using the internal format of the field .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For demonstration I formatted a date field using FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/1003075" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/1003172" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Note that the months are sorted based on the actual value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So it seems that you can format you internal data into a "sortable" format .&lt;/P&gt;&lt;P&gt;Using the exit you can present the internal data to the user as required .&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;Eitan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 04:28:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-character-string-numerically/m-p/11844153#M1957668</guid>
      <dc:creator>rosenberg_eitan</dc:creator>
      <dc:date>2016-07-27T04:28:38Z</dc:date>
    </item>
  </channel>
</rss>

