<?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: Replace Non-Numeric Characters with a Numeric Character in a String in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799026#M1467130</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For keeping trailing blanks use this [replace|http://help.sap.com/abapdocu_70/en/ABAPREPLACE_IN_PATTERN.htm] statement instead:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPLACE ALL OCCURENCES OF REGEX '[^0-9](?! *$)' IN value WITH '1'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You cannot use [condense|http://help.sap.com/abapdocu_70/en/ABAPCONDENSE.htm], because it processes all blanks in a string, not just the trailing blanks (and per your statement it sounds like you want to keep them, which is accomplished via the statement I've given above).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Apr 2010 19:36:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-07T19:36:17Z</dc:date>
    <item>
      <title>Replace Non-Numeric Characters with a Numeric Character in a String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799022#M1467126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to replace all the non-numeric characters (including embedded blanks &amp;amp; hyphen) in a string to a numeric character '1'.&lt;/P&gt;&lt;P&gt;The trailing blanks should not be replaced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. "P22233344455566" should be changed to "122233344455566"&lt;/P&gt;&lt;P&gt;&amp;amp;    "49-1234567           " should be changed to "4911234567          "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Apr 2010 19:23:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799022#M1467126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-06T19:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Non-Numeric Characters with a Numeric Character in a String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799023#M1467127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use [replace|http://help.sap.com/abapdocu_70/en/ABAPREPLACE_IN_PATTERN.htm] with a regular expression to translate any non-numeric character (i.e. any character not between 0 and 9) to 1:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  REPLACE ALL OCCURENCES OF REGEX '[^0-9]' IN value WITH '1'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s.: In older releases [translate|http://help.sap.com/abapdocu_70/en/ABAPTRANSLATE.htm] would also do the trick, but is more lengthy, because one would need to specify each individual character that should be replaced, e.g.:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  TRANSLATE value TO UPPER CASE.
  TRANSLATE value USING
      ' 1_1-1a1b1c1d1e1f1g1h1i1j1k1l1m1n1o1p1q1r1s1t1u1v1w1x1y1z1'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Apr 2010 19:41:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799023#M1467127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-06T19:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Non-Numeric Characters with a Numeric Character in a String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799024#M1467128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I use the code suggested by you the trailing blanks are also getting replaced by '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. if the string is of 15 characters and the value is "a13-4 567g23   ", it is getting changed as "113141567123111". &lt;/P&gt;&lt;P&gt;       but it should be changed as "113141567123". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trailing blanks should be left as it is and should not be replaced by '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Apr 2010 12:06:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799024#M1467128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-07T12:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Non-Numeric Characters with a Numeric Character in a String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799025#M1467129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do a condense before replacing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Apr 2010 12:29:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799025#M1467129</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-04-07T12:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Non-Numeric Characters with a Numeric Character in a String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799026#M1467130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For keeping trailing blanks use this [replace|http://help.sap.com/abapdocu_70/en/ABAPREPLACE_IN_PATTERN.htm] statement instead:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPLACE ALL OCCURENCES OF REGEX '[^0-9](?! *$)' IN value WITH '1'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You cannot use [condense|http://help.sap.com/abapdocu_70/en/ABAPCONDENSE.htm], because it processes all blanks in a string, not just the trailing blanks (and per your statement it sounds like you want to keep them, which is accomplished via the statement I've given above).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Apr 2010 19:36:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-non-numeric-characters-with-a-numeric-character-in-a-string/m-p/6799026#M1467130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-07T19:36:17Z</dc:date>
    </item>
  </channel>
</rss>

