<?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 prblem for Find and Replace in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676765#M1575636</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        I have developed following code and it works perfectly to display the 12 or 13 character of credit card number as per your requirement. Only catch here is you need to add logic for including space ' ' in the character. Other wise it is perfect now. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Please let me know if you are not able to find logic for taking space into consideration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ZSTRING_MANU                            .


data: text type string,
      c2(11) type c value '0123456789-',
      lv_data(13) type c,
      lv_len type i,
      lv_index1 type i.

text =   'trea 123 bett $ 2 222* 33312-118888 abc'.

data lv_index type i.
field-symbols &amp;lt;fs&amp;gt; type any.


assign text to &amp;lt;fs&amp;gt;.

lv_len = strlen( text ).

do lv_len times.
  if strlen( lv_data ) &amp;gt;= 12.
    exit.
  endif.
  if lv_index &amp;gt; lv_index1.
    lv_index1 = lv_index.
  endif.
  if sy-index ne 1.
    lv_index1 = lv_index1 + 1.
  endif.
  if &amp;lt;fs&amp;gt;+lv_index1(1) CA c2.
    clear lv_data.
    lv_index = lv_index1.
    do 13 times.
      if sy-index ne 1.
        lv_index = lv_index + 1.
      endif.
      if &amp;lt;fs&amp;gt;+lv_index(1) CA c2.
        concatenate lv_data &amp;lt;fs&amp;gt;+lv_index(1) into lv_data.
      else.
        exit.
      endif.
    enddo.
  else.
    continue.
  endif.
enddo.

write lv_data.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Feb 2011 17:37:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-02-07T17:37:01Z</dc:date>
    <item>
      <title>String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676755#M1575626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have 40 char text. in given text will appier like below&lt;/P&gt;&lt;P&gt;  1)  Text =   'trea 123 bett $ 2 222*  333122218888 abc"&lt;/P&gt;&lt;P&gt;  2)  Text = 'trea 123 bett $ 2 222*  3331 2221 8888 abc"&lt;/P&gt;&lt;P&gt;  3)  Text = 'trea 123 123t $ 2 222*  3331- 2221-8888 abc"&lt;/P&gt;&lt;P&gt;  4) Text = 'trea 123 be32t $ 2 222*  3331 2221 88889 abc"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want to Hide this  12 or 13 digit text number with '*'  this 12 or 13 digit may come with space or without space or some time may be ' - ' sign. so i want output like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 1)  Text =   'trea 123 bett $ 2 222*  ************ abc"&lt;/P&gt;&lt;P&gt;  2)  Text = 'trea 123 bett $ 2 222*  ****  ****  **** abc"&lt;/P&gt;&lt;P&gt;  3)  Text = 'trea 123 123t $ 2 222*  ****- ***&lt;STRONG&gt;-&lt;/STRONG&gt;*** abc"&lt;/P&gt;&lt;P&gt;  4) Text = 'trea 123 be32t $ 2 222*  **** **** ***** abc"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should not change other digit in give Text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 10:19:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676755#M1575626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T10:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676756#M1575627</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 try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FIND FIRST OCCURRENCE OF '*' IN str1 MATCH OFFSET POS.
POS = POS + 1.
REPLACE ALL OCCURRENCES OF '0' in str1+pos WITH '*'.
REPLACE ALL OCCURRENCES OF '1' in str1+pos WITH '*'.
REPLACE ALL OCCURRENCES OF '2' in str1+pos WITH '*'.
REPLACE ALL OCCURRENCES OF '3' in str1+pos WITH '*'.
REPLACE ALL OCCURRENCES OF '4' in str1+pos WITH '*'.
REPLACE ALL OCCURRENCES OF '5' in str1+pos WITH '*'.
REPLACE ALL OCCURRENCES OF '6' in str1+pos WITH '*'.
REPLACE ALL OCCURRENCES OF '7' in str1+pos WITH '*'.
REPLACE ALL OCCURRENCES OF '8' in str1+pos WITH '*'.
REPLACE ALL OCCURRENCES OF '9' in str1+pos WITH '*'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 11:11:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676756#M1575627</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T11:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676757#M1575628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your question is not so clear.&lt;/P&gt;&lt;P&gt;As per my understanding,you can follow these steps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.First split the text into&lt;/P&gt;&lt;P&gt;V1 = trea&lt;/P&gt;&lt;P&gt;V2 = 123&lt;/P&gt;&lt;P&gt;V3 = bett&lt;/P&gt;&lt;P&gt;v4 = $ 2 222&lt;/P&gt;&lt;P&gt;V5 = 333122218888&lt;/P&gt;&lt;P&gt;2.than replace the V5 variable 12 or 13 with *&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 11:13:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676757#M1575628</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T11:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676758#M1575629</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 have sample code for one string. For other use loop or perform statement&lt;/P&gt;&lt;P&gt;Please try following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:W_var1(40) type C,&lt;/P&gt;&lt;P&gt;     W_var2(40) type C,&lt;/P&gt;&lt;P&gt;     i VALUE 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data:Test type string VALUE 'trea 123 bett $ 2 222&lt;/STRONG&gt; 3331-2221-8888 abc'."For example&lt;/P&gt;&lt;P&gt;SPLIT test at '*' into w_var1 W_var2.&lt;/P&gt;&lt;P&gt;do 10 TIMES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE all OCCURRENCES OF i in w_var2 with '*'.&lt;/P&gt;&lt;P&gt;  i = i + 1.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 11:41:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676758#M1575629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T11:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676759#M1575630</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;PRE&gt;&lt;CODE&gt;
data: text type char50.

