<?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: Pattern recognition in a given string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465290#M1650783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_search,
          value  TYPE string,
          count  TYPE i,
        END OF ty_search.


DATA: it_search TYPE HASHED TABLE OF ty_search WITH UNIQUE KEY value.
DATA: wa_search TYPE ty_search.
DATA: gv_string TYPE string.
DATA: gv_length TYPE i.
DATA: gv_offset TYPE i.
DATA: gv_search TYPE string.
DATA: mcnt TYPE i.


gv_string = '345723345982343452343345'.
WRITE: / gv_string.

DO.
  gv_length = STRLEN( gv_string ).

  IF gv_length EQ 0.
    EXIT.
  ENDIF.

  gv_offset = 0.


  DO gv_length TIMES.
    IF gv_offset EQ 0.
      gv_search = gv_string(1).
    ELSE.
      CONCATENATE gv_search gv_string+gv_offset(1) INTO gv_search.
    ENDIF.

    READ TABLE it_search TRANSPORTING NO FIELDS WITH TABLE KEY value = gv_search.
    IF sy-subrc NE 0.
      FIND ALL OCCURRENCES OF gv_search IN gv_string MATCH COUNT mcnt.
      IF mcnt GT 1.
        wa_search-value = gv_search.
        wa_search-count = mcnt.
        INSERT wa_search INTO TABLE it_search.
      ENDIF.


    ENDIF.
    gv_offset = gv_offset + 1.

  ENDDO.
  SHIFT gv_string LEFT BY 1 PLACES.


ENDDO.
LOOP AT it_search INTO wa_search.
  WRITE: /'Search for', wa_search-value, 50 'counted', wa_search-count.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this then: 2 really big cakes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Dec 2011 12:41:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-12-21T12:41:53Z</dc:date>
    <item>
      <title>Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465266#M1650759</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;I have one problem in finding a repeated pattern in a given string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example: if the given string  lv_string = '345723345982343452343345'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can check the lv_string, which contains '345'  repeatedly in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so, i want  a ABAP code to get list of all such type of patterns repeated in a given string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Venky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 11:31:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465266#M1650759</guid>
      <dc:creator>venkatesha_n</dc:creator>
      <dc:date>2011-12-21T11:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465267#M1650760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey  F1 ... Please help Venkatesa &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 11:38:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465267#M1650760</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-12-21T11:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465268#M1650761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its not there in F1 Help......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 11:42:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465268#M1650761</guid>
      <dc:creator>venkatesha_n</dc:creator>
      <dc:date>2011-12-21T11:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465269#M1650762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to Find it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 11:50:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465269#M1650762</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T11:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465270#M1650763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its not just CP / CA / NP / CO... etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also am not talking about regular expressions which we normally do by using cl_abap_matcher or cl_abap_regex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to understand the problem first:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: you are given just a string and nothing else and  you will not be given any search key/ pattern to be found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we have to search the given string so that, what part of string is repeated again and again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is enough to understand the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Venky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 11:57:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465270#M1650763</guid>
      <dc:creator>venkatesha_n</dc:creator>
      <dc:date>2011-12-21T11:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465271#M1650764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To be fair to the OP, the question is not trivial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I challenge everyone here to write code to detect a string with patterns repeated more than once in the string. The pattern can be anything and is not known at design time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hint: Regular expressions may be a key and normal ABAP pattern matching is not much use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are some programming snippets on the Web, though not in ABAP but still may be useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/037047fc-5506-4656-ad27-dab9a6c501ee" target="test_blank"&gt;http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/037047fc-5506-4656-ad27-dab9a6c501ee&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vishnu Tallapragada on Dec 21, 2011 1:01 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just realize, the OP and I posted together&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 11:59:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465271#M1650764</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T11:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465272#M1650765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;data: lv_string type string.
data: mcnt type i.
lv_string = '345723345982343452343345'.

find ALL OCCURRENCES OF '345' in lv_string MATCH COUNT mcnt.

