<?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: How to get pattern from the string? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285233#M1219595</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 need to String options like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CA --&amp;gt; contains any&lt;/P&gt;&lt;P&gt;CO --&amp;gt; contains only &lt;/P&gt;&lt;P&gt;CP --&amp;gt; contain patterns&lt;/P&gt;&lt;P&gt;CN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for your requirement  u can use CA and CP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Mar 2009 09:48:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-19T09:48:32Z</dc:date>
    <item>
      <title>How to get pattern from the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285226#M1219588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 3 strings variables.&lt;/P&gt;&lt;P&gt;Name1,Name2 and Name 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to search following terms in above variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'T1' 'TURC1' 'TURC 1' and 'TURC 1X'  " X=any character&lt;/P&gt;&lt;P&gt;'T2' 'TURC1' 'TURC 2' and 'TURC 2X'  " X=any character&lt;/P&gt;&lt;P&gt;'T3' 'TURC1' 'TURC 3' and 'TURC 3X'  " X=any character&lt;/P&gt;&lt;P&gt;'T4' 'TURC1' 'TURC 4' and 'TURC 4X'  " X=any character&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If T1      found, then v_res = 1.&lt;/P&gt;&lt;P&gt;If TURC1   found, then v_res = 1.&lt;/P&gt;&lt;P&gt;If TURC 1  found, then v_res = 1.&lt;/P&gt;&lt;P&gt;If TURC1X  found, then v_res = 1X.&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;Same for 2 3 and 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, How can I do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 07:33:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285226#M1219588</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-19T07:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get pattern from the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285227#M1219589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;search string for 'T1' abbrieviated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Search 'TURC1' for 'T1' abbrieviated.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;write : 'Found'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do the same for all strings&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 07:35:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285227#M1219589</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-19T07:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get pattern from the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285228#M1219590</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;try this way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF 'T1 TURC1 TURC 1 TURC 1X'  CS 'T1'&lt;/P&gt;&lt;P&gt;  v_res = 1.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do same for the others&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 07:40:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285228#M1219590</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-19T07:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get pattern from the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285229#M1219591</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;Name1,Name2 and Name 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to search following terms in above variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIND 'T1' IN Name1.
IF sy-subrc = 0
v_res = 1.
ELSE.

FIND 'TURC1' IN Name1.
IF sy-subrc = 0
v_res = 1.
ENDIF.
ENDIF.

" Try giving multiple value in FIND statement, check wether it work or not so that u can find all the 1st in single statement.
" Do same for remaining strings&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bala Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 07:42:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285229#M1219591</guid>
      <dc:creator>former_member585060</dc:creator>
      <dc:date>2009-03-19T07:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get pattern from the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285230#M1219592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: v_str type string,
      v_res(2) type c.

v_str = 'T1 TURC1 TURC 1 TURC 1X'.

if v_str CA 'T1' OR v_str CA 'TCUR1' OR v_str CA 'TURC 1'.
  v_res = 1.
endif.

if v_str CA 'TURC 1X'.
  v_res = '1x'.
endif.

write:/ v_res.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 08:37:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285230#M1219592</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-03-19T08:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get pattern from the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285231#M1219593</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;Use below logic for 'T1'.  For 'T2' and 'T3' change all '1' in below code to  '2' and '3' respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: str TYPE string VALUE 'TURC 1'&lt;/P&gt;&lt;P&gt;        v TYPE string,&lt;/P&gt;&lt;P&gt;        ch TYPE string,&lt;/P&gt;&lt;P&gt;        l TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF str CO 'T1'.&lt;/P&gt;&lt;P&gt;  v = 1.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  IF str CO 'TURC1'.&lt;/P&gt;&lt;P&gt;v = 1.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    IF str CO 'TURC 1'.&lt;/P&gt;&lt;P&gt;      v = 1.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      IF str CS 'TURC1'.&lt;/P&gt;&lt;P&gt;        l = STRLEN( str ).&lt;/P&gt;&lt;P&gt;        l = l - 1.&lt;/P&gt;&lt;P&gt;        MOVE str+l(1) TO ch.&lt;/P&gt;&lt;P&gt;        CONCATENATE '1' ch INTO v.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 09:03:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285231#M1219593</guid>
      <dc:creator>awin_prabhu</dc:creator>
      <dc:date>2009-03-19T09:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get pattern from the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285232#M1219594</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;Try to check the Contains String "CS" command.&lt;/P&gt;&lt;P&gt;Note that this command is case-sensitive.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 09:37:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285232#M1219594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-19T09:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get pattern from the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285233#M1219595</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 need to String options like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CA --&amp;gt; contains any&lt;/P&gt;&lt;P&gt;CO --&amp;gt; contains only &lt;/P&gt;&lt;P&gt;CP --&amp;gt; contain patterns&lt;/P&gt;&lt;P&gt;CN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for your requirement  u can use CA and CP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 09:48:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285233#M1219595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-19T09:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get pattern from the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285234#M1219596</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;Change in my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First check 'name1' variable with below code.&lt;/P&gt;&lt;P&gt;For checking 'name2' 'name3' replace all 'name1' in below code to 'name2' and 'name3'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: name1 TYPE string VALUE 'TURC1y',&lt;/P&gt;&lt;P&gt;      v TYPE string,&lt;/P&gt;&lt;P&gt;      ch TYPE string,&lt;/P&gt;&lt;P&gt;      l TYPE i,&lt;/P&gt;&lt;P&gt;      h type i.&lt;/P&gt;&lt;P&gt;*For checking 'name1' variable.&lt;/P&gt;&lt;P&gt;IF name1 CO 'T1' OR name1 CO 'T2' OR name1 CO 'T3' OR name1 CO 'T4'.&lt;/P&gt;&lt;P&gt;  v = 1.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  IF name1 CO 'TURC1' OR name1 CO 'TURC2' OR name1 CO 'TURC3' OR name1 CO 'TURC4'.&lt;/P&gt;&lt;P&gt;    v = 1.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    IF name1 CO 'TURC 1' OR name1 CO 'TURC 2' OR name1 CO 'TURC 3' OR name1 CO 'TURC 4'.&lt;/P&gt;&lt;P&gt;      v = 1.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      IF name1 CS 'TURC1' OR name1 CS 'TURC2' OR name1 CS 'TURC3' OR name1 CS 'TURC4'.&lt;/P&gt;&lt;P&gt;        l = STRLEN( name1 ).&lt;/P&gt;&lt;P&gt;        l = l - 1.&lt;/P&gt;&lt;P&gt;        MOVE name1+l(1) TO ch.&lt;/P&gt;&lt;P&gt;CONCATENATE '1' ch INTO v.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Might solve ur problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 10:13:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285234#M1219596</guid>
      <dc:creator>awin_prabhu</dc:creator>
      <dc:date>2009-03-19T10:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get pattern from the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285235#M1219597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    Try below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do for remaining same Strings&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : name1 TYPE string,
       name11 TYPE string,
       name2 TYPE string,
       name3 TYPE string.
