<?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: Select contains too many Input variables!!! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200549#M1375968</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;The size of memory for where condition is limited, if you exceed it a dump occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A tipical soultion for this problem is to split the selection, something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select-options: s_bp FOR but000-partner. "Business Partner

DATA: HIT_MAX TYPE I VALUE 1000.
DATA: START_INDEX TYPE I,
           FROM_INDEX    TYPE I,
           SEL_INDEX      TYPE I.

RANGES R_BP FOR BUT00-PARTNER.


DESCRIBE TABLE S_BP LINES SEL_INDEX.
IF SEL_INDEX &amp;lt;= HIT_MAX
   SELECT name_org1 crusr INTO TABLE i_but000
      FROM but000 WHERE partner IN s_bp.
ELSE.
  FROM_INDEX = 1.
  TO_INDEX      = HIT_MAX.
  DO.
    APPEND LINES OF S_RBP FROM START_INDEX TO FROM_INDEX TO R_BP.
    SELECT name_org1 crusr APPENDING TABLE i_but000
        FROM but000 WHERE partner IN R_BP.
    REFRESH R_BP.
    FROM_INDEX = TO_INDEX + 1.
    IF FROM_INDEX &amp;gt; SEL_INDEX.
       EXIT.
    ENDIF.
    TO_INDEX = TO_INDEX + HIT_MAX.
    IF TO_INDEX &amp;gt; SEL_INDEX.
       TO_INDEX = SEL_INDEX.
   ENDIF.
  ENDDO.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Sep 2009 12:50:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-29T12:50:59Z</dc:date>
    <item>
      <title>Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200543#M1375962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; I haev select statement below for which i will pass Input as more than 5000 entries in single values of Select options. When i pass 3000 entries in the select -options of S_BP  than iam facign a dump with the following errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. The maximum size of an SQL statement has been exceeded.&lt;/P&gt;&lt;P&gt;2. The statement contains too many input variables.&lt;/P&gt;&lt;P&gt;3. The space needed for the input data exceeds the available memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options:  s_bp    FOR but000-partner.            "Business Partner&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fetch BP data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF NOT s_bp[] IS INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT   partner     "Business Partner Number&lt;/P&gt;&lt;P&gt;             name_org1   "Name 1 of organization&lt;/P&gt;&lt;P&gt;             crusr       "User&lt;/P&gt;&lt;P&gt;              INTO TABLE i_but000&lt;/P&gt;&lt;P&gt;              FROM but000&lt;/P&gt;&lt;P&gt;              WHERE partner IN s_bp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:25:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200543#M1375962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T12:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200544#M1375963</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;a) Discuss with basis and try to take some help from him for memory related problem.&lt;/P&gt;&lt;P&gt;b) You can upload input variables in an internal table and use the internal table in your select statment  using for all entries statment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:35:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200544#M1375963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T12:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200545#M1375964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;consult BASIS guys to increase the memory size&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:38:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200545#M1375964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T12:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200546#M1375965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, the number of entries in the select options is limited. Maybe you can use a inputfile or excel sheet. Read it into a internal table and use the internal table in a SELECT statement with FOR ALL ENTRIES in. Success&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:42:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200546#M1375965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T12:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200547#M1375966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Deepthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please look into the OSS Notes 635318.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a limit to the size of the SQL statement in the DB. For non-unicode it is 28672 characters &amp;amp; for unicode it is 14336 characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:46:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200547#M1375966</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-29T12:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200548#M1375967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is no way to solve that, increasing memory size is nonsense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select options are SAP internal stuff, no SQL dialect can understand this. So the OPEN SQL statement has to be translated to the one the underlying DBMS can understand and often enough, SQL staements are limited in size. In the DB2 Cockpit you can see how such an open sql statement is translated, the select option is mostly translated into a queue of or statements. resulting in a biiiiiiiiiiiiiiiiiiiiiiiiiiig SQL statement which cause a dump, the DBMS cant handle it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to packetize your select option into a range table of let me say up tpo 50 values handled by the sql statement und join the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the report runs in background you can solve it in an old fashioned way: just export the whole table into a flat file, sort the file via external commands, and then filter the flat file with awk and/or grep. Finally read in the flat file,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:49:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200548#M1375967</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-09-29T12:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200549#M1375968</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;The size of memory for where condition is limited, if you exceed it a dump occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A tipical soultion for this problem is to split the selection, something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select-options: s_bp FOR but000-partner. "Business Partner

