12-28-2006 2:18 PM
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,
12-28-2006 2: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'.
12-28-2006 2: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
12-28-2006 2: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
12-28-2006 2: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'.
12-28-2006 2:50 PM
Thanks a lot. I tested the sample code. It doesn't take anything more than 1624.
I dont know whether it varies from system to system but in my system it takes maximum of 1624.
Thanks everyone.
12-28-2006 2:53 PM
06-13-2013 2:44 PM
Hi,
TABLES : mara.
SELECT-OPTIONS : s_matnr FOR mara-matnr.
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE mara.
DATA: END OF itab.
DO 4800 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'.
For my case it working fine. what will be the correct.
06-13-2013 3:54 PM
12-28-2006 2:28 PM
12-28-2006 2:37 PM
12-28-2006 3: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
06-13-2013 2: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
03-24-2015 6:43 PM
Looking at the age of the thread, apparently SAP has evolved over this time to allow more entries.
I have run into the size limit on SQL statements in DBIF_RSQL_INVALID_RSQL when the selection table and the query were both large.
03-24-2015 6:52 PM
The restriction is actually a database restriction, not SAP. See the note mentioned above.
Rob
03-24-2015 7:06 PM
Databases do not limit SQL statements to 28672 characters, at least not since around version 9 of Oracle (and even in 8 it apparently wasn't enforced Ask Tom &quot;maximum length of sql statement&quot; ).
I'm not sure what the limit is in SAP6.0 or whether it is an SAP parameter, but I managed to blow it up by sending multiple selection-tables, one of which would break it with a few hundred rows, into a query against around fourteen different tables. As it happened it was a non-issue for us because they really wanted everything in that situation, so we just gave them that as an option.
03-24-2015 7:22 PM
From note 635318 :
Message was edited by: Rob Burbank
07-16-2020 10: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.