<?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 search syntax in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148650#M748651</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_matnr like mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_mara like mara occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;replace all occurrences of '*' in p_matnr with '%' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM mara INTO table it_mara WHERE matnr LIKE p_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_mara.&lt;/P&gt;&lt;P&gt;write:/ it_mara-matnr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if usefull reward points helpfull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Dec 2007 09:16:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-27T09:16:42Z</dc:date>
    <item>
      <title>String search syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148646#M748647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know what is the syntax to be used to check if a particular word exists in a sentence. I tried the below, but it is not giving me the desired result.  I am checking to see if the word Comp exists in the name &amp;amp; also would like to know is this a case-sensitive search? i.e would Comp be treated differently from comp? if i want the search to check for 'comp' irrespective of the case, how should i do it? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE NAME1 FROM KNA1 INTO Y_NAME1&lt;/P&gt;&lt;P&gt;  WHERE KUNNR EQ VBRK-KUNRG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF Y_NAME1 CA 'Comp'.&lt;/P&gt;&lt;P&gt;  Y_TYP_SAL = 'INTERNAL'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  Y_TYP_SAL = 'EXTERNAL'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 09:05:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148646#M748647</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T09:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: String search syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148647#M748648</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 the find keyword to search the string &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND 'Comp' IN Y_NAME1. &lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;sucess &lt;/P&gt;&lt;P&gt;else &lt;/P&gt;&lt;P&gt;fail.&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;siva chalasani.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward points if found usefull&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 09:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148647#M748648</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T09:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: String search syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148648#M748649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA: &lt;/P&gt;&lt;P&gt;  c    TYPE STRING, &lt;/P&gt;&lt;P&gt;  p(2) TYPE C. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c = 'Everyone knows this'. &lt;/P&gt;&lt;P&gt;p = 'NO'. &lt;/P&gt;&lt;P&gt;FIND p IN c IGNORING CASE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Awrd Points if useful&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bhupal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 09:11:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148648#M748649</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T09:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: String search syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148649#M748650</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;To search a character field for a particular pattern, use the SEARCH statement as follows:&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;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;&lt;U&gt;&lt;STRONG&gt;&amp;lt;str&amp;gt;----&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;HR originaltext="----------" /&gt;Function&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;pattern&amp;gt;--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="-------" /&gt;Searches for &amp;lt;pattern&amp;gt; (any sequence of characters).--&lt;P&gt;&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;Trailing blanks are ignored.&lt;/P&gt;&lt;P&gt;.&amp;lt;pattern&amp;gt;.----&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;Searches for &amp;lt;pattern&amp;gt;. Trailing blanks are not ignored.&lt;/P&gt;&lt;P&gt;*&amp;lt;pattern&amp;gt;----&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;A word ending with &amp;lt;pattern&amp;gt; is sought.&lt;/P&gt;&lt;P&gt;&amp;lt;pattern&amp;gt;*----&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;Searches for a word starting with &amp;lt;pattern&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Words are separated by blanks, commas, periods, semicolons, colons, question marks, exclamation marks, parentheses, slashes, plus signs, and equal signs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;option&amp;gt; in the SEARCH FOR statement can be any of the following:&lt;/P&gt;&lt;P&gt;  ABBREVIATED&lt;/P&gt;&lt;P&gt;Searches the field &amp;lt;c&amp;gt; for a word containing the string in &amp;lt;str&amp;gt;. The characters can be separated by other characters. The first letter of the word and the string &amp;lt;str&amp;gt; must be&lt;/P&gt;&lt;P&gt;the same.&lt;/P&gt;&lt;P&gt;  STARTING AT &amp;lt;n1&amp;gt;&lt;/P&gt;&lt;P&gt;Searches the field &amp;lt;c&amp;gt; for &amp;lt;str&amp;gt; starting at position &amp;lt;n1&amp;gt;. The result SY-FDPOS refers to the offset relative to &amp;lt;n1&amp;gt; and not to the start of the field.&lt;/P&gt;&lt;P&gt;  ENDING AT &amp;lt;n2&amp;gt;&lt;/P&gt;&lt;P&gt;Searches the field &amp;lt;c&amp;gt; for &amp;lt;str&amp;gt; up to position &amp;lt;n2&amp;gt;.&lt;/P&gt;&lt;P&gt;  AND MARK&lt;/P&gt;&lt;P&gt;If the search string is found, all the characters in the search string (and all the characters in between when using ABBREVIATED) are converted to upper case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex.&lt;/P&gt;&lt;P&gt;DATA STRING(30) VALUE 'This is a little sentence.'.&lt;/P&gt;&lt;P&gt;WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;ULINE /1(26).&lt;/P&gt;&lt;P&gt;SEARCH STRING FOR 'X'.&lt;/P&gt;&lt;P&gt;WRITE: / 'X', SY-SUBRC UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;SY-FDPOS UNDER 'SY-FDPOS'&lt;/P&gt;&lt;P&gt;SEARCH STRING FOR 'itt '.&lt;/P&gt;&lt;P&gt;WRITE: / 'itt ', SY-SUBRC UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;SY-FDPOS UNDER 'SY-FDPOS'&lt;/P&gt;&lt;P&gt;SEARCH STRING FOR '.e .'.&lt;/P&gt;&lt;P&gt;WRITE: / '.e .', SY-SUBRC UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;SY-FDPOS UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;SEARCH STRING FOR '*e'.&lt;/P&gt;&lt;P&gt;WRITE: / '*e ', SY-SUBRC UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;SY-FDPOS UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;SEARCH STRING FOR 's*'.&lt;/P&gt;&lt;P&gt;WRITE: / 's* ', SY-SUBRC UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;SY-FDPOS UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 09:13:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148649#M748650</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T09:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: String search syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148650#M748651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_matnr like mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_mara like mara occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;replace all occurrences of '*' in p_matnr with '%' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM mara INTO table it_mara WHERE matnr LIKE p_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_mara.&lt;/P&gt;&lt;P&gt;write:/ it_mara-matnr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if usefull reward points helpfull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 09:16:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148650#M748651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T09:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: String search syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148651#M748652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF Y_NAME1 &lt;STRONG&gt;CS&lt;/STRONG&gt; 'Comp'.&lt;/P&gt;&lt;P&gt;Y_TYP_SAL = 'INTERNAL'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;Y_TYP_SAL = 'EXTERNAL'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just use this CS in ur comaprision operator .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 09:19:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148651#M748652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T09:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: String search syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148652#M748653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sniper,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note for Bhaskar:&lt;/STRONG&gt; Thanks a lot for that explanatory post&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note for others:&lt;/STRONG&gt; Thank you for providing different alternatives, but when i tried with FIND, system prompted a syntax error, it said FIND is undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep the good work going.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 09:41:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-search-syntax/m-p/3148652#M748653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T09:41:15Z</dc:date>
    </item>
  </channel>
</rss>