DATA: HIT_MAX TYPE I VALUE 1000.
DATA: START_INDEX TYPE I,
           FROM_INDEX    TYPE I,
           SEL_INDEX      TYPE I.

RANGES R_BP FOR BUT00-PARTNER.


DESCRIBE TABLE S_BP LINES SEL_INDEX.
IF SEL_INDEX &amp;lt;= HIT_MAX
   SELECT name_org1 crusr INTO TABLE i_but000
      FROM but000 WHERE partner IN s_bp.
ELSE.
  FROM_INDEX = 1.
  TO_INDEX      = HIT_MAX.
  DO.
    APPEND LINES OF S_RBP FROM START_INDEX TO FROM_INDEX TO R_BP.
    SELECT name_org1 crusr APPENDING TABLE i_but000
        FROM but000 WHERE partner IN R_BP.
    REFRESH R_BP.
    FROM_INDEX = TO_INDEX + 1.
    IF FROM_INDEX &amp;gt; SEL_INDEX.
       EXIT.
    ENDIF.
    TO_INDEX = TO_INDEX + HIT_MAX.
    IF TO_INDEX &amp;gt; SEL_INDEX.
       TO_INDEX = SEL_INDEX.
   ENDIF.
  ENDDO.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:50:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200549#M1375968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T12:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200550#M1375969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deepthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you could not use too many rows in your Select-Options. Do you really need to do that? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, you can avoid your dump, if you really want to keep your code, by using a FOR ALL ENTRIES on your Select-Option like this :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT partner name_org1 crusr
  INTO TABLE i_but000
  FROM but000
  FOR ALL ENTRIES IN s_bp
    WHERE partner = s_bp-low.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Samuel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:59:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200550#M1375969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T12:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200551#M1375970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi Deepthi,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Yes you could not use too many rows in your Select-Options. Do you really need to do that? &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Anyway, you can avoid your dump, if you really want to keep your code, by using a FOR ALL ENTRIES on your Select-Option like this :&lt;/P&gt;&lt;P&gt;&amp;gt; Samuel&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No he cant For all entries is an open sql clause which needs to by translated to native sql. The resulting SQL will be too big, too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 13:05:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200551#M1375970</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-09-29T13:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200552#M1375971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;  The resulting SQL will be too big, too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not correct, the DBI will split it into blocks before handing it to the DB, subject to parameter "rsdb/max_blocking_factor" in RZ11, check out the documentation there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 13:15:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200552#M1375971</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-09-29T13:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200553#M1375972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Samuel,&lt;/P&gt;&lt;P&gt; when i used ur select query than im got only first record.when i have 2865 entries as input to S_BP but in the output there is only one entry ie., first entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;deepthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 13:23:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200553#M1375972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T13:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200554#M1375973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're right, if and only if the open sql statement will be translated in such a way. It will be done this way sometimes, but not always.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 13:34:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200554#M1375973</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-09-29T13:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200555#M1375974</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;Just as I said before you should split your selection, that's a typical solution (used in standard program too)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 13:43:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200555#M1375974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T13:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200556#M1375975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt; I am tryign to use the same logic what u said above but im facing a dump at  &lt;STRONG&gt;APPEND LINES OF s_bp FROM v_start_index TO v_from_index TO r_bp.&lt;/STRONG&gt;  I haev trie to add v_start_index = sy-index before append statement. the problem here is v_start_index does not have any value ie., it is zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my code is as below:&lt;/P&gt;&lt;P&gt; IF NOT s_bp-low IS INITIAL AND s_bp-high IS INITIAL.&lt;/P&gt;&lt;P&gt;    DATA: v_hit_max     TYPE i VALUE '1500',&lt;/P&gt;&lt;P&gt;          v_start_index TYPE i,&lt;/P&gt;&lt;P&gt;          v_from_index  TYPE i,&lt;/P&gt;&lt;P&gt;          v_to_index    TYPE i,&lt;/P&gt;&lt;P&gt;          v_sel_index   TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    RANGES: r_bp FOR but000-partner.&lt;/P&gt;&lt;P&gt;    DESCRIBE TABLE s_bp LINES v_sel_index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF v_sel_index &amp;lt;= v_hit_max.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If the S_BP got 1500 records as Input,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;directly fetch the entries from BUT000&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      SELECT partner&lt;/P&gt;&lt;P&gt;             name_org1&lt;/P&gt;&lt;P&gt;             crusr&lt;/P&gt;&lt;P&gt;                INTO TABLE i_but000&lt;/P&gt;&lt;P&gt;                FROM but000&lt;/P&gt;&lt;P&gt;                WHERE partner IN s_bp.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If S_BP got more than 1500 records as Input,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do below logic&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      v_from_index = 1.&lt;/P&gt;&lt;P&gt;      v_to_index = v_hit_max.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      DO.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       v_start_index = sy-index.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        APPEND LINES OF s_bp FROM v_start_index TO v_from_index TO r_bp.&lt;/P&gt;&lt;P&gt;        SELECT partner&lt;/P&gt;&lt;P&gt;               name_org1&lt;/P&gt;&lt;P&gt;               crusr&lt;/P&gt;&lt;P&gt;                  INTO TABLE i_but000&lt;/P&gt;&lt;P&gt;                  FROM but000&lt;/P&gt;&lt;P&gt;                  WHERE partner IN r_bp.&lt;/P&gt;&lt;P&gt;        REFRESH r_bp.&lt;/P&gt;&lt;P&gt;        v_from_index = v_to_index + 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if Start index no is greater than total no of entries in S_BP, than EXIT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        IF v_from_index &amp;gt; v_sel_index.&lt;/P&gt;&lt;P&gt;          EXIT.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;        v_to_index = v_to_index + v_hit_max.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if End index no is greater than total no of entries in S_BP,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;than pass the maximum index to End index&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        IF v_to_index &amp;gt; v_sel_index.&lt;/P&gt;&lt;P&gt;          v_to_index = v_sel_index.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDDO.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 13:53:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200556#M1375975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T13:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200557#M1375976</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're usign the variable v_start_index instaed of V_FROM_INDEX:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; v_from_index = 1.
  v_to_index   = v_hit_max.

  DO.
