‎2007 May 15 6:18 AM
‎2007 May 15 11:00 AM
hi,
ranges is like select options which used before versions of sap 4.7
ranges works similar to select-options but difference is that for ranges we have to explicitly give all values as it doesnt reqiure for select options
ex:
ranges:matnr like mara-matnr.
matnr-low = 'value'.
matnr-high = ''value'.
matnr-sign = ' e or i'. [include or exclude]
matnr-option=' bt r eq r ne'. [between or equal or notequal or in ....]
but for select-options this type of assignment isn't mandatory.
if helpful reward some points.
with regards,
suresh babu aluri.
‎2007 May 15 6:20 AM
‎2007 May 15 6:22 AM
hi..
In addition to selection tables that you create using SELECT-OPTIONS, you can use the RANGES statement to create internal tables that have the structure of selection tables. You can use these tables with certain restrictions the same way you use actual selection tables.
regards,
veeresh
‎2007 May 15 6:23 AM
Hi
Ranges is similar to select-options which we declare on the selection screen
when we declare ranges a selection table (internal table) is created with 4 fields like
SIGN, OPTION, LOW and HIGH and the values are populated into ranges.
When we use select-options we will give sequencial values for that field where as for ranges we use any number (non-sequencial) and use it in the where condition similar to select-options.
Reward points if useful
Regards
Anji
‎2007 May 15 6:23 AM
ranges is for selection criteria which does not have internal table implicitly. One can define that externally.
Regards
‎2007 May 15 8:02 AM
ranges refer to the range of values for a given field.
example
ranges : r_matnr for matnr.
r_matnr-sign = 'I'.
r_matnr-options = 'EQ'.
r_matnr-low = '4000000'.
r_matnr -high = '8000000'.
append r_matnr.
clear r_matnr.
Reward with points if helpful.
‎2007 May 15 8:08 AM
Hai,
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.
For more information refer the below links:
check out this link
http://www.sap-img.com/abap/difference-between-select-options-ranges.htm
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 it helps you.
Regards,
Kumar.
‎2007 May 15 10:45 AM
<b>Hi,
All the above facts is obvious. Even internally the Select-Options uses Ranges.</b>
eg:
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR NO-EXTENSION
ranges : S_matnr for matnr.
s_matnr-sign = 'I'.
s_matnr-options = 'EQ'.
s_matnr-low = '00000000000000106'.
s_matnr -high = '00000000000000109'.
append s_matnr.
clear s_matnr.
The practical use of ranges will be when using screen painter, and where there will be a situation where we need to get high and low values using I/O fields.
In that case, the value obtained from i/o fields can be taken put in ranges and making it as a selection criteria thereby helpful to fetch list to the internal table.
‎2007 May 15 11:00 AM
hi,
ranges is like select options which used before versions of sap 4.7
ranges works similar to select-options but difference is that for ranges we have to explicitly give all values as it doesnt reqiure for select options
ex:
ranges:matnr like mara-matnr.
matnr-low = 'value'.
matnr-high = ''value'.
matnr-sign = ' e or i'. [include or exclude]
matnr-option=' bt r eq r ne'. [between or equal or notequal or in ....]
but for select-options this type of assignment isn't mandatory.
if helpful reward some points.
with regards,
suresh babu aluri.
‎2007 May 16 5:27 AM