<?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 manipulation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684023#M301273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nazmul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check below code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: var_in(11) type c value '12-345-678',
      var_out(9) type n.

replace all occurences of '-' in var_in with space.
condense var_in.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT         = var_in
 IMPORTING
   OUTPUT        = var_out.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;P&gt;Check the value of var_out.&lt;/P&gt;&lt;P&gt;Now i guess you can split for further processing..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Nov 2006 05:10:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-28T05:10:20Z</dc:date>
    <item>
      <title>String manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684020#M301270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I&amp;#146;m bit new to ABAP and need help on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting a string value from a form field and want to make sure user enters the right value.&lt;/P&gt;&lt;P&gt;User allowed to enter values with or without 2 dashes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expected string could be: 9 numbers (&amp;#145;123-456-789&amp;#146; or &amp;#145;123456789&amp;#146; ) or 8 numbers (&amp;#146;12-345-678&amp;#146; or &amp;#145;12345678&amp;#146;). No alpha is allowed apart from dash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If user enters 9 digits with 2 dashes (&amp;#145;123-456-789&amp;#146; which is 11 character) or with out 2 dashes (&amp;#145;123456789&amp;#146; which is 9 character); I need to strip out the dashes &amp;#145;-&amp;#145; (if there is any)  and then assign each of the numbers to variables e.g. n1 = 1, n2 = 2, n3 = 3, n4 = 4, n5 = 5, n6 = 6, n7 = 7, n8 = 8, n9 = 9 to do some calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If user enters 8 digits with 2 dashes (&amp;#146;12-345-678&amp;#146; which is 10 character) or with out 2 dashes (&amp;#145;12345678&amp;#146; which is 8 character long); I need to strip out the dashes &amp;#145;-&amp;#145;  (if there is any) and then add a leading &amp;#145;0&amp;#146; to make 9 digit and then assign each of the numbers to variables e.g. n1 = 0, n2 = 1, n3 = 2, n4 = 3, n5 = 4, n6 = 5, n7 = 6, n8 = 7, n9 = 8 to do some calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 04:42:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684020#M301270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T04:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: String manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684021#M301271</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; Guess there is no std functionality to achieve this directly. You will have to write your own code. May be you can create a Function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Cheers&lt;/P&gt;&lt;P&gt; VJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 04:54:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684021#M301271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T04:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: String manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684022#M301272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;len = strlen(v_string).

if len = 8 or len = 10.
  replace all occurrences of '-' in v_string with space.
   condense v_string.
   concatenate '0' v_string into v_string.
   n1 = v_string+0(1).
   n2 = v_string+1(1).
   n3 = v_string+2(1).
   n4 = v_string+3(1).
   n5 = v_string+4(1).
   n6 = v_string+5(1).
   n7 = v_string+6(1).
   n8 = v_string+7(1).
   n9 = v_string+8(1).
elseif len = 9 or len = 11.
 replace all occurrences of '-' in v_string with space.
 condense v_string.
   v1 = v_string+0(1).
   v2 = v_string+1(1).
   v3 = v_string+2(1).
   v4 = v_string+3(1).
   v5 = v_string+4(1).
   v6 = v_string+5(1).
   v7 = v_string+6(1).
   v8 = v_string+7(1).
   v9 = v_string+8(1).

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        chandrasekhar jagarlamudi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 05:07:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684022#M301272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T05:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: String manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684023#M301273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nazmul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check below code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: var_in(11) type c value '12-345-678',
      var_out(9) type n.

