Application Development and Automation 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: 
Read only

Difference between RANGE and SELECT-OPTIONS

Former Member
0 Likes
2,776

Hi,

I want to know the diff between

RANGE and SELECT-OPTIONS.

Thanks,

pillac

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,615

Hi,

A select-option will appear on the selection screen, for the user to input values, whereas a range will not.

You have to populate values in a range through code. Select-option values can also be populated / modified with code, before and after user input.

There is no difference between the two except that one (select-options)gives a range input on the selection screen, and ranges must be filled programmatically.

use selct options when allowing the users to input the selections

use ranges to internally set up the data e.g. to select only limited type of FI documents on BKPF or setting up certain profit center or cost center ranges within the program.

Since the int. table generated is same select does not give any performance difference on the use of two.

Regards,

Raj

9 REPLIES 9
Read only

suresh_datti
Active Contributor
0 Likes
1,615

Hi pillac,

SELECT-OPTIONS are for use on the selection screen and enable the user to enter/select input values for a Program. RANGES are for use inside the Program. Once indie the Program both SELECT-OPTION & RANGES are avialble during runtime just like any other internla table. Both of them have the same structure.

Regards,

Suresh Datti

Read only

Former Member
0 Likes
1,615

Conceptually, its the same i.e. its an internal table with the columns high, low, option & sign.

SELECT-OPTIONS is something which the user can see on the screen & interact with.

RANGES is used internally within the program (not visible to the user) in cases where we want to build a value range.

e.g. If the user enters no Company Codes on the screen, you can build a range with all Company Codes from the T tables. This can then be used in your SELECT statements, so that it optimizes your selection.

Check the ABAP help, its very comprehensive..

Read only

Former Member
0 Likes
1,615

something more i am adding :

if you provide select-options(S_MATNR for example) in WHERE condition of select statement:

IF s_matnr is empty, select will fetch all matnrs.

if you use Ranges in where condition,

if R_matnr is empty, it will fetch nothing for you.

so based on your requirement, you need to select the select-options/ranges.

if you are specific about any problem, pl get back to us.

thanks

srikanth

Read only

0 Likes
1,615

<i>

if you use Ranges in where condition,

if R_matnr is empty, it will fetch nothing for you.

</i>

This is not true. S_MATNR and R_MATNR work the same... at least on my system.

Read only

Former Member
0 Likes
1,616

Hi,

A select-option will appear on the selection screen, for the user to input values, whereas a range will not.

You have to populate values in a range through code. Select-option values can also be populated / modified with code, before and after user input.

There is no difference between the two except that one (select-options)gives a range input on the selection screen, and ranges must be filled programmatically.

use selct options when allowing the users to input the selections

use ranges to internally set up the data e.g. to select only limited type of FI documents on BKPF or setting up certain profit center or cost center ranges within the program.

Since the int. table generated is same select does not give any performance difference on the use of two.

Regards,

Raj

Read only

Former Member
0 Likes
1,615

Hi,

Rangees can be used to select a set of values.

tables: mara.

ranges sel for mara-matnr occurs 0.

data: begin of it_mara occurs 0,

matnr like mara-matnr,

mtart like mara-mtart,

end of it_mara.

sel-option = 'EQ'.

sel-low = '1'.

append sel.

sel-low = '6'.

append sel.

sel-low = '3'.

append sel.

select matnr

mtart

from mara

into table it_mara

where matnr in sel.

loop at it_mara.

write: it_mara-matnr,

it_mara-mtart.

endloop.

Regards,

Neelima.

Read only

abdul_hakim
Active Contributor
0 Likes
1,615

Hi Pillac

Welcome to SDN.

RANGES and SELECT-OPTIONS are same with the exception that SELECT-OPTION will create a input fields on the selection screen.

You can use RANGES to pass value to interface of the other programs as well.

Regards,

Abdul

Read only

Former Member
0 Likes
1,615

Thankyou ALL,

Regards,

pillac

Read only

Former Member
0 Likes
1,615

Hi pillac,

Ranges and select-options seems to be same.for both these things seltab will be there.the only difference between these two is.

in select-options u r enabling the enduser to enter the input where as in the range u r giving the values for low,high,sighn and options.it means u r giving the selection criteria at the same time u r coding.if it is not clear for u let me know i'll give u brief description.

if this satisfies u credit me the points.

Regards,

suresh boyina