<?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 String Operations in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219964#M135984</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;Basically I have to search for a string in a file name,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the string is AA , I  have to follow particular step&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the string is BB , I have to follow particular step&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the string is CC, I  have to follow  particular step&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying with the statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;search 'AA' OR 'BB' OR 'CC' FOR FANME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help.&lt;/P&gt;&lt;P&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;Irfan Hussain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Mar 2006 08:47:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-08T08:47:07Z</dc:date>
    <item>
      <title>String Operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219964#M135984</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;Basically I have to search for a string in a file name,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the string is AA , I  have to follow particular step&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the string is BB , I have to follow particular step&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the string is CC, I  have to follow  particular step&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying with the statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;search 'AA' OR 'BB' OR 'CC' FOR FANME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help.&lt;/P&gt;&lt;P&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;Irfan Hussain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2006 08:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219964#M135984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-08T08:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: String Operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219965#M135985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use :&lt;/P&gt;&lt;P&gt;FIND sub_string &lt;/P&gt;&lt;P&gt;  IN section_of dobj &lt;/P&gt;&lt;P&gt;  [ IN { BYTE | CHARACTER } MODE ] &lt;/P&gt;&lt;P&gt;  [ { RESPECTING | IGNORING } CASE ] &lt;/P&gt;&lt;P&gt;  [ MATCH OFFSET moff ] [MATCH LENGTH mlen ]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND 'AA' IN fname.&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt; "Do your operations for AA&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND 'BB' IN fname.&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt; "Do your operations for BB&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2006 08:51:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219965#M135985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-08T08:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: String Operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219966#M135986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can not use OR operand in the syntax of SEARCH. And the syntax is SEARCH f FOR g, where f is the string to be searched and g is the string in which the search is to be carried out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use different statements instead.&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;search FNAME FOR 'AA'.&lt;/P&gt;&lt;P&gt;search FNAME FOR 'BB'.&lt;/P&gt;&lt;P&gt;search FNAME FOR 'CC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Abhijit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2006 08:55:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219966#M135986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-08T08:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: String Operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219967#M135987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA string7(30) TYPE c VALUE 'This is a little sentence.'.
WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.

ULINE /1(26).
&amp;lt;b&amp;gt;SEARCH string7 FOR 'X'.&amp;lt;/b&amp;gt;
WRITE: / 'X', sy-subrc UNDER 'SY-SUBRC',
               sy-fdpos UNDER 'SY-FDPOS'.
SEARCH string7 FOR 'itt   '.
WRITE: / 'itt   ', sy-subrc UNDER 'SY-SUBRC',
                   sy-fdpos UNDER 'SY-FDPOS'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can write as &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SEARCH fname FOR 'AA'.
 perform step...

SEARCH fname FOR 'BB'.
 perform step ...

