<?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: select like string in parameter in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-like-string-in-parameter/m-p/7786782#M1586007</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;here is a sample for searching name1 and street in LFA1 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report  zsbabl_lfa1.
                                                                                types: begin of xl,
         lifnr     type lfa1-lifnr,
         name1     type lfa1-name1,
         stras     type lfa1-stras,
       end   of xl.
                                                                                data:  xsl type xl.
                                                                                parameters: xp_name1          type  lfa1-name1 default 'In*'.
parameters: xp_stras          type  lfa1-stras default '*Se*'.
                                                                                start-of-selection.
                                                                                translate  xp_name1        to  upper case.
     translate  xp_name1     using  '*%'.
     translate  xp_stras        to  upper case.
     translate  xp_stras     using  '*%'.
                                                                                EXEC SQL                     PERFORMING  list.
       SELECT LIFNR, NAME1, STRAS
                              INTO  :xsl
                              FROM  LFA1
       WHERE  UPPER( NAME1 )  LIKE  :xp_name1
       AND    UPPER( STRAS )  LIKE  :xp_stras
     ENDEXEC.
                                                                                END-OF-SELECTION.

FORM list.
                                                                                WRITE:                   /1  xsl-lifnr,
                                    xsl-name1,
                                    xsl-stras.
                                                                                ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We needed this not knowing the names are written in upper and lower case combinations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mixed search in only possible in native SQL UPPER CASE search.&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;Klaus&lt;/P&gt;&lt;P&gt;____________________________________________________________________________________________________________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Klaus Babl on Mar 21, 2011 7:24 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Mar 2011 06:23:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-03-21T06:23:18Z</dc:date>
    <item>
      <title>select like string in parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-like-string-in-parameter/m-p/7786780#M1586005</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 want to fetch data &lt;/P&gt;&lt;P&gt; as per vendor name &lt;/P&gt;&lt;P&gt;  from lfa1 &lt;/P&gt;&lt;P&gt;   according to input given by user in parameter&lt;/P&gt;&lt;P&gt;    if user doesnt remember full name of vendor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS comcode FOR wa_vendet-bukrs OBLIGATORY.&lt;/P&gt;&lt;P&gt;PARAMETERS venname LIKE wa_vendet-name1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select----&lt;/P&gt;&lt;P&gt;WHERE a&lt;SUB&gt;bukrs IN comcode AND b&lt;/SUB&gt;name1 LIKE venname.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2011 06:10:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-like-string-in-parameter/m-p/7786780#M1586005</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-21T06:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: select like string in parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-like-string-in-parameter/m-p/7786781#M1586006</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 write you Select as - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get your Parameter value in a variable of type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, you will have to prefix and suffix '%'  to the search string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE '%' P_VALUE '%' INTO L_TMP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; So your Select query becomes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select----&lt;/P&gt;&lt;P&gt;WHERE a&lt;SUB&gt;bukrs IN comcode AND b&lt;/SUB&gt;name1 LIKE L_TMP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rupesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2011 06:20:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-like-string-in-parameter/m-p/7786781#M1586006</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-21T06:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: select like string in parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-like-string-in-parameter/m-p/7786782#M1586007</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;here is a sample for searching name1 and street in LFA1 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report  zsbabl_lfa1.
                                                                                types: begin of xl,
         lifnr     type lfa1-lifnr,
         name1     type lfa1-name1,
         stras     type lfa1-stras,
       end   of xl.
                                                                                data:  xsl type xl.
                                                                                parameters: xp_name1          type  lfa1-name1 default 'In*'.
parameters: xp_stras          type  lfa1-stras default '*Se*'.
                                                                                start-of-selection.
                                                                                translate  xp_name1        to  upper case.
     translate  xp_name1     using  '*%'.
     translate  xp_stras        to  upper case.
     translate  xp_stras     using  '*%'.
                                                                                EXEC SQL                     PERFORMING  list.
       SELECT LIFNR, NAME1, STRAS
                              INTO  :xsl
                              FROM  LFA1
       WHERE  UPPER( NAME1 )  LIKE  :xp_name1
       AND    UPPER( STRAS )  LIKE  :xp_stras
     ENDEXEC.
                                                                                END-OF-SELECTION.

FORM list.
                                                                                WRITE:                   /1  xsl-lifnr,
                                    xsl-name1,
                                    xsl-stras.
                                                                                ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We needed this not knowing the names are written in upper and lower case combinations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mixed search in only possible in native SQL UPPER CASE search.&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;Klaus&lt;/P&gt;&lt;P&gt;____________________________________________________________________________________________________________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Klaus Babl on Mar 21, 2011 7:24 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2011 06:23:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-like-string-in-parameter/m-p/7786782#M1586007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-21T06:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: select like string in parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-like-string-in-parameter/m-p/7786783#M1586008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a suggestion, why not make sure the vendor name is valid before you do any selection? Parameter with input help maybe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2011 06:39:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-like-string-in-parameter/m-p/7786783#M1586008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-21T06:39:08Z</dc:date>
    </item>
  </channel>
</rss>

