<?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: Problem Using 'LIKE' in Select statement. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244283#M484258</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;I am also facing the same problem. I have written a BAPI to get the items according to the search criteria. Please advice, how can i pass my text to the select statement.  At present i am passing the description like PIPE% from the front end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM TABLE WHERE DESCRIPTION LIKE DESCRIPTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want to pass the descriptionl like PIPE&lt;STRONG&gt;%&lt;/STRONG&gt; and this should be taken care in the back end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Rao (rao.busi@yahoo.com)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Feb 2008 09:26:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-12T09:26:41Z</dc:date>
    <item>
      <title>Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244273#M484248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Presently Iam using the select query on VBAK and VBAP in this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT     a~vbeln             "Sales order number&lt;/P&gt;&lt;P&gt;           a~erdat             "Creation date&lt;/P&gt;&lt;P&gt;           a~ernam             "Name of person who created&lt;/P&gt;&lt;P&gt;           a~lifsk             "Delivery block&lt;/P&gt;&lt;P&gt;           a~vkorg             "Sales Org&lt;/P&gt;&lt;P&gt;           a~spart             "Division&lt;/P&gt;&lt;P&gt;           b~posnr             "Item number&lt;/P&gt;&lt;P&gt;           b~matnr               "Material number&lt;/P&gt;&lt;P&gt;           b~werks             "Plant&lt;/P&gt;&lt;P&gt;           b~arktx             "Short Text for SO Item&lt;/P&gt;&lt;P&gt;           b~netwr             "Document currency&lt;/P&gt;&lt;P&gt;           b~zz_catalog_id     "Catalog ID for Variant configurator&lt;/P&gt;&lt;P&gt;           FROM vbak AS a&lt;/P&gt;&lt;P&gt;           INNER JOIN vbap AS b&lt;/P&gt;&lt;P&gt;           ON a~vbeln = b~vbeln&lt;/P&gt;&lt;P&gt;           INTO TABLE i_vbak_vbap&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WHERE a~vbeln IN s_vbeln&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        AND   a~vkorg IN s_vkorg&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        AND   a~lifsk NE c_c&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           WHERE a~erdat IN s_erdat&lt;/P&gt;&lt;P&gt;           and   a~spart in s_spart&lt;/P&gt;&lt;P&gt;            AND  b~matnr like s_matnr-low.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here Iam using the &amp;#147; Like&amp;#148; to fetch the materials  if user in the selection screen enters L* or &lt;STRONG&gt;X&lt;/STRONG&gt;  then I would be getting materials starting with L or the materials with X as part of the material.I have taken care of the conversions of  *   to  %.&lt;/P&gt;&lt;P&gt;Now the User wants multiple selection of materials where he gives L* and V* and Z*,so that he wants me to fetch all the materials that start with L,V and Z.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the same statement in various forms but could not succeed ,&lt;/P&gt;&lt;P&gt;Some of the forms I tried &amp;#133;AND ( b~matnr like v_matnr1&lt;/P&gt;&lt;P&gt;            and b~matnr like v_matnr2 ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But not able to fetch the records of all the materials which start with L , V and Z. I guess may be Join is making the problem.&lt;/P&gt;&lt;P&gt;I request you guys to give a solution to this in the same SQL statement .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: I have done all the conversions of * to %..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2007 14:43:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244273#M484248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-17T14:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244274#M484249</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 build ranges for material with wild card and use in the select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ranges r_matnr for mara-matnr.

r_matnr-sign = 'I'.
r_matnr-option = 'CP'.
r_matnr-low = 'L*'.
append r_matnr.

r_matnr-sign = 'I'.
r_matnr-option = 'CP'.
r_matnr-low = 'V*'.
append r_matnr.

r_matnr-sign = 'I'.
r_matnr-option = 'CP'.
r_matnr-low = 'Z*'.
append r_matnr.

