<?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: How to replace the char values into numeric in my string? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982600#M1604885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dina....Converted my string to Upper case...and used the translate statement...&lt;/P&gt;&lt;P&gt;Problem solved.&lt;/P&gt;&lt;P&gt;To remove the spl chars I was used the FM ES_REMOVE_SPECIAL_CHARACTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jun 2011 07:39:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-13T07:39:27Z</dc:date>
    <item>
      <title>How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982592#M1604877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to Replace the Charecter values with numeric value in my string.&lt;/P&gt;&lt;P&gt;Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.&lt;/P&gt;&lt;P&gt;I mean How to replace the char values into numeric in my string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 06:42:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982592#M1604877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-13T06:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982593#M1604878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is it fixed that 1st 4 characters are char and last 4 numeric?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use offset and extract both of them in two different variable.&lt;/P&gt;&lt;P&gt;Then replace 1st one by your numeric data (9999).&lt;/P&gt;&lt;P&gt;And concatenate back into a single variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 06:51:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982593#M1604878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-13T06:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982594#M1604879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;Please tell what will be possible input  and  what should be output  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all possible combination .&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;Deepak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 06:54:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982594#M1604879</guid>
      <dc:creator>deepak_dhamat</dc:creator>
      <dc:date>2011-06-13T06:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982595#M1604880</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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOU CAN ALSO USE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : TEST(8) TYPE C  VALUE  'ABCD1234' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF REGEX 'ABCD' IN TEST WITH '9999'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE : TEST.&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;Deepak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 07:01:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982595#M1604880</guid>
      <dc:creator>deepak_dhamat</dc:creator>
      <dc:date>2011-06-13T07:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982596#M1604881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sridhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to Replace the Charecter values with numeric value in my string.&lt;/P&gt;&lt;P&gt;Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if i understand you correctly, you want to replace all characters in a string with &lt;STRONG&gt;9&lt;/STRONG&gt; as in the above example, irrespective of position of the character, if so try with the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: l_str TYPE string.

l_str = 'ASKHSIUDNSBDKJSDH124312431243124saasdfsf'.

REPLACE ALL OCCURRENCES OF REGEX '\D' IN l_str WITH '9'.

IF sy-subrc EQ 0.
  WRITE: l_str. "Result will be 9999999999999999912431243124312499999999 
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Chen K V on Jun 13, 2011 12:36 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 07:06:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982596#M1604881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-13T07:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982597#M1604882</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;The charecters may come in anywhere...in my string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exp: ABCD1234, 1A2B3SS....so on.....I need to remove all the charecters from the string and need to replace with 9 any my string.&lt;/P&gt;&lt;P&gt;I was used the statement REGEX but it is giving me the syntax error " The word REGEX is reserved".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 07:07:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982597#M1604882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-13T07:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982598#M1604883</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; use Translate keyword&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS : l_st TYPE string.
TRANSLATE l_st USING 'A9B9C9D9E9F9G9H9I9J9K9L9M9N9O9P9Q9R9S9T9U9V9W9X9Y9Z9'.
WRITE L_ST.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dhina..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 07:13:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982598#M1604883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-13T07:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982599#M1604884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dhina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addresses only upper case, doesn't address lower case or special characters, &lt;/P&gt;&lt;P&gt;i guess using the regular expression in this case would be better (/D).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 07:18:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982599#M1604884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-13T07:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982600#M1604885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dina....Converted my string to Upper case...and used the translate statement...&lt;/P&gt;&lt;P&gt;Problem solved.&lt;/P&gt;&lt;P&gt;To remove the spl chars I was used the FM ES_REMOVE_SPECIAL_CHARACTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 07:39:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982600#M1604885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-13T07:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982601#M1604886</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; you can do as what sap_wiz has suggested else you can try as below code for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ztest_1_um2.
DATA:   text1      TYPE string       VALUE 'ABCD1234',

        sub_string TYPE c       ,
        new        TYPE string       VALUE '9',
        id TYPE i,
        offset TYPE i.

id = STRLEN( text1 ).
*
DO id TIMES.
if sy-index = 1.
  iF  sy-abcde CS text1(1).
      sub_string = text1(1).
      REPLACE sub_string WITH new INTO text1.

      WRITE:/ text1.
    ELSE.
      CONTINUE.
    ENDIF.
ELSEif sy-index &amp;lt; id.
offset = sy-index - 1.
    IF  sy-abcde CS text1+offset(1).
      sub_string = text1+offset(1).
      REPLACE sub_string WITH new INTO text1.

      WRITE:/ text1.
    ELSE.
      CONTINUE.
    ENDIF.
endif.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Umang Mehta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 07:56:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982601#M1604886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-13T07:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982602#M1604887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sridhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the below string with your code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASFDKASFD&lt;STRONG&gt;(&amp;amp;^&lt;/STRONG&gt;(&amp;amp;#@^(@*#&amp;amp;ASDKJFHKASJFH234124791124&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 07:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/7982602#M1604887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-13T07:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the char values into numeric in my string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/13937887#M2037882</link>
      <description>&lt;P&gt;DATA : offset TYPE i.&lt;BR /&gt;IF v_tel_number CA sy-abcde.&lt;BR /&gt;&amp;nbsp;DATA(length) = strlen( v_tel_number ).&lt;BR /&gt;&amp;nbsp; DO length TIMES.&lt;BR /&gt;&amp;nbsp; offset = sy-index - 1.&lt;BR /&gt;&amp;nbsp; IF sy-abcde CS v_tel_number+offset(1).&lt;BR /&gt;&amp;nbsp; REPLACE v_tel_number+offset(1) IN v_tel_number WITH ' '.&lt;BR /&gt;&amp;nbsp; CONDENSE v_tel_number.&lt;BR /&gt;&amp;nbsp; ENDIF.&lt;BR /&gt;&amp;nbsp;ENDDO.&lt;BR /&gt;ENDIF.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 09:43:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-replace-the-char-values-into-numeric-in-my-string/m-p/13937887#M2037882</guid>
      <dc:creator>RohitS1</dc:creator>
      <dc:date>2024-11-14T09:43:21Z</dc:date>
    </item>
  </channel>
</rss>

