<?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: Where + Like and a variable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315327#M794117</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roy check this code to create dynamic where clause.. like you wanted..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS: carr_id TYPE spfli-carrid,
            conn_id TYPE spfli-connid.
 
DATA:       where_clause TYPE  STRING,
            and(4),
            wa_spfli TYPE spfli.
 
IF carr_id IS NOT INITIAL.
  CONCATENATE 'CARRID = ''' carr_id '''' INTO where_clause.
  and = ' AND'.
ENDIF.
IF conn_id IS NOT INITIAL.
  CONCATENATE where_clause and ' CONNID = ''' conn_id ''''
    INTO where_clause.
ENDIF.
SELECT * FROM spfli INTO wa_spfli WHERE (where_clause).
  WRITE: / wa_spfli-carrid, wa_spfli-connid, wa_spfli-cityfrom,
           wa_spfli-cityto, wa_spfli-deptime.
ENDSELECT. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 03 Feb 2008 15:17:40 GMT</pubDate>
    <dc:creator>former_member156446</dc:creator>
    <dc:date>2008-02-03T15:17:40Z</dc:date>
    <item>
      <title>Where + Like and a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315324#M794114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a RFC and sending it some values to the imported variables.&lt;/P&gt;&lt;P&gt;In the code I want to use some select statement and a "where" condition that is followed by "like". In the value that I insert to the "like " I wish to use the value that was sent to the imported variable + the "%" sign (results should be all records that their relevant field starts with the value that I send to the imported variable).&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM &amp;lt;table_name&amp;gt; INTO table &amp;lt;my_table&amp;gt; WHERE &amp;lt;some_field&amp;gt; LIKE &amp;lt;my_imported_variable&amp;gt;%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This syntax fails. Can someone explain why and what is the right way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Roy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 14:09:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315324#M794114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-03T14:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Where + Like and a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315325#M794115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare another variable; concatenate the '%'  to the imported variable &amp;amp; then store it in this variable; use this new variable in your WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 14:12:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315325#M794115</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2008-02-03T14:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Where + Like and a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315326#M794116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Suresh,&lt;/P&gt;&lt;P&gt;Can you give an example - how do I concatenate the variable with the char "%"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 14:20:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315326#M794116</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-03T14:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Where + Like and a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315327#M794117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roy check this code to create dynamic where clause.. like you wanted..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS: carr_id TYPE spfli-carrid,
            conn_id TYPE spfli-connid.
 
DATA:       where_clause TYPE  STRING,
            and(4),
            wa_spfli TYPE spfli.
 
IF carr_id IS NOT INITIAL.
  CONCATENATE 'CARRID = ''' carr_id '''' INTO where_clause.
  and = ' AND'.
ENDIF.
IF conn_id IS NOT INITIAL.
  CONCATENATE where_clause and ' CONNID = ''' conn_id ''''
    INTO where_clause.
ENDIF.
SELECT * FROM spfli INTO wa_spfli WHERE (where_clause).
  WRITE: / wa_spfli-carrid, wa_spfli-connid, wa_spfli-cityfrom,
           wa_spfli-cityto, wa_spfli-deptime.
ENDSELECT. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 15:17:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315327#M794117</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-02-03T15:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Where + Like and a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315328#M794118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roy,&lt;/P&gt;&lt;P&gt; Please try this logic.&lt;/P&gt;&lt;P&gt; This logic i have used for getting purchase orders from EKKO where Purchase order number starts only with '46'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ebeln&lt;/P&gt;&lt;P&gt;             ekorg&lt;/P&gt;&lt;P&gt;             lifnr&lt;/P&gt;&lt;P&gt;INTO TABLE it_ekko&lt;/P&gt;&lt;P&gt;FROM ekko&lt;/P&gt;&lt;P&gt;WHERE  EBELN like '46%'.    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Avi....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 17:28:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-like-and-a-variable/m-p/3315328#M794118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-03T17:28:51Z</dc:date>
    </item>
  </channel>
</rss>

