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

Select-options Vs Ranges

former_member577909
Participant
0 Likes
858

Difference between the Select-options and ranges., please give examaples of each and tell where to use what.

Difference between the Select-options and ranges., please give examaples of each and tell where to use what.

5 REPLIES 5
Read only

Former Member
0 Likes
818

SELECT-OPTIONS - On the selection screen, you can declare RANGES on the selection screen.

RANGES - Inside the program, if you want to have variable with RANGES option, use the RANGES variable. You cannot declare and use SELECT-OPTIONS inside the program.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
818
Read only

Former Member
0 Likes
818

Hi Bhasker,

SELECT-OPTIONS & RANGES both are used for the range selection from selection screen. The diff. 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.

For Eg

TABLES mara.

SELECT-OPTIONS : material FOR mara-matnr.

INITIALIZATION.

material-LOW = 1001. " It specifies the range starting value.

material-HIGH = 0000. " It specifies the range ending value.

material-OPTION = 'EQ'. " specifies ranges value is in equal.

material-SIGN = 'I'. "specifies both inclussive.

APPEND material .

SELECT * FROM mara INTO TABLE ITAB

WHERE matnr IN material.

RANGES:

RANGES: material FOR mara-matnr.

Hope this helps

regds

Seema

Read only

former_member404244
Active Contributor
0 Likes
818

HI,

SELECT-OPTIONS - this is used in order to have selection screen .Here u wil give the range of values.

For example.i need to retrieve data for some materials.So i wil give as

select-options : s_matnr for mara-matnr (in program) and in the selection screen u wil give the range 1 to 10.Means for material 1 to 10 u can retrieve the data.In program u need to write

select * from mara into table it_mara where matnr in s_matnr.The values u specify in the selection screen may vary and u wil get the data as per the values u specify in the select-options.

But for RANGES u won't get selection screen and if u r fixed data for 1 to 5 materials only i need to retreive data.then go for Ranges.

regards,

nagaraj

Read only

Former Member
0 Likes
818

hi bhaskar,

In select-options we will give the lower limit and the higher limit with no condition.ie we cannot fetch values like for example,

we need only employees of 100,111,115 from 100 to 120 we cannot get through select-options .

whereas in ranges we have the options to get that.they are

HIGH,LOW,SIGN&OPTION.

so wecan specify a condition in the above options.

thanks®ards

magesh.

Message was edited by:

magesh anandan