* v_start_index = sy-index.
* APPEND LINES OF s_bp FROM v_start_index TO v_from_index TO r_bp. "&amp;lt;-------------------
   APPEND LINES OF s_bp FROM v_from_index TO v_to_index TO r_bp.
   SELECT partner name_org1 crusr
      INTO TABLE i_but000
        FROM but000
          WHERE partner IN r_bp.

    REFRESH r_bp.
    v_from_index = v_to_index + 1.
* if Start index no is greater than total no of entries in S_BP, than EXIT
    IF v_from_index &amp;gt; v_sel_index.
      EXIT.
    ENDIF.
    v_to_index = v_to_index + v_hit_max.
* if End index no is greater than total no of entries in S_BP,
* than pass the maximum index to End index
    IF v_to_index &amp;gt; v_sel_index.
      v_to_index = v_sel_index.
    ENDIF.
  ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 14:03:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200557#M1375976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T14:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200558#M1375977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As everyone here said, there is a limit to how large a SQL statement can be and that is a database limitation. If you have single values in your select option, then the resulting SQL statement will look like WHERE field1 = value1 OR field1 = value2 ...... OR field1 = value5000. That is why you are getting the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your options inlcude changing your select statement to FOR ALL ENTRIES. But you have remove the ranges option from your select option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT partner name_org1 crusr INTO TABLE i_but000
                                       FROM but000
                         FOR ALL ENTRIES IN s_bp
                                      WHERE partner = s_bp-low.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also try to do what Max said by limiting your entries in S_BP. To do that you can simply do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: v_count TYPE i.
DATA: r_bp TYPE RANGE OF but000-partner.

LOOP AT s_bp.
  APPEND s_bp TO r_bp.
  v_count = v_count + 1.
  IF v_count = 1000.
    SELECT partner name_org1
                       crusr APPENDING TABLE i_but000
                                        FROM but000
                                       WHERE partner IN r_bp.
    REFRESH r_bp.
    CLEAR v_count.
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 14:26:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200558#M1375977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T14:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200559#M1375978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Deepthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you sure you have use the line with the FOR ALL ENTRIES? It is necessary to use the range as a table and not only as a working area...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Samuel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 14:39:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200559#M1375978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T14:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Select contains too many Input variables!!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200560#M1375979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max, Thanks a Lot&lt;/P&gt;&lt;P&gt;It is working Super...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 15:13:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-contains-too-many-input-variables/m-p/6200560#M1375979</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T15:13:36Z</dc:date>
    </item>
  </channel>
</rss>