text = 'trea 123 bett $ 2 222* 333122218888 abc'.
text+13(1) = '*'.      &amp;lt;----------- You can use this to replace specif letter 

write text.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 11:51:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676759#M1575630</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T11:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676760#M1575631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all for your valueable reply &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this text is not fix,  12 or 13 digit may appeair any where in string like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Text = 'trea 123 bett $ 2 222 @ 333122218888 abc"&lt;/P&gt;&lt;P&gt;2) Text = ' 3331 2221 8888 &amp;amp; 123 bett $ 2   abc"&lt;/P&gt;&lt;P&gt;3) Text = '  sss 123t $ 2 222* 3331- 2221-8888 abc"&lt;/P&gt;&lt;P&gt;4) Text = '  be32t $ 2 222 Pqr 3331 2221 88889 abc"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so this became very difficult to find and replace. only hint is that digit having length is 12 or 13  char i.e 3331 2221 88889 .&lt;/P&gt;&lt;P&gt;its also dynamic number , it will change 4444 2221 77889&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 12:51:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676760#M1575631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T12:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676761#M1575632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any possibility of similarity so that it can be replaced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it will be always XXXX XXXX XXXXX  kind of or it will be 12-13 continues digits like tht&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anmol.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 13:32:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676761#M1575632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T13:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676762#M1575633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi anmol&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no similarity in text this is 40 char text and user will enter credit card number any where in the that text &lt;/P&gt;&lt;P&gt;only hint is that its lenght will be 12 or 13 digit with space or '-' sign.&lt;/P&gt;&lt;P&gt;my requirment to replace only that credit card number not other digit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Text = 'trea 123 bett $ 2 222 @ 333122218888 abc"  &lt;STRONG&gt;O/P-&amp;gt;&lt;/STRONG&gt;  "trea 123 bett $ 2 222 @ ************ abc"&lt;/P&gt;&lt;P&gt;2) Text = ' 3331 2221 8888 &amp;amp; 123 bett $ 2   abc"       &lt;STRONG&gt;O/P-&amp;gt;&lt;/STRONG&gt;        " ****  **** **** &amp;amp; 123 bett $ 2   abc"&lt;/P&gt;&lt;P&gt;3) Text = '  sss 123t $ 2 222 W 3331- 2221-8888 abc"  &lt;STRONG&gt;o/p-&amp;gt;&lt;/STRONG&gt;   "sss 123t $ 2 222 W ****- ***&lt;STRONG&gt;-&lt;/STRONG&gt;*** abc"&lt;/P&gt;&lt;P&gt;4) Text = '  be32t $ 2 222 Pqr 3331 2221 88889 abc"   &lt;STRONG&gt;o/p-&amp;gt;&lt;/STRONG&gt;   "be32t $ 2 222 Pqr **** **** ***** abc"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 13:54:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676762#M1575633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T13:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676763#M1575634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wrote a test code for you, little lengthy but may helps you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can make small changes and use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS : CDETAILS(40) TYPE C.
DATA : STR(40) TYPE C.
DATA : BEGIN OF IT_RESULT OCCURS 0,
         SUBSTR(40) TYPE C,
       END OF IT_RESULT.
DATA : BEGIN OF IT_STR OCCURS 0,
         IND,
       END OF IT_STR.
DATA : NUM TYPE I,
       OREF TYPE REF TO CX_ROOT,
       TEXT TYPE STRING.
DATA : N VALUE 1,
       M VALUE 4,
       NUM_N,
       NUM_M.