DATA : v_res(2) TYPE n,
       w_fdpos TYPE sy-fdpos,
       str TYPE i,
       ch TYPE c.


name1 = 'ABCT1XRYTURC1JJTURC 1LLTURC 1A'.

str = STRLEN( name1 ).

FIND 'T1' IN name1.

IF sy-subrc = 0.
  v_res = 1.

  FIND 'TURC1' IN name1.

  IF sy-subrc = 0.
    v_res = 1.
    SEARCH name1 FOR 'TURC 1'.

    IF sy-subrc = 0.
      v_res = 1.
      w_fdpos = syst-fdpos.
      w_fdpos = w_fdpos + 6.
      str = str - w_fdpos.
      name11 = name1+w_fdpos(str).

      SEARCH name11 FOR 'TURC 1'.

      IF sy-subrc = 0.
        CLEAR w_fdpos.
        w_fdpos = sy-fdpos.
        w_fdpos = w_fdpos + 6.
        ch = name11+w_fdpos(1).

        CONCATENATE '1' ch INTO v_res.

      ENDIF.
    ENDIF.
  ENDIF.
ENDIF.

FIND 'T2' IN name1.

IF sy-subrc = 0.
  v_res = 1.
  FIND 'TURC2' IN name1.

  IF sy-subrc = 0.
    v_res = 1.
    SEARCH name1 FOR 'TURC 2'.

    IF sy-subrc = 0.
      v_res = 1.
      w_fdpos = syst-fdpos.
      w_fdpos = w_fdpos + 6.
      str = str - w_fdpos.
      name11 = name1+w_fdpos(str).

      SEARCH name11 FOR 'TURC 2'.

      IF sy-subrc = 0.
        CLEAR w_fdpos.
        w_fdpos = sy-fdpos.
        w_fdpos = w_fdpos + 6.
        ch = name11+w_fdpos(1).

        CONCATENATE '1' ch INTO v_res.

      ENDIF.
    ENDIF.
  ENDIF.
ENDIF.

FIND 'T3' IN name1.

IF sy-subrc = 0.
  v_res = 1.
  FIND 'TURC3' IN name1.

  IF sy-subrc = 0.
    v_res = 1.
    SEARCH name1 FOR 'TURC 3'.

    IF sy-subrc = 0.
      v_res = 1.
      w_fdpos = syst-fdpos.
      w_fdpos = w_fdpos + 6.
      str = str - w_fdpos.
      name11 = name1+w_fdpos(str).

      SEARCH name11 FOR 'TURC 3'.

      IF sy-subrc = 0.
        CLEAR w_fdpos.
        w_fdpos = sy-fdpos.
        w_fdpos = w_fdpos + 6.
        ch = name11+w_fdpos(1).

        CONCATENATE '1' ch INTO v_res.

      ENDIF.
    ENDIF.
  ENDIF.
ENDIF.

FIND 'T4' IN name1.

IF sy-subrc = 0.
  v_res = 1.
  FIND 'TURC4' IN name1.

  IF sy-subrc = 0.
    v_res = 1.
    SEARCH name1 FOR 'TURC 4'.

    IF sy-subrc = 0.
      v_res = 1.

      w_fdpos = syst-fdpos.
      w_fdpos = w_fdpos + 6.
      str = str - w_fdpos.
      name11 = name1+w_fdpos(str).

      SEARCH name11 FOR 'TURC 4'.

      IF sy-subrc = 0.
        CLEAR w_fdpos.
        w_fdpos = sy-fdpos.
        w_fdpos = w_fdpos + 6.
        ch = name11+w_fdpos(1).

        CONCATENATE '1' ch INTO v_res.

      ENDIF.
    ENDIF.
  ENDIF.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bala Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 13:21:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-get-pattern-from-the-string/m-p/5285235#M1219597</guid>
      <dc:creator>former_member585060</dc:creator>
      <dc:date>2009-03-19T13:21:11Z</dc:date>
    </item>
  </channel>
</rss>