replace all occurences of '-' in var_in with space.
condense var_in.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT         = var_in
 IMPORTING
   OUTPUT        = var_out.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;P&gt;Check the value of var_out.&lt;/P&gt;&lt;P&gt;Now i guess you can split for further processing..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 05:10:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684023#M301273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T05:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: String manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684024#M301274</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;   Let the name of your string be v_string....then write the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  replace all occurrences of '-' in v_string with space.&lt;/P&gt;&lt;P&gt;   condense v_string.&lt;/P&gt;&lt;P&gt;   overlay v_string with '000000000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   n1 = v_string+0(1).&lt;/P&gt;&lt;P&gt;   n2 = v_string+1(1).&lt;/P&gt;&lt;P&gt;   n3 = v_string+2(1).&lt;/P&gt;&lt;P&gt;   n4 = v_string+3(1).&lt;/P&gt;&lt;P&gt;   n5 = v_string+4(1).&lt;/P&gt;&lt;P&gt;   n6 = v_string+5(1).&lt;/P&gt;&lt;P&gt;   n7 = v_string+6(1).&lt;/P&gt;&lt;P&gt;   n8 = v_string+7(1).&lt;/P&gt;&lt;P&gt;   n9 = v_string+8(1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will surely solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 05:18:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684024#M301274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T05:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: String manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684025#M301275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Copy this code and execute it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : n1,n2,n3,n4,n5,n6,n7,n8,n9,n10.&lt;/P&gt;&lt;P&gt;PARAMETERS NUM(15) TYPE C.&lt;/P&gt;&lt;P&gt;WRITE NUM COLOR 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANSLATE NUM USING '- '.&lt;/P&gt;&lt;P&gt;CONDENSE NUM NO-GAPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n1 = num(1).&lt;/P&gt;&lt;P&gt;n2 = num+1(1).&lt;/P&gt;&lt;P&gt;n3 = num+2(1).&lt;/P&gt;&lt;P&gt;n4 = num+3(1).&lt;/P&gt;&lt;P&gt;n5 = num+4(1).&lt;/P&gt;&lt;P&gt;n6 = num+5(1).&lt;/P&gt;&lt;P&gt;n7 = num+6(1).&lt;/P&gt;&lt;P&gt;n8 = num+7(1).&lt;/P&gt;&lt;P&gt;n9 = num+8(1).&lt;/P&gt;&lt;P&gt;n10 = num+9(1).&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 : /20 n1 COLOR 5.&lt;/P&gt;&lt;P&gt;write : / n2.&lt;/P&gt;&lt;P&gt;write : / n3.&lt;/P&gt;&lt;P&gt;write : / n4.&lt;/P&gt;&lt;P&gt;write : / n5.&lt;/P&gt;&lt;P&gt;write : / n6.&lt;/P&gt;&lt;P&gt;write : / n7.&lt;/P&gt;&lt;P&gt;write : / n8.&lt;/P&gt;&lt;P&gt;write : / n9.&lt;/P&gt;&lt;P&gt;write : / n10.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 05:34:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684025#M301275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T05:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: String manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684026#M301276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi nazmul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Welcome to d SDN community&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is a very easy and simple program &lt;/P&gt;&lt;P&gt;i hav tested it and i think this will fulfill ur needs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lv_len type i,&lt;/P&gt;&lt;P&gt;      lv_string(12)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****lv_string contains the number string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_len = strlen( lv_string ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case lv_len.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     when '8'.&lt;/P&gt;&lt;P&gt;****8 numbers&lt;/P&gt;&lt;P&gt;****concatenate 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       concatenate '0' lv_string into lv_string.&lt;/P&gt;&lt;P&gt;       perform data_get using lv_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     when '9'.&lt;/P&gt;&lt;P&gt;****9 numbers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       perform data_get using lv_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     when '10'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****8 numbers with 2 dashes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       replace '-' with SPACE into lv_string.&lt;/P&gt;&lt;P&gt;       replace '-' with SPACE into lv_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       condense lv_string no-gaps.&lt;/P&gt;&lt;P&gt;       concatenate '0' lv_string into lv_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       perform data_get using lv_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     when '11'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****9 numbers with 2 dashes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       replace '-' with SPACE into lv_string.&lt;/P&gt;&lt;P&gt;       replace '-' with SPACE into lv_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       condense lv_string no-gaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       perform data_get using lv_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " sdn_prog1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form data_get using p_string .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;      n1(1),n2(1),n3(1),n4(1),n5(1),&lt;/P&gt;&lt;P&gt;      n6(1),n7(1),n8(1),n9(1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      n1 = p_string+0(1).&lt;/P&gt;&lt;P&gt;      n2 = p_string+1(1).&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;/P&gt;&lt;P&gt;****Assign the values to variables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                    ***&lt;STRONG&gt;Mark points if helpful&lt;/STRONG&gt;***&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;Vs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 06:09:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684026#M301276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T06:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: String manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684027#M301277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot to those answred. I'm impressed for quick answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thtanks again all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2006 00:10:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1684027#M301277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-29T00:10:00Z</dc:date>
    </item>
  </channel>
</rss>