SELECT a~vbeln "Sales order number
a~erdat "Creation date
a~ernam "Name of person who created
a~lifsk "Delivery block
a~vkorg "Sales Org
a~spart "Division
b~posnr "Item number
b~matnr "Material number
b~werks "Plant
b~arktx "Short Text for SO Item
b~netwr "Document currency
b~zz_catalog_id "Catalog ID for Variant configurator
FROM vbak AS a
INNER JOIN vbap AS b
ON a~vbeln = b~vbeln
INTO TABLE i_vbak_vbap
* WHERE a~vbeln IN s_vbeln
* AND a~vkorg IN s_vkorg
* AND a~lifsk NE c_c
WHERE a~erdat IN s_erdat
and a~spart in s_spart
AND b~matnr in r_matnr.                         *&amp;lt;--- Change here

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2007 14:47:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244274#M484249</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2007-05-17T14:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244275#M484250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT a~vbeln "Sales order number&lt;/P&gt;&lt;P&gt;a~erdat "Creation date&lt;/P&gt;&lt;P&gt;a~ernam "Name of person who created&lt;/P&gt;&lt;P&gt;a~lifsk "Delivery block&lt;/P&gt;&lt;P&gt;a~vkorg "Sales Org&lt;/P&gt;&lt;P&gt;a~spart "Division&lt;/P&gt;&lt;P&gt;b~posnr "Item number&lt;/P&gt;&lt;P&gt;b~matnr "Material number&lt;/P&gt;&lt;P&gt;b~werks "Plant&lt;/P&gt;&lt;P&gt;b~arktx "Short Text for SO Item&lt;/P&gt;&lt;P&gt;b~netwr "Document currency&lt;/P&gt;&lt;P&gt;b~zz_catalog_id "Catalog ID for Variant configurator&lt;/P&gt;&lt;P&gt;FROM vbak AS a&lt;/P&gt;&lt;P&gt;INNER JOIN vbap AS b&lt;/P&gt;&lt;P&gt;ON a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;INTO TABLE i_vbak_vbap&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WHERE a~vbeln IN s_vbeln&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AND a~vkorg IN s_vkorg&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AND a~lifsk NE c_c&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;WHERE a~erdat IN s_erdat&lt;/P&gt;&lt;P&gt;and a~spart in s_spart&lt;/P&gt;&lt;P&gt;AND &amp;lt;b&amp;gt;b~matnr = s_matnr-low.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2007 14:49:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244275#M484250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-17T14:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244276#M484251</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;no need for LIKE statement.... u can use IN for select options. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u given L* as input in select options then u can use IN as usual.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT a~vbeln "Sales order number&lt;/P&gt;&lt;P&gt;a~erdat "Creation date&lt;/P&gt;&lt;P&gt;a~ernam "Name of person who created&lt;/P&gt;&lt;P&gt;a~lifsk "Delivery block&lt;/P&gt;&lt;P&gt;a~vkorg "Sales Org&lt;/P&gt;&lt;P&gt;a~spart "Division&lt;/P&gt;&lt;P&gt;b~posnr "Item number&lt;/P&gt;&lt;P&gt;b~matnr "Material number&lt;/P&gt;&lt;P&gt;b~werks "Plant&lt;/P&gt;&lt;P&gt;b~arktx "Short Text for SO Item&lt;/P&gt;&lt;P&gt;b~netwr "Document currency&lt;/P&gt;&lt;P&gt;b~zz_catalog_id "Catalog ID for Variant configurator&lt;/P&gt;&lt;P&gt;FROM vbak AS a&lt;/P&gt;&lt;P&gt;INNER JOIN vbap AS b&lt;/P&gt;&lt;P&gt;ON a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;INTO TABLE i_vbak_vbap&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WHERE a~vbeln IN s_vbeln&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AND a~vkorg IN s_vkorg&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AND a~lifsk NE c_c&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;WHERE a~erdat IN s_erdat&lt;/P&gt;&lt;P&gt;and a~spart in s_spart&lt;/P&gt;&lt;P&gt;AND &amp;lt;b&amp;gt;b&lt;SUB&gt;matnr IN s_matnr. or b&lt;/SUB&gt;matnr = s_matnr-low&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;SAB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2007 14:57:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244276#M484251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-17T14:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244277#M484252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Guys, I tried all this stuff, like placing them in ranges and then using ' in' &lt;/P&gt;&lt;P&gt;"b~matnr in s_matnr"  with all the conversions using%, but i could not succeed...try a sample Program and send me if it is succssfull...Thanks, Venkat...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2007 14:58:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244277#M484252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-17T14:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244278#M484253</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;u dont need to use any conversions... dont convert * to % ... only for LIKE need to convert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection screen:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s_matnr:  L*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select statement as my previous post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;SAB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2007 15:04:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244278#M484253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-17T15:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244279#M484254</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;It works fine for me ... please try this simple program to pull material starting with A* and B*.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZZFL_TEST.