write: / mcnt.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did i win cookies?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:06:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465272#M1650765</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T12:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465273#M1650766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vishnu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is readily available in F1 help &lt;STRONG&gt;FIND - pattern&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:06:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465273#M1650766</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-12-21T12:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465274#M1650767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Keshav and Maen - sorry but you still don't seem to get it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We don't know what the pattern is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want to detect a string with repeated patterns, the pattern we don't know in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can be anything&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;345w2343234523&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vishnudoesn'tlikeVishnu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:09:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465274#M1650767</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T12:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465275#M1650768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Maen Anachronos ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to understand the problem..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already told that, you will be given just a big string like this  '345723345982343452343345'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you have to find out what part of the string is repeated again and again in the given string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if there are multiple such parts of the string, which are repeated in a given string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all that repeated substrings should be the output...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interesting?....&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;Venky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:10:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465275#M1650768</guid>
      <dc:creator>venkatesha_n</dc:creator>
      <dc:date>2011-12-21T12:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465276#M1650769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the FIND statement it should be easy to program the stuff. Even if the serach string is not given.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:11:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465276#M1650769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T12:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465277#M1650770</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;dude just use all occurences you will find the solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FIND ALL OCCURRENCES OF '345' in lv_string MATCH COUNT var&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Cheers&lt;/P&gt;&lt;P&gt;  NZAB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:12:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465277#M1650770</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T12:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465278#M1650771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ow but i do understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Point is: you need to be creative to use the FIND statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:12:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465278#M1650771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T12:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465279#M1650772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vishnu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this example in documentation&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: patt       TYPE string VALUE `now`, 
      text       TYPE string, 
      result_tab TYPE match_result_tab. 

FIELD-SYMBOLS &amp;lt;match&amp;gt; LIKE LINE OF result_tab. 


FIND ALL OCCURRENCES OF patt IN 
     `Everybody knows this is nowhere` 
     RESULTS result_tab. 

LOOP AT result_tab ASSIGNING &amp;lt;match&amp;gt;. 
  WRITE: / &amp;lt;match&amp;gt;-offset, &amp;lt;match&amp;gt;-length. 
ENDLOOP. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mods-Sorry for pasting the standard code, did just in case to demonstrate that Its as simple as that &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;@OP- No Points please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:14:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465279#M1650772</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-12-21T12:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465280#M1650773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello NZAB,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please go through the problem properly....?&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;Venky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:14:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465280#M1650773</guid>
      <dc:creator>venkatesha_n</dc:creator>
      <dc:date>2011-12-21T12:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465281#M1650774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;He doesn't know if it is 345 or Vishnu or Maen or Keshav, that can repeat in the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;He just wants to know if a pattern (which can be anything) is repeating in a string, if so what is (are) those. Not an easy problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keshav, he doesn't know if it is "now" that can repeat in his string. It can be "now" or "then" or "here" or "there", can be anything&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:15:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465281#M1650774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T12:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465282#M1650775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;data: gv_string type string.
data: gv_length type i.
data: gv_offset type i.
data: gv_search type string.
data: mcnt type i.


gv_string = '345723345982343452343345'.
gv_length = strlen( gv_string ).

write: / gv_string.

gv_offset = 0.
do gv_length times.
  if gv_offset eq 0.
    gv_search = gv_string(1).
  else.
    concatenate gv_search gv_string+gv_offset(1) into gv_search.
  endif.

  find ALL OCCURRENCES OF gv_search in gv_string MATCH COUNT mcnt.
  write: /'Search for', gv_search, 'counted', mcnt.

  gv_offset = gv_offset + 1.

enddo.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i expect a really big cake instead of a cookie.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:18:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465282#M1650775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T12:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465283#M1650776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maen, I guess, it will work, but it is not very efficient.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:20:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465283#M1650776</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T12:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465284#M1650777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have provided that standard code...Did anybody look into it &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:21:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465284#M1650777</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-12-21T12:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Pattern recognition in a given string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465285#M1650778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hehe... and why not? It's not like he's going to search for repeating patterns in the holy bible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the challenge was: write a piece of code to do it. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 12:21:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pattern-recognition-in-a-given-string/m-p/8465285#M1650778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-21T12:21:32Z</dc:date>
    </item>
  </channel>
</rss>

