<?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 Numeric Characters as numbers in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803393#M1780225</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why dont you put '%', eg Marks in % ,in the heading of the column and put just the values in column?&lt;/P&gt;&lt;P&gt;Your issue would be solved. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Susmitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Sep 2013 21:41:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-09-26T21:41:44Z</dc:date>
    <item>
      <title>Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803392#M1780224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an ALV Grid that needs to display a column of numbers with a percent at the end and any negative values in the front.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; -35.4%&lt;/P&gt;&lt;P&gt;8.7%&lt;/P&gt;&lt;P&gt;13.4%&lt;/P&gt;&lt;P&gt;-100.3%&lt;/P&gt;&lt;P&gt;8732.9%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was done, but while within the ALV, if they click on the sorting buttons, it does not sort correctly.&lt;/P&gt;&lt;P&gt;It is because the system column HAS to be a string to display it like it is, but as a string it sorts differently from how numbers sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone come up with a solution to this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 19:12:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803392#M1780224</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-26T19:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803393#M1780225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why dont you put '%', eg Marks in % ,in the heading of the column and put just the values in column?&lt;/P&gt;&lt;P&gt;Your issue would be solved. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Susmitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 21:41:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803393#M1780225</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-26T21:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803394#M1780226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If we convert its type by NUMC i thing then also it will work. Just give a try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;ChanS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 02:35:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803394#M1780226</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-27T02:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803395#M1780227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree with "Susmitha's" reply please go through that one your issue will resolve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Krishna Chaitanya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 03:08:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803395#M1780227</guid>
      <dc:creator>former_member185177</dc:creator>
      <dc:date>2013-09-27T03:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803396#M1780228</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;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://answers.sap.com/people/tom.neikam" id="jive-4126862404273684201097"&gt;Tom Neikam&lt;/A&gt;&lt;/STRONG&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author"&gt;Put '%' in &lt;/SPAN&gt;Field Text instead of&amp;nbsp; displaying in filed ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remove % in column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Display values lie this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #99cc00;"&gt;&lt;STRONG&gt;Field Name&lt;SPAN style="font-size: 14pt;"&gt; %&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; -35.4&lt;/P&gt;&lt;P&gt;8.7&lt;/P&gt;&lt;P&gt;13.4&lt;/P&gt;&lt;P&gt;-100.3&lt;/P&gt;&lt;P&gt;8732.9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Field Name &lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt; -35.4%&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;8.7%&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;13.4%&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;-100.3%&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;8732.9%&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 03:21:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803396#M1780228</guid>
      <dc:creator>former_member209120</dc:creator>
      <dc:date>2013-09-27T03:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803397#M1780229</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 the end customer insist that you use the format 13.4% .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can hold your data as numeric (for sorting).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create your own CONVERSION_EXIT_PRCNT_OUTPUT and put&amp;nbsp; ==PRCNT in the EDIT_MASK for this field in the field catalog .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use can use the edit_mask of in the field catalog for formatting the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649baf17411d2b486006094192fe3/content.htm"&gt;http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649baf17411d2b486006094192fe3/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://help.sap.com/saphelp_erp2004/helpdata/en/33/206bc8012e11d3b495006094192fe3/content.htm"&gt;http://help.sap.com/saphelp_erp2004/helpdata/en/33/206bc8012e11d3b495006094192fe3/content.htm&lt;/A&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>Fri, 27 Sep 2013 05:12:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803397#M1780229</guid>
      <dc:creator>rosenberg_eitan</dc:creator>
      <dc:date>2013-09-27T05:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803398#M1780230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's similar to the answer I proposed, I added a new column with % in the column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT they still want the - sign to be in front of the number, not behind the number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to put the - sign in front, I have to use strings. Which gives me the exact same problem I had before; SAP uses the sorting rules for strings, not for numerics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because the % is at the end, it is a constant and I can find work arounds for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But to have the negative symbol in front of the string causes the problems. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 12:12:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803398#M1780230</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-27T12:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803399#M1780231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This does not fix the problem, because I still have to use strings to move the negative sign.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 12:14:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803399#M1780231</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-27T12:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803400#M1780232</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 did a small test using CONVERSION_EXIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the output:&lt;/P&gt;&lt;P&gt;&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/287709" width="450" /&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>Fri, 27 Sep 2013 14:16:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803400#M1780232</guid>
      <dc:creator>rosenberg_eitan</dc:creator>
      <dc:date>2013-09-27T14:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803401#M1780233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you set up the edit mask for this to work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 14:20:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803401#M1780233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-27T14:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803402#M1780234</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;Some blood some sweat some tears some luck.....&lt;SPAN __jive_emoticon_name="wink" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/1826/images/emoticons/wink.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will upload the code shortly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 14:28:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803402#M1780234</guid>
      <dc:creator>rosenberg_eitan</dc:creator>
      <dc:date>2013-09-27T14:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803403#M1780235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hah, thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 14:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803403#M1780235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-09-27T14:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Numeric Characters as numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803404#M1780236</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;Function: (Any CONVERSION_EXIT_????_OUTPUT can be used as a skeleton)&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/287785" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM conversion_yts01&lt;/P&gt;&lt;P&gt;&amp;nbsp; USING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_input&lt;/P&gt;&lt;P&gt;&amp;nbsp; CHANGING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_output .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATA: buffer_1 TYPE char32 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITE p_input TO buffer_1 NO-SIGN NO-ZERO RIGHT-JUSTIFIED .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF p_input IS INITIAL .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_output = space .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CONDENSE buffer_1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CONCATENATE '+' buffer_1 '%' INTO buffer_1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF p_input LT 0 .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WRITE '-' TO buffer_1+0(1) .&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CONDENSE buffer_1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; p_output = buffer_1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&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; " CONVERSION_YTS01&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case I use CL_SALV_TABLE ALV but this will work also in other ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just use the EDIT_MASK in the field catalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Full source included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 14:51:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-numeric-characters-as-numbers/m-p/9803404#M1780236</guid>
      <dc:creator>rosenberg_eitan</dc:creator>
      <dc:date>2013-09-27T14:51:28Z</dc:date>
    </item>
  </channel>
</rss>