TABLES: MARA.
                                                                        
DATA: BEGIN OF T_MATNR OCCURS 0,
        MATNR LIKE MARA-MATNR.
DATA: END OF T_MATNR.
                                                                        
RANGES: R_MATNR FOR MARA-MATNR.
                                                                        
R_MATNR-SIGN = 'I'.
R_MATNR-OPTION = 'CP'.
R_MATNR-LOW = 'A*'.
APPEND R_MATNR.
                                                                        
R_MATNR-SIGN = 'I'.
R_MATNR-OPTION = 'CP'.
R_MATNR-LOW = 'B*'.
APPEND R_MATNR.
                                                                        
SELECT MATNR
INTO TABLE T_MATNR
FROM MARA
WHERE MATNR IN R_MATNR.
                                                                        
LOOP AT T_MATNR.
  WRITE: / T_MATNR-MATNR.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2007 15:07:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244279#M484254</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2007-05-17T15:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244280#M484255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Guys and Ferry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried out this option but could not succeed, I feel that "Join" in the SQL is making the problem there. If you could try out the same thing on join SQL and if it went successfulll , Please post me the necessary code.&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, 17 May 2007 15:17:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244280#M484255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-17T15:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244281#M484256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Venkat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i tried this code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its working fine... but it will not work when u give s_matnr-low or like statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: mara, makt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;         matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;         maktx like makt-maktx,&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: s_matnr for mara-matnr. " in ur case L*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select mara&lt;SUB&gt;matnr makt&lt;/SUB&gt;maktx into corresponding fields of table itab&lt;/P&gt;&lt;P&gt;from mara inner join makt on mara&lt;SUB&gt;matnr = makt&lt;/SUB&gt;matnr where mara~matnr in&lt;/P&gt;&lt;P&gt; s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; loop at itab.&lt;/P&gt;&lt;P&gt; write: / itab-matnr, itab-maktx.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;SAB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2007 15:33:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244281#M484256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-17T15:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244282#M484257</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;It works for me ... and check this sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZZFL_TEST.
                                                                        
TABLES: VBAK, VBAP.
                                                                        
DATA: BEGIN OF T_VBAP OCCURS 0,
        VBELN LIKE VBAK-VBELN,
        POSNR LIKE VBAP-POSNR,
        MATNR LIKE VBAP-MATNR.
DATA: END OF T_VBAP.
                                                                        
RANGES: R_MATNR FOR VBAP-MATNR.
                                                                        
R_MATNR-SIGN = 'I'.
R_MATNR-OPTION = 'CP'.
R_MATNR-LOW = 'E*'.
APPEND R_MATNR.
                                                                        
R_MATNR-SIGN = 'I'.
R_MATNR-OPTION = 'CP'.
R_MATNR-LOW = 'A*'.
APPEND R_MATNR.


SELECT A~VBELN B~POSNR B~MATNR
INTO TABLE T_VBAP
FROM VBAK AS A
INNER JOIN VBAP AS B
ON A~VBELN = B~VBELN
WHERE MATNR IN R_MATNR.
                                                                        
LOOP AT T_VBAP.
  WRITE: / T_VBAP-VBELN,
           T_VBAP-POSNR,
           T_VBAP-MATNR.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2007 15:46:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244282#M484257</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2007-05-17T15:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Using 'LIKE' in Select statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244283#M484258</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;I am also facing the same problem. I have written a BAPI to get the items according to the search criteria. Please advice, how can i pass my text to the select statement.  At present i am passing the description like PIPE% from the front end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM TABLE WHERE DESCRIPTION LIKE DESCRIPTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want to pass the descriptionl like PIPE&lt;STRONG&gt;%&lt;/STRONG&gt; and this should be taken care in the back end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Rao (rao.busi@yahoo.com)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2008 09:26:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-like-in-select-statement/m-p/2244283#M484258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-12T09:26:41Z</dc:date>
    </item>
  </channel>
</rss>

