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: 

ranges

Former Member
0 Kudos

what is exact purpose of selection-screen 'ranges' and what are various advantages of using 'ranges' .its urgent please

1 ACCEPTED SOLUTION

FredericGirod
Active Contributor
0 Kudos

Ranges is very usefull when you would like to make a SELECT with a list of values.

instead of

select ... into table ... from ... for all entries in ... where ...

you remove the "for all entries in".

It's just a problem of performance. Because for all entries make a lot of database access.

The danger with the ranges is the size, greater than 3000 entries, you will have a dump.

Fred

6 REPLIES 6

FredericGirod
Active Contributor
0 Kudos

Ranges is very usefull when you would like to make a SELECT with a list of values.

instead of

select ... into table ... from ... for all entries in ... where ...

you remove the "for all entries in".

It's just a problem of performance. Because for all entries make a lot of database access.

The danger with the ranges is the size, greater than 3000 entries, you will have a dump.

Fred

Former Member
0 Kudos

Hi,

Ranges can be described as programatic version of select-option. They are used to filter data from database or internal table. They work similar to select-options.

Definition

RANGES : r_werks FOR mard-werks,

r_lgort FOR mard-lgort.

Filling it with data

r_werks-sign = 'I'.

r_werks-option = 'EQ'.

r_werks-low = p_werks1.

APPEND r_werks.

CLEAR r_werks.

Usage

SELECT * from marc where werks in r_werks.

Regards,

Sankar

Former Member
0 Kudos

SELECT-OPTIONS: Declare an internal table that is also linked to input fields on a selection screen

RANGES: Declare an internal table with the same structure as in select-options, but without linking it to a selection screen.

FOR FURTHER DOCUMENTATION PLEASE GO THROUGH THE LINK

Difference Between Select-Options & Ranges

Statical Declaration

Selection tables

<b>

Regards,

Azhar</b>

0 Kudos

Former Member
0 Kudos

HI Sandeep,

Both SELECT-OPTIONS & RANGES works for the same purpose. They both are used for the range selection from selection screen. The main diff. between them is, while we use SELECT-OPTIONS system implicitly creates the select options internal table which contains the fields of SIGN,OPTION,LOW & HIGH. But in case of RANGES, this internal table should be defined explicitly.

Hope this helps.

Former Member
0 Kudos

HI,

Select-Options : They provides user with an option to enter value in the selection screen...... and it can be used in programs only.

Ranges : This provides a way to populate the range of values programatially and for further use.. e.g. if you want to pass a range of values to a select query to some function module then select options will not work.....then you have to go with ranges.

Thanks,CSR.

Please Reward if helpful.