<?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 WHERE condition IN operator problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542492#M2006232</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I am using SQL statetment like this: &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;select * from zvst_pass INTO TABLE it_vpass WHERE PLANT IN (WA_USER-AUTH_PLANT).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Here WA_USER-AUTH_PLANT has value '1300,1200'. The above statement gives the result only for plant '1300'.&lt;/P&gt;
  &lt;P&gt;When we use above statement like this:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;select * from zvst_pass INTO TABLE it_vpass WHERE PLANT IN ('1300','1200').&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;It gives us the perfect result.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Nov 2021 12:41:40 GMT</pubDate>
    <dc:creator>former_member719641</dc:creator>
    <dc:date>2021-11-29T12:41:40Z</dc:date>
    <item>
      <title>WHERE condition IN operator problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542492#M2006232</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I am using SQL statetment like this: &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;select * from zvst_pass INTO TABLE it_vpass WHERE PLANT IN (WA_USER-AUTH_PLANT).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Here WA_USER-AUTH_PLANT has value '1300,1200'. The above statement gives the result only for plant '1300'.&lt;/P&gt;
  &lt;P&gt;When we use above statement like this:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;select * from zvst_pass INTO TABLE it_vpass WHERE PLANT IN ('1300','1200').&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;It gives us the perfect result.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 12:41:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542492#M2006232</guid>
      <dc:creator>former_member719641</dc:creator>
      <dc:date>2021-11-29T12:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition IN operator problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542493#M2006233</link>
      <description>&lt;P&gt;If what you want to do is a dynamic SQL where clause, then wrap the whole WHERE condition in a string, not just one side of the comparison.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data v_where type string.

v_where = |PLANT IN ${WA_USER-AUTH_PLANT}|.&lt;BR /&gt;&lt;BR /&gt;select * from zvst_pass INTO TABLE it_vpass WHERE (v_where).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If possible, consider using ranges instead of doing a dynamic SQL in this simple query.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 12:49:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542493#M2006233</guid>
      <dc:creator>FabioPagoti</dc:creator>
      <dc:date>2021-11-29T12:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition IN operator problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542494#M2006234</link>
      <description>&lt;P&gt;Because a WHERE ... IN ...   statement expect a RANGE  not a list of values.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data rt_plants type range of werks_d.
split wa_user-auth_plant at ',' into data(plant_list_text).
loop at plant_list_text reference into data(o_ligne_plant).
  append #( sign = 'I'  option = 'EQ'  low = o_ligne_plant-&amp;gt;* ) to rt_plants.
endloop. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;select * from zvst_pass INTO TABLE it_vpass WHERE PLANT IN rt_plants.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Nov 2021 12:52:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542494#M2006234</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-11-29T12:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition IN operator problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542495#M2006235</link>
      <description>&lt;P&gt;There are at least 3 possible uses of the IN operator.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Ranges&lt;/LI&gt;&lt;LI&gt;List of values&lt;/LI&gt;&lt;LI&gt;Subqueries&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;One of them does accept a list of values.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/index.htm" target="_blank"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/index.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 13:16:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542495#M2006235</guid>
      <dc:creator>FabioPagoti</dc:creator>
      <dc:date>2021-11-29T13:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition IN operator problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542496#M2006236</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;319481ee5c07417784f1f1ae49b6371f&lt;/SPAN&gt; you're right !   &lt;/P&gt;&lt;P&gt;I never see it, never use it, thanks for the info &lt;/P&gt;&lt;P&gt;The example in ABAPDOCU uses it without dynamic SQL&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * &lt;BR /&gt;       FROM sbook &lt;BR /&gt;       WHERE class NOT IN ('C','F','Y') &lt;BR /&gt;       INTO TABLE @DATA(sbook_tab). &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Nov 2021 13:33:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542496#M2006236</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-11-29T13:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition IN operator problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542497#M2006237</link>
      <description>&lt;P&gt;dollar?&lt;/P&gt;&lt;P&gt;should be&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SPLIT WA_USER-AUTH_PLANT AT ',' INTO TABLE DATA(auth_plants).&lt;BR /&gt;v_where = |PLANT IN ('{ concat_lines_of( table = AUTH_PLANTS sep = |','| ) }')|.&lt;BR /&gt;select * from zvst_pass INTO TABLE it_vpass WHERE (v_where).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Nov 2021 14:53:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition-in-operator-problem/m-p/12542497#M2006237</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-11-29T14:53:37Z</dc:date>
    </item>
  </channel>
</rss>

