<?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 compare in select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615467#M870947</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 replacing '%' by '*'......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SAP Docu for LIKE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use of the wildcard characters "_" and "%" corresponds to the standard of SQL. In the rest of ABAP, the wildcard characters "+" and " * " are used in similar logical expressions, in particular when &lt;STRONG&gt;selection tables&lt;/STRONG&gt; are used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Mar 2008 05:34:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-24T05:34:15Z</dc:date>
    <item>
      <title>string compare in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615464#M870944</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 have a problem in select statement. i have a name field in my selection screen, i am using name field to comapre string in my select statement, but i am not getting the resule can anyone suggest me on this . please find my code below,s_name1 is my select option name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF s_name1-low IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;LOOP AT S_NAME1.&lt;/P&gt;&lt;P&gt;  CONCATENATE s_name1-low '%' INTO s_name1-low.&lt;/P&gt;&lt;P&gt;  TRANSLATE s_name1-low TO UPPER CASE.&lt;/P&gt;&lt;P&gt;  s_name1-option = 'CP'.&lt;/P&gt;&lt;P&gt;  MODIFY s_name1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT lifnr land1 name1 ort01 ort02 pfach pstl2 pstlz regio stras&lt;/P&gt;&lt;P&gt;         erdat ernam ktokk loevm sperr sperm sperz nodel&lt;/P&gt;&lt;P&gt;    INTO (gs_vendor-vendor_num, gs_vendor-land1, gs_vendor-name,&lt;/P&gt;&lt;P&gt;          gs_vendor-ort01, gs_vendor-ort02, gs_vendor-pfach,&lt;/P&gt;&lt;P&gt;          gs_vendor-pstl2, gs_vendor-pstlz, gs_vendor-regio,&lt;/P&gt;&lt;P&gt;          gs_vendor-stras, gs_vendor-created_on, gs_vendor-created_by,&lt;/P&gt;&lt;P&gt;          gs_vendor-account_gp, gs_vendor-deletion_flag,&lt;/P&gt;&lt;P&gt;          gs_vendor-central_post, gs_vendor-ctr_purch_block,&lt;/P&gt;&lt;P&gt;          gs_vendor-payment_block, gs_vendor-central_deletion)&lt;/P&gt;&lt;P&gt;    FROM  lfa1&lt;/P&gt;&lt;P&gt;         WHERE  lifnr  IN s_lifnr&lt;/P&gt;&lt;P&gt;         AND    name1  LIKE s_name1&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start of Change G9007789 03/12/2008 - D01K946651&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Additional selection criteria added for City and Region&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         AND    ort01  IN s_ort01&lt;/P&gt;&lt;P&gt;         AND    regio  IN s_regio&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;End of Change G9007789 03/12/2008 - D01K946651&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         AND    ktokk  IN s_ktokk&lt;/P&gt;&lt;P&gt;         AND    ( ktokk  NE 'ZHMT' AND ktokk NE 'ZTER' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND gs_vendor TO gt_vendor.&lt;/P&gt;&lt;P&gt;    CLEAR gs_vendor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 05:24:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615464#M870944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T05:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: string compare in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615465#M870945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abinash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of       name1 LIKE s_name1    use       name1 IN s_name1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward if useful&lt;/P&gt;&lt;P&gt;Thanks Arjun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 05:31:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615465#M870945</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T05:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: string compare in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615466#M870946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;For Ex,&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS:P_VBELN FOR VBRK-VBELN NO INTERVALS.&lt;/P&gt;&lt;P&gt;The text will be,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%_P_VBELN_%_APP_%-TEXT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;%_P_VBELN-LOW_%_APP_%-TEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 05:32:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615466#M870946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T05:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: string compare in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615467#M870947</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 replacing '%' by '*'......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SAP Docu for LIKE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use of the wildcard characters "_" and "%" corresponds to the standard of SQL. In the rest of ABAP, the wildcard characters "+" and " * " are used in similar logical expressions, in particular when &lt;STRONG&gt;selection tables&lt;/STRONG&gt; are used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 05:34:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615467#M870947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T05:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: string compare in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615468#M870948</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;Have you checked whether you have given proper events. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

