Skip to Content
author's profile photo Former Member
Former Member

Select-options maximum limit???

Hi all,

I guess there is a maximum limit that a select-options can hold. If so, what is the maximum number of single values that it can hold upto?

Thanks,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2006 at 02:27 PM
    i guess it is around 1600 - 1700
    
    chk this program , if u increase the do loop to 1800 it will give dump
    
    
    
    REPORT ychatest LINE-SIZE 350.
    
    TABLES : mara.
    SELECT-OPTIONS : s_matnr FOR mara-matnr.
    
    DATA : BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE mara.
    DATA:    END OF itab.
    
    DO 1600 TIMES.
      s_matnr-sign = 'I'.
      s_matnr-option = 'BT'.
      s_matnr-low = ''.
      s_matnr-high = ''.
      APPEND s_matnr.
      CLEAR s_matnr.
    ENDDO.
    
    SELECT  * FROM mara INTO TABLE itab WHERE matnr IN s_matnr.
    
    WRITE : 'hi'.
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2006 at 03:15 PM

    Hello,

    It's good to know that the maximum differs from table to table or should I say per data element. Thing is that all entries in the select-options are expanded in the SQL statement that is generated. The SQL statement passed to the database has its size limitations.

    Please read SAP note 635318 :

    Constructs with SELECT-OPTIONS (or RANGE tables), for example, "WHERE id IN itab", look completely different in the database.These constructs are converted to an AND/OR tree:all 'E' rows are linked with AND and all 'I' rows with OR.These two parts are then linked with AND.Depending on the database system, you can also map the I rows to IN (val1, val2, and so on) if they all have the operator 'EQ'. For a condition created in this way, points 1 and 2 apply.

    The length of the statement in the database must not exceed 28672 characters (with Unicode, 14336 characters).

    kind regards,

    jeroen

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2006 at 02:23 PM

    Hi,

    I dont think, There will be maximum limit for SELECT-OPTIONS.

    As its a kind of internal table, so everytime it will increase the memory size like internal tables.

    Regs

    Manas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2006 at 02:27 PM

    Hi,

    As SELECT-OPTIONS are internal tables. The rules applied to number of lines to an internal table will also applicable to SELECT-OPTIONS too.

    <b>The characterctis of an internal table in number of lines:</b>

    The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries.

    Thanks,

    Vinay

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 28, 2006 at 02:28 PM

    Yes, there is a limit to the number of single values which the program can handle. It may depend on the system, but in my system, I believe it is somewhere between 800 - 1100

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2006 at 02:37 PM

    limit is somewhere between 1000 - 1100

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 13, 2013 at 01:38 PM

    Hi,

    But I have used more than 5000 Single Values in Table Selection Screen.. Even I don't think there would be any maximum limit. Can you make me clear in this ?

    Arun

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      From note 635318 :

      Caution: Individual database systems limit this area to 32,000 bytes. A machine-independent program may therefore not use more than 32,000 bytes for the comparison values in the WHERE, HAVING or ON condition of a command. But this note is 9 years old. I haven't seen this problem in a while (DB6). Rob And I ran a quick test to see what might happen. I was able to run a SELECT with a range containing 15,000 entries, but it dumped with 16,000 entries. So I guess that SAP may have a hard limit on the size of a SELECT-OPTION, but that it is based on underlying database limitations.

      Message was edited by: Rob Burbank

  • Posted on Jul 16, 2020 at 09:35 PM

    The limit depends entirely on how you are using the select-options table. Because it is a table you can load any number of rows into it, but if you subsequently apply it for use against an SQL select statement, or as a table parameter passed to another program, which then applies it against an SQL select statement, then you are limited by the length of the SQL statement that will be generated.

    Each Select-Options row will translate into code expanding the length of the SQL select statement, and so the more rows you have, the longer the resulting select statement will become. Also, the longer each data item in the select-options is, the longer the statement will become.

    It is because of the fact that the data length of each select-option entry impacts the length, that people have given different limits in above posts, as the length directly impacts how many entries can be processed into the selection statement before it blows its limit.

    You cannot see the resulting select statement, as the translation of the select-options into the IN clause is done behind the scenes.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.