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: 

Maximum allowable input for select-options

madhu_reddy22
Participant
0 Kudos

Hi All,

Can we enter any number of values in select-options on the selection screen. What is the limit on the number of values that can be given for select options.

For example if the limit for a select-options field is 100000 and if i want to give 999999 values as input on the selection screen, how am I supposed to handle this.

Thanks in advance,

Madhu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Total Questions: 33 (21 unresolved)

You might want to think about cleaning up your old posts.

Rob

6 REPLIES 6

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

You always have the option to provide a range .

Former Member
0 Kudos

Hi Madhu,

see the sample code below .. i hope it this will help you..


SELECT-OPTIONS: s_order FOR vbak-vbeln .   "Default the value range 100000 to 9999999 appears on the screen

INITIALIZATION.

* Loading default values to screen input for Sales Order field
  MOVE 'I'          TO s_order-sign.
  MOVE 'BT'         TO s_order-option.
  MOVE '1000000'   TO s_order-low.
  MOVE '9999999'   TO s_order-high.
  APPEND s_order.


* Screen field Validation
AT SELECTION-SCREEN ON s_order.
if s_order-low NE 100000.
 message 'Sales order Low value should be 100000' type 'E'.
endif.
if s_order-High NE 999999.
 message 'Sales order High value should be 999999' type 'E'.
endif.

Regards,

Prabhudas

Former Member
0 Kudos

Total Questions: 33 (21 unresolved)

You might want to think about cleaning up your old posts.

Rob

madhu_reddy22
Participant
0 Kudos

I want to give entries such as 1,4 ,51, 72 .........9999999 . So i cannot give a range.

I want to know the way to handle the inputs if the number of values exceed the limit.

Thank you,

Madhu

0 Kudos

Try this way..



data : w_count type i.

SELECT-OPTIONS: s_order FOR vbak-vbeln .  

* Screen field Validation
AT SELECTION-SCREEN ON s_order.
DESCRIBE TABLE s_order LINES w_count.
if w_count LT 0.         "Enter value here how many minimum values need to enter
 message 'Minimum one sales order need to entry' type 'E'.
endif.
if w_count GT 99999.    "enter Values here what is the Maximum inputs
 message 'Maximum Sales order inputs should not excedd 999999' type 'E'.
endif.

Regards,

Prabhudas

Former Member
0 Kudos

You can not enter any number in the select-option field and the number is limited by the length of the SQL string supported by your database system. Obviously, the number of entries depends on the width of the field. When the entries exceed the string length limit, you will get a run time error (short dump).

You have two options:

1) See if you can implement "for all entries" feature of ABAP SELECT statement.

2) You go in a loop and submit just 1000 (or so) entries at a time to the SELECT statement.