AT selection screen output. "Change here
IF s_name1-low IS NOT INITIAL.
LOOP AT S_NAME1.
CONCATENATE s_name1-low '%' INTO s_name1-low.
TRANSLATE s_name1-low TO UPPER CASE.
s_name1-option = 'CP'.
MODIFY s_name1.
ENDLOOP.
ENDIF.

Start-of-Selection. " change here
SELECT lifnr land1 name1 ort01 ort02 pfach pstl2 pstlz regio stras
erdat ernam ktokk loevm sperr sperm sperz nodel
INTO (gs_vendor-vendor_num, gs_vendor-land1, gs_vendor-name,
gs_vendor-ort01, gs_vendor-ort02, gs_vendor-pfach,
gs_vendor-pstl2, gs_vendor-pstlz, gs_vendor-regio,
gs_vendor-stras, gs_vendor-created_on, gs_vendor-created_by,
gs_vendor-account_gp, gs_vendor-deletion_flag,
gs_vendor-central_post, gs_vendor-ctr_purch_block,
gs_vendor-payment_block, gs_vendor-central_deletion)
FROM lfa1
WHERE lifnr IN s_lifnr
AND name1 LIKE s_name1

Start of Change G9007789 03/12/2008 - D01K946651 
Additional selection criteria added for City and Region 
AND ort01 IN s_ort01
AND regio IN s_regio

End of Change G9007789 03/12/2008 - D01K946651 
AND ktokk IN s_ktokk
AND ( ktokk NE 'ZHMT' AND ktokk NE 'ZTER' ).

APPEND gs_vendor TO gt_vendor.
CLEAR gs_vendor.

ENDSELECT.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 05:36:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615468#M870948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T05:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: string compare in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615469#M870949</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;  Did you get any error in your program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF NOT s_name1-low IS  INITIAL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOOP AT S_NAME1.&lt;/P&gt;&lt;P&gt;CONCATENATE s_name1-low '%' INTO s_name1-low.&lt;/P&gt;&lt;P&gt;TRANSLATE s_name1-low TO UPPER CASE.&lt;/P&gt;&lt;P&gt;s_name1-option = 'CP'.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;s_name1-sign = 'I'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MODIFY s_name1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&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;First Change  your code like below which increase the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT lifnr land1 name1 ort01 ort02 pfach pstl2 pstlz regio stras&lt;/P&gt;&lt;P&gt;erdat ernam ktokk loevm sperr sperm sperz nodel&lt;/P&gt;&lt;P&gt;INTO  CORRESPONDING FIELDS OF TABLE  gs_vendor&lt;/P&gt;&lt;P&gt;FROM lfa1&lt;/P&gt;&lt;P&gt;WHERE lifnr IN s_lifnr&lt;/P&gt;&lt;P&gt;AND name1 LIKE s_name1&lt;/P&gt;&lt;P&gt;AND ort01 IN s_ort01&lt;/P&gt;&lt;P&gt;AND regio IN s_regio&lt;/P&gt;&lt;P&gt;AND ktokk IN s_ktokk&lt;/P&gt;&lt;P&gt;AND ( ktokk NE 'ZHMT' AND ktokk NE 'ZTER' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now try&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 05:38:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615469#M870949</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T05:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: string compare in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615470#M870950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks All,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:32:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615470#M870950</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: string compare in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615471#M870951</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;your statement :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE s_name1-low '%' INTO s_name1-low.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;makes a string "s_name1-low" with value as "&lt;STRONG&gt;verma&lt;/STRONG&gt;" into&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;verma%&lt;/STRONG&gt; but not '&lt;STRONG&gt;verma%&lt;/STRONG&gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the string should be with in single quotes not as verma% but instead in the form &lt;STRONG&gt;'verma%'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please make changes accordingly and see how it worked or still you are facing issues on this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vishnu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:33:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-compare-in-select-statement/m-p/3615471#M870951</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:33:34Z</dc:date>
    </item>
  </channel>
</rss>

