<?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 Dynamic SQL Selection in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094189#M1615737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;im getting this error SAPSQL_IN_ILLEGAL_LIST when i do my dynamic selection on the where clause. Im running on 4.6C and the dynamic selection is like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_select = 'PERNR IN SO_PERNR AND BEGDA IN SO_BEGDA AND ENDDA IN SO_ENDDA'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT (lv_select_fields) FROM (lv_table) INTO &amp;lt;fs&amp;gt; WHERE (lv_select).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it because i used the in structure in select?&lt;/P&gt;&lt;P&gt;is there a solution to work around this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Aug 2011 14:39:06 GMT</pubDate>
    <dc:creator>john_wayne</dc:creator>
    <dc:date>2011-08-03T14:39:06Z</dc:date>
    <item>
      <title>Dynamic SQL Selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094189#M1615737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;im getting this error SAPSQL_IN_ILLEGAL_LIST when i do my dynamic selection on the where clause. Im running on 4.6C and the dynamic selection is like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_select = 'PERNR IN SO_PERNR AND BEGDA IN SO_BEGDA AND ENDDA IN SO_ENDDA'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT (lv_select_fields) FROM (lv_table) INTO &amp;lt;fs&amp;gt; WHERE (lv_select).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it because i used the in structure in select?&lt;/P&gt;&lt;P&gt;is there a solution to work around this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 14:39:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094189#M1615737</guid>
      <dc:creator>john_wayne</dc:creator>
      <dc:date>2011-08-03T14:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL Selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094190#M1615738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe the error is linked to the Input List. &lt;/P&gt;&lt;P&gt;Have you tried using SELECT * instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: PA0001.
*
select-options: so_pernr for pa0001-pernr,
                so_begda for pa0001-begda,
                so_endda for pa0001-endda.

data: where_tab type standard table of char100,
      where_clause(100) type c.
DATA: dataref TYPE REF TO data.
FIELD-SYMBOLS: &amp;lt;FS&amp;gt;, &amp;lt;CAMPO&amp;gt;.

DATA: L_TABLA(30).

L_TABLA = 'PA0001'.

CREATE DATA dataref TYPE (L_TABLA).
ASSIGN dataref-&amp;gt;* TO  &amp;lt;FS&amp;gt;.


WHERE_CLAUSE =  'PERNR IN SO_PERNR AND'.
APPEND WHERE_CLAUSE TO WHERE_TAB.

WHERE_CLAUSE =  'BEGDA IN SO_BEGDA AND'.
APPEND WHERE_CLAUSE TO WHERE_TAB.

WHERE_CLAUSE =  'PERNR IN SO_ENDDA'.
APPEND WHERE_CLAUSE TO WHERE_TAB.


  select *
         from (L_TABLA)
         INTO  &amp;lt;FS&amp;gt;
         where (WHERE_TAB).
 endselect.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 15:07:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094190#M1615738</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-08-03T15:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL Selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094191#M1615739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;im actually not allowed to use select endselect but the error is coming from the where clause or the select fields part?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 15:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094191#M1615739</guid>
      <dc:creator>john_wayne</dc:creator>
      <dc:date>2011-08-03T15:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL Selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094192#M1615740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abaperdaft,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The documentation (http://help.sap.com/saphelp_46c/helpdata/en/fc/eb3a1f358411d1829f0000e829fbfe/frameset.htm) clearly says:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ... WHERE (&amp;lt;itab&amp;gt;) ...&lt;/P&gt;&lt;P&gt;where &amp;lt;itab&amp;gt; is an internal table with line type C and maximum length 72 characters. All of the conditions listed above &lt;STRONG&gt;except for selection tables&lt;/STRONG&gt; , can be written into the lines of &amp;lt;itab&amp;gt;. However, you may only use literals, and &lt;STRONG&gt;not the names of data objects&lt;/STRONG&gt; . The internal table can also be left empty.&lt;/P&gt;&lt;P&gt;If you only want to specify a part of the condition dynamically, use:&lt;/P&gt;&lt;P&gt;SELECT ... WHERE &amp;lt;cond&amp;gt; AND (&amp;lt;itab&amp;gt;) ...&lt;/P&gt;&lt;P&gt;You cannot link a static and a dynamic condition using OR.&lt;/P&gt;&lt;P&gt;You may only use dynamic conditions in the WHERE clause of the SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, you cannot use IN, and you cannot indicate a data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To convert a range into WHERE, you should call function module FREE_SELECTIONS_RANGE_2_WHERE. I think there are examples in SDN. If it's not clear how to make it work, please revert back to us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 15:49:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094192#M1615740</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2011-08-03T15:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL Selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094193#M1615741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are not allowed to use SELECT/ENDSELECT, you may use SELECT.. INTO TABLE instead&lt;/P&gt;&lt;P&gt;In this case you can use the SELECT-OPTIONS as part of the condiition tab, as shown above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 15:53:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-selection/m-p/8094193#M1615741</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-08-03T15:53:10Z</dc:date>
    </item>
  </channel>
</rss>

