<?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: String Manupulation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manupulation/m-p/7920111#M1598663</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;use regular expressions. for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: lv_regex type ref to cl_abap_regex,
         lv_text    type string value 'aaa1b',
         lt_result type match_result_tab,

create object lv_regex
exporting
pattern = '\d+'. "only digits

find all occurrences of regex lv_regex in lv_text results lt_result.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result will be length and offset (identifies the position of valid character or set of characters).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Jul 2011 15:59:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-07-02T15:59:52Z</dc:date>
    <item>
      <title>String Manupulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manupulation/m-p/7920110#M1598662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;If in a report the input is a string which contains alphabets ,special characters and numbers . If we want to filter the different data types into different variables of their respective types , how can we do it . Is there a function module to do this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg : parameters   a type string value 'abc12*3d&amp;amp; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       data     :            alphab        type char ,&lt;/P&gt;&lt;P&gt;                               numbers     type  num,&lt;/P&gt;&lt;P&gt;                               special       type cahr . &lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;      How can we get    alphabets     = abcd&lt;/P&gt;&lt;P&gt;                                  numbers     = 123&lt;/P&gt;&lt;P&gt;                                  specialchar = *&amp;amp;&lt;/P&gt;&lt;P&gt;               &lt;EM&gt;&amp;lt;removed by moderator&amp;gt;&lt;/EM&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks  in advance&lt;/P&gt;&lt;P&gt;MSR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Jul 2, 2011 7:25 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jul 2011 15:29:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manupulation/m-p/7920110#M1598662</guid>
      <dc:creator>former_member325935</dc:creator>
      <dc:date>2011-07-02T15:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: String Manupulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manupulation/m-p/7920111#M1598663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;use regular expressions. for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: lv_regex type ref to cl_abap_regex,
         lv_text    type string value 'aaa1b',
         lt_result type match_result_tab,

create object lv_regex
exporting
pattern = '\d+'. "only digits

find all occurrences of regex lv_regex in lv_text results lt_result.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result will be length and offset (identifies the position of valid character or set of characters).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jul 2011 15:59:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manupulation/m-p/7920111#M1598663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-02T15:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: String Manupulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manupulation/m-p/7920112#M1598664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;I did not understand the answer  ,can you please elaborate . Can't this be done in 5 to 10 lines of code . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks N Regards &lt;/P&gt;&lt;P&gt;MSR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Jul 2011 11:05:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manupulation/m-p/7920112#M1598664</guid>
      <dc:creator>former_member325935</dc:creator>
      <dc:date>2011-07-03T11:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: String Manupulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manupulation/m-p/7920113#M1598665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi msr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is nopt easy to five an answer without knowing your level of knowledge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the idea is to find  the alphabets ,special characters and numbers using regular expressions (well known in may programming languagesm available in ABAP since ECC600) to find all occurences of the patterns and store the offset and length of the data in table lt_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For testing Regex without coding you can use the ABAP program DEMO_REGEX_TOY. Basically it can be done in 5-10 lines of code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each pattern, FIND ALL OCCURENCES OF &amp;lt;pattern&amp;gt; IN &amp;lt;yourstring&amp;gt; RESULTS lt_result. Then loop at lt_result and concatenate every &amp;lt;yourstring&amp;gt;+&amp;lt;result-offset(&amp;lt;result&amp;gt;-length) into respective pattern subgroup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to convert this into ABAP code, feel free to come back when you are struck.&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Jul 2011 13:04:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manupulation/m-p/7920113#M1598665</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-07-03T13:04:49Z</dc:date>
    </item>
  </channel>
</rss>