DATA : MASK_STRING(19),
       MASK(19) VALUE '**** **** **** ****'.
DATA : FLAG_DONE.
DATA : FIRST VALUE 'X'.

MOVE CDETAILS TO STR.
SPLIT STR AT SPACE INTO TABLE IT_RESULT.
DELETE IT_RESULT WHERE SUBSTR IS INITIAL .

LOOP AT IT_RESULT.
  TRY.
      NUM = IT_RESULT-SUBSTR.
    CATCH  CX_SY_CONVERSION_NO_NUMBER INTO OREF .
      TEXT = OREF-&amp;gt;GET_TEXT( ).
  ENDTRY.
  IF TEXT IS INITIAL.
    IT_STR-IND = SY-TABIX.
    APPEND IT_STR.
  ENDIF.
  CLEAR : IT_STR, TEXT, NUM.
ENDLOOP.

DO.
  LOOP AT IT_STR WHERE IND BETWEEN N AND M.
    IF SY-TABIX = 4.
      NUM_N = N.
      NUM_M = M.
      FLAG_DONE = 'X'.
      EXIT.
    ENDIF.
  ENDLOOP.
  ADD 1 TO M.
  ADD 1 TO N.
  IF FLAG_DONE = 'X'.
    EXIT.
  ENDIF.
ENDDO.

LOOP AT IT_RESULT FROM NUM_N TO NUM_M.
  IF FIRST = 'X'.
    MASK_STRING = IT_RESULT-SUBSTR.
    CLEAR FIRST.
  ELSE.
    CONCATENATE MASK_STRING IT_RESULT-SUBSTR INTO MASK_STRING SEPARATED BY SPACE.
  ENDIF.
ENDLOOP.

REPLACE MASK_STRING WITH MASK INTO STR.
WRITE : STR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anmol&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 14:49:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676763#M1575634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T14:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676764#M1575635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:var TYPE char63.
DATA:len TYPE i,
start TYPE i,
count TYPE i,
l_offset TYPE i,
r_offset TYPE i.

var = 'Text = trea 123 bett $ 2 222* 333122218888 abc'.

len = STRLEN( var ).
start = 1.
DO len TIMES.
  sy-index = sy-index - 1.
  IF var+sy-index(1) CO '1234567890'.
    count = count + 1.
  ELSE.
    IF count = 12.
      r_offset = count.
      l_offset = sy-index.
      EXIT.
    ENDIF.
    start = sy-index.
    count = 0.
  ENDIF.
ENDDO.

WRITE l_offset.
SKIP 1.
WRITE r_offset.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;replace * from l_offset to r_offset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 15:18:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676764#M1575635</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-02-07T15:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676765#M1575636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        I have developed following code and it works perfectly to display the 12 or 13 character of credit card number as per your requirement. Only catch here is you need to add logic for including space ' ' in the character. Other wise it is perfect now. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Please let me know if you are not able to find logic for taking space into consideration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ZSTRING_MANU                            .


data: text type string,
      c2(11) type c value '0123456789-',
      lv_data(13) type c,
      lv_len type i,
      lv_index1 type i.

text =   'trea 123 bett $ 2 222* 33312-118888 abc'.

data lv_index type i.
field-symbols &amp;lt;fs&amp;gt; type any.


assign text to &amp;lt;fs&amp;gt;.

lv_len = strlen( text ).

do lv_len times.
  if strlen( lv_data ) &amp;gt;= 12.
    exit.
  endif.
  if lv_index &amp;gt; lv_index1.
    lv_index1 = lv_index.
  endif.
  if sy-index ne 1.
    lv_index1 = lv_index1 + 1.
  endif.
  if &amp;lt;fs&amp;gt;+lv_index1(1) CA c2.
    clear lv_data.
    lv_index = lv_index1.
    do 13 times.
      if sy-index ne 1.
        lv_index = lv_index + 1.
      endif.
      if &amp;lt;fs&amp;gt;+lv_index(1) CA c2.
        concatenate lv_data &amp;lt;fs&amp;gt;+lv_index(1) into lv_data.
      else.
        exit.
      endif.
    enddo.
  else.
    continue.
  endif.
enddo.

write lv_data.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Feb 2011 17:37:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676765#M1575636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-07T17:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676766#M1575637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all,problem has been solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 11:35:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676766#M1575637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-10T11:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: String prblem for Find and Replace</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676767#M1575638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks problem has been solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 11:37:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-prblem-for-find-and-replace/m-p/7676767#M1575638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-10T11:37:21Z</dc:date>
    </item>
  </channel>
</rss>

