2006 Dec 14 5:18 AM
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.
2006 Dec 14 5:21 AM
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
2006 Dec 14 5:24 AM
hi,
check out this link
http://www.sap-img.com/abap/difference-between-select-options-ranges.htm
regds,
srini
2006 Dec 14 5:43 AM
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
2006 Dec 14 5:47 AM
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
2006 Dec 14 11:34 AM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |