Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Max limit of Selection-option single values?

Former Member
0 Kudos

Hello,

Please tell me what is the maximum limit of selection-option entries if we are entering single values in selection-option's multiple selection tab?

When i tried to enter 33K entries into same i got ABAP Dump.

1 ACCEPTED SOLUTION

former_member209685
Participant
0 Kudos

Hi Sharayu,

As far as I know the limit is defined by the maximum SQL statement length of the underlying SQL database.

if you enter multiple select-option entries that include equal a value and pass those values to a SELECT statements or a report/transaktion that passes those values to a SELECT statement. SAP will generate a SQL query statement out of those select-options that looks somthine like this

SELECT * FROM TABLE mytable WHERE fieldname = <first value from SE> OR fieldname = <second value from SE> OR fieldname = <third value from SE> ... this continues until all entries in the select-options are added to the statement.

So if you add around 33000 entries in a select-option you are generating an SQL statement that is around 600KB large.

Oracle 11g has apparently a 64K limit. See http://bytes.com/topic/oracle/answers/899061-what-maximum-query-length-oracle and SQL-Server about the same http://msdn.microsoft.com/en-us/library/ms143432.aspx

18 REPLIES 18

franois_henrotte
Active Contributor
0 Kudos

you can put a lot of rows into a select-option but when you will use it into your SELECT statement, you can only have a maximum of 255 !!!

so if you intend to use a select-option in a SELECT you have to test the number of rows and

- use the IN keyword if less than 250

- use FOR ALL ENTRIES IN keywords if more than 250

i'm not asking about select query...

my question is about selection screen...

on selection screen at max how many entries can be gives as input in single value tab...

Former Member
0 Kudos

Hi !

In my expirience it's a kind of dynamic thing (so I still don't know on what it depends).

In my understanding SAP generates dynamic-SQL and so it may depend on the SQL-Database your SAP is runnig with.

I expirienced to work with about 1500 lines but not much more....

32000 seam for me to be out of range....

Regards

Rainer

Some points would be nive if that helped....

0 Kudos

How to determine exact range of this selection value tab?

I need to calculate this range as i'm going to upload lakhs of records and i want to feed individual line entries as they are random records and can not be put into range.

0 Kudos

Hi Sarayu,Could you please tell how have you resolved this issue?. I too have the same requirement.

0 Kudos

Hi,

in my experience i faced the problem with more than 2000 records[dump].... so

replacing select ....where clause.. IN Select_option with ...for all entries solved the issue..

select ... for all entries in select_option[] where clause ... eq select_option-low , if you are giving value in only in LOW field of select option other wise build table entries in to temporary table and use for all entries.

former_member209685
Participant
0 Kudos

Hi Sharayu,

As far as I know the limit is defined by the maximum SQL statement length of the underlying SQL database.

if you enter multiple select-option entries that include equal a value and pass those values to a SELECT statements or a report/transaktion that passes those values to a SELECT statement. SAP will generate a SQL query statement out of those select-options that looks somthine like this

SELECT * FROM TABLE mytable WHERE fieldname = <first value from SE> OR fieldname = <second value from SE> OR fieldname = <third value from SE> ... this continues until all entries in the select-options are added to the statement.

So if you add around 33000 entries in a select-option you are generating an SQL statement that is around 600KB large.

Oracle 11g has apparently a 64K limit. See http://bytes.com/topic/oracle/answers/899061-what-maximum-query-length-oracle and SQL-Server about the same http://msdn.microsoft.com/en-us/library/ms143432.aspx

0 Kudos

Finally, a correct answer to this frequently asked question

Please note though that this thread was started almost five years ago...

Cheers

Thomas

0 Kudos

It just appeared in my activity list. So I though I'd reply. Maybe Selva get some help with this info.

Hmm, blog post time ?

Cheers
   Adi

0 Kudos

Why not, if you add some more beef like looking at the various databases, the sympton as seen by the ABAP developer (short dump title and details), etc.

This question will come again (by people not searching before asking), then I can lock them and point to your document.

Thomas

0 Kudos

of course this limit will only apply if the actual select-option is used diectly within a select. for example when using SE16. But an abap can be coded to descale the select-option values and use package size option.

eg, the following program dumped for me if i pushed in 30,000 equipment numbers and a packsize of 10,000 but it was fine with a packsize of 6,000.

REPORT znrw_pack_sel .

TABLES cdhdr.

SELECT-OPTIONS: s_objid FOR cdhdr-objectid.

PARAMETER: p_pksize TYPE sydbcnt DEFAULT 10000.

RANGES r_objid FOR cdhdr-objectid.

DATA: lv_batch TYPE sydbcnt VALUE 0,

lv_total_lines_to_process TYPE sydbcnt,

lv_start_line TYPE sydbcnt,lv_end_line TYPE sydbcnt,

gt_cdhdr TYPE TABLE OF cdhdr.

START-OF-SELECTION.

  DESCRIBE TABLE s_objid LINES lv_total_lines_to_process.

  WRITE: / 'LINES TO SELECT:', lv_total_lines_to_process.

  DO.

    lv_start_line = lv_end_line + 1.

    ADD p_pksize TO lv_end_line.

    REFRESH r_objid.

    APPEND LINES OF s_objid FROM lv_start_line TO lv_end_line

     TO r_objid.

    WRITE: / 'SELECTING LINES',lv_start_line, 'TO', lv_end_line.

    SELECT * FROM cdhdr

    PACKAGE SIZE p_pksize

    APPENDING TABLE gt_cdhdr

    WHERE objectclas = 'EQUI'

    AND objectid IN r_objid.

    ENDSELECT.

    WRITE: / ' SELECTED',sy-dbcnt, 'ROWS'.

* EXIT WHEN NO MORE ENTRIES TO SELECT

    IF lv_end_line >= lv_total_lines_to_process.

      EXIT.

    ENDIF.

  ENDDO.

0 Kudos

Thanks Adi Sieker .

It means that there is no limitation from SAP on the number of values passed through the select option irrespective of the limitations imposed by the underlying database. Please correct me if I have misunderstood anything.

Thanks again,

Selva.

0 Kudos

Hi Neil,

of course you can code around that problem using PACKAGE SIZE in the SELECT statement, but there are so many reports that don't do this. Supplying thousands of entries in a select option isn't a day to day use case.

Cheers
  Adi

0 Kudos

Hi Selva,

that is correct.

If you have the problem with a report of your own. You can code around that problem using the PACKAGE SIZE addition to the SELECT statement. See the reply from Neil Woodruff.

Cheers
   Adi

0 Kudos

Another common workaround, if a long list of single values is involved, is to use the FOR ALL ENTRIES construct.

Thomas

0 Kudos

Thanks a lot Adi Siekar.

0 Kudos

Hi,

Some time has passed since this question was raised, however, some future SAP colleagues might face the same issue. Therefore, I will write what my testing experience is:

After extensive testing of wanting to know after which amount program throws ABAP Dump, I came to the conclusion that the exact number of entries where it doesn't throw dump is 32193. The moment I enter 32194 entries, the program terminates and shows me ABAP Dump.

Hope this information helps.


BR,
Jovana

Former Member
0 Kudos

I saw your posted comment. Please raise your question again as a new question and follow our rules of engagement: https://community.sap.com/resources/rules-of-engagement. The author of the original question is no longer active in the community and won't receive your query. Feel free to take our Q&A tutorial at: https://developers.sap.com/tutorials/community-qa.html. With these tips you'll be able to prepare questions that draw responses from our members. Thanks!

Best,

Your SAP Community moderator