SEARCH fname FOR 'CC'.
 perform step...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2006 08:58:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219967#M135987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-08T08:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: String Operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219968#M135988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;USE string operation lie CS,CA,CP for this purpose.&lt;/P&gt;&lt;P&gt;&amp;lt;operator&amp;gt;   Meaning&lt;/P&gt;&lt;P&gt;CO      Contains Only&lt;/P&gt;&lt;P&gt;CN      Contains Not only&lt;/P&gt;&lt;P&gt;CA      Contains Any&lt;/P&gt;&lt;P&gt;NA       contains Not Any&lt;/P&gt;&lt;P&gt;CS      Contains String&lt;/P&gt;&lt;P&gt;NS       contains No String&lt;/P&gt;&lt;P&gt;CP       Matches pattern&lt;/P&gt;&lt;P&gt;NP       Does not match pattern&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To search a character field for a particular pattern, use the SEARCH statement as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEARCH &amp;lt;c&amp;gt; FOR &amp;lt;str&amp;gt; &amp;lt;options&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The statement searches the field &amp;lt;c&amp;gt; for &amp;lt;str&amp;gt; starting at position &amp;lt;n1&amp;gt;. If successful, the return code value of SY-SUBRC is set to 0 and SY-FDPOS is set to the offset of the string in the field &amp;lt;c&amp;gt;. Otherwise, SY-SUBRC is set to 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The search string &amp;lt;str&amp;gt; can have one of the following forms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEARCH itab FOR 'string05' AND MARK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR ... WITH               IN BYTE MODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE x1 ... xn INTO x IN BYTE MODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND ...                     IN BYTE MODE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ...                  IN BYTE MODE  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE f WITH g INTO h      IN BYTE MODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEARCH x FOR x1              IN BYTE MODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SHIFT x ...                  IN BYTE MODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT ...                    IN BYTE MODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2006 08:59:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219968#M135988</guid>
      <dc:creator>vinod_gunaware2</dc:creator>
      <dc:date>2006-03-08T08:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: String Operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219969#M135989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if fielname &amp;lt;b&amp;gt;CS&amp;lt;/b&amp;gt; 'AA' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do something&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif filename CS &amp;lt;b&amp;gt;'BB'&amp;lt;/b&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif finlename CS &amp;lt;b&amp;gt;'CC'&amp;lt;/b&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2006 09:02:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219969#M135989</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2006-03-08T09:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: String Operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219970#M135990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: C(32).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE 'TWEPAACD' TO C .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   WRITE:/ C.&lt;/P&gt;&lt;P&gt;   SEARCH C FOR 'TAA' ABBREVIATED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;      WRITE: 'FOUND'.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;      WRITE: 'NOTFOUND'.&lt;/P&gt;&lt;P&gt;       ENDIF.&lt;/P&gt;&lt;P&gt;_________________&lt;/P&gt;&lt;P&gt;when AA &lt;/P&gt;&lt;P&gt;perform 1.&lt;/P&gt;&lt;P&gt;when BB.&lt;/P&gt;&lt;P&gt;perform 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when cc.&lt;/P&gt;&lt;P&gt;perform 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when AA .&lt;/P&gt;&lt;P&gt;perform 4.&lt;/P&gt;&lt;P&gt;__________________________________&lt;/P&gt;&lt;P&gt; data: C(32).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE 'TWEPAACDBBEFGHDD' TO C .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   WRITE:/ C.&lt;/P&gt;&lt;P&gt;   SEARCH C FOR 'TAA' ABBREVIATED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;      WRITE:/ 'FOUND'.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;      WRITE:/ 'NOTFOUND'.&lt;/P&gt;&lt;P&gt;       ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEARCH C FOR 'TBB' ABBREVIATED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;      WRITE:/ 'FOUND'.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;      WRITE: 'NOTFOUND'.&lt;/P&gt;&lt;P&gt;       ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEARCH C FOR 'TDD' ABBREVIATED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;      WRITE:/ 'FOUND'.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;      WRITE:/ 'NOTFOUND'.&lt;/P&gt;&lt;P&gt;       ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*COMMENTS:&lt;/P&gt;&lt;P&gt;EXECUTE this code and dont forget to mention the letter T as this is also taken into consideration for this purpose . try using 'AA' , 'BB', 'CC' , instead of 'TAA' etc and u'l know the difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;vijay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kan vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2006 09:05:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219970#M135990</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-08T09:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: String Operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219971#M135991</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 THIS CODE.&lt;/P&gt;&lt;P&gt;~~~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZVRTEST9.
Data: FILE_NAME type string.

FILE_NAME = 'DSAAEE'.

find 'AA' in FILE_NAME.

if sy-subrc eq 0.
write:'Search Successfull..perform operation for AA'.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHEERS,&lt;/P&gt;&lt;P&gt;VIJAY RAHEJA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2006 09:06:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations/m-p/1219971#M135991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-08T09:06:08Z</dc:date>
    </item>
  </channel>
</rss>

