<?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 string operation extract numerical from string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978373#M950212</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to extract numerical from string,&lt;/P&gt;&lt;P&gt;suppose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if string = 'D050S114D7067'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then i want the numerical data of string,&lt;/P&gt;&lt;P&gt;means o/p = 0501147067&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if string = YG1100KWC32&lt;/P&gt;&lt;P&gt;then o/p should be 110032&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to extract numerical characters from string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arpit Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2008 13:06:50 GMT</pubDate>
    <dc:creator>arpit_shah</dc:creator>
    <dc:date>2008-06-11T13:06:50Z</dc:date>
    <item>
      <title>string operation extract numerical from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978373#M950212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to extract numerical from string,&lt;/P&gt;&lt;P&gt;suppose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if string = 'D050S114D7067'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then i want the numerical data of string,&lt;/P&gt;&lt;P&gt;means o/p = 0501147067&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if string = YG1100KWC32&lt;/P&gt;&lt;P&gt;then o/p should be 110032&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to extract numerical characters from string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arpit Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 13:06:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978373#M950212</guid>
      <dc:creator>arpit_shah</dc:creator>
      <dc:date>2008-06-11T13:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: string operation extract numerical from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978374#M950213</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;assign directly like below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lv_string(10) VALUE 'C9A0041254',
lv_number(10) TYPE n.
 
lv_number = lv_string.
WRITE:/ lv_number.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 13:08:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978374#M950213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T13:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: string operation extract numerical from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978375#M950214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Arpit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using regular expressions, you can achieve that like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lv_string  TYPE string VALUE 'D050S114D7067'.
DATA: lv_pattern TYPE string VALUE '([0-9]+)'.
DATA: lv_result  TYPE string.
DATA: lt_result  TYPE match_result_tab.
DATA: ls_result  LIKE LINE OF lt_result.

FIND ALL OCCURRENCES OF REGEX lv_pattern IN lv_string RESULTS lt_result.
LOOP AT lt_result INTO ls_result.
  CONCATENATE lv_result lv_string+ls_result-offset(ls_result-length) INTO lv_result.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 13:21:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978375#M950214</guid>
      <dc:creator>BGarcia</dc:creator>
      <dc:date>2008-06-11T13:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: string operation extract numerical from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978376#M950215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arpit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use &lt;STRONG&gt;Regular Expressions(REGEX)&lt;/STRONG&gt; to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"As of release 7.0, ABAP supports extended regular expressions in accordance with POSIX standard 1003.2. Regular expressions can be used after the addition REGEX of the statements FIND and REPLACE for searching in character strings." &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Font SAP help.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do as follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
...

string = 'D050S114D7067'.

REPLACE ALL OCCURRENCES OF REGEX '[:A-Z:]' IN v_data WITH SPACE.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now string = 0501147067.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I encourage you to always use regular expressions in your programs.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information about regular expressions see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[www.regular-expressions.info|www.regular-expressions.info]&lt;/P&gt;&lt;P&gt;[Regular Expression on Wikpedia|en.wikipedia.org/wiki/Regular_expression].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcelo Ramos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 13:57:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978376#M950215</guid>
      <dc:creator>marcelo_ramos1</dc:creator>
      <dc:date>2008-06-11T13:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: string operation extract numerical from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978377#M950216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arpit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if your string variable may contain characters in Uppercase and Lowercase you can use the following syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
...

string = 'd050S114d7067'

REPLACE ALL OCCURRENCES OF REGEX '[:A-Za-z:]' IN v_data WITH SPACE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcelo Ramos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 14:07:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978377#M950216</guid>
      <dc:creator>marcelo_ramos1</dc:creator>
      <dc:date>2008-06-11T14:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: string operation extract numerical from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978378#M950217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bharat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry, i hv write something different, &lt;/P&gt;&lt;P&gt;but my requirement is,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if string = 'D050S114D7067'&lt;/P&gt;&lt;P&gt;then i want the numerical data of string,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to split after numerical if any character is found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;means o/p  should  be = 050&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if string = YG1100KWC32&lt;/P&gt;&lt;P&gt;then o/p should be 1100.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 10:55:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978378#M950217</guid>
      <dc:creator>arpit_shah</dc:creator>
      <dc:date>2008-06-13T10:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: string operation extract numerical from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978379#M950218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i hv do it myself....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first i hv taken all numercal data and after that take first 2 character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and rgds,&lt;/P&gt;&lt;P&gt;Arpit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 11:17:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operation-extract-numerical-from-string/m-p/3978379#M950218</guid>
      <dc:creator>arpit_shah</dc:creator>
      <dc:date>2008-06-13T11:17:15Z</dc:date>
    </item>
  </channel>
</rss>

