2007 Mar 29 10:52 AM
HI,
What is the exact difference between single, select-options and ranges ?
Thanx in Advance .
Akshitha.
HI,
What is the exact difference between single, select-options and ranges ?
Thanx in Advance .
Akshitha.
2007 Mar 29 10:54 AM
Hi,
Here 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.
Select-options : s_pernr for pa0000-pernr.
(This is diaplayed on the selection screen)
Ranges : r_pernr for pa0000-pernr.
(This is not displayed on the sel. screen)
The structure for Select-options and ranges will be
the same.
Select options are mainly used in the initial selects
to filter the data based on the selection criteria.
If U already know what the values are,then ranges are
used.
Cheers,
Simha.
2007 Mar 29 10:54 AM
select-options and ranges are the same except that select-options are the parameters displayed on selection screen ,where as you have to build the ranges
2007 Mar 29 10:57 AM
Hi,
Single selects single value.
chk this thread
http://www.sap-img.com/abap/difference-between-select-options-ranges.htm
Select-options are the normal select options that you define on Selection screen.
While Ranges are similar to Select options in the way it creates a internal table of the same form as that of Select-options. The internal table that is created has the fields
HIGH
LOW
SIGN
OPTION.
But the difference between Select-options and ranges are that we don't need to define the ranges in Selection screen. It is created by explicitly coding in the Program. (see Example below). And we can fill the internal table for ranges in the program code itself and then can use it in the same manner as we use Select-option of screen
Example: Here r_belnr is range while s_bukrs and s_gsber is Select-options.
Here i have defined a range and then filling it internally in the program coding and then using it in select query.
TYPES: ty_belnr TYPE RANGE OF bkpf-belnr.
DATA: r_belnr TYPE ty_belnr WITH HEADER LINE.
LOOP AT i_bkpf INTO wa_bkpf.
r_belnr-sign = 'I'.
r_belnr-option = 'EQ'.
r_belnr-low = wa_bkpf-belnr.
APPEND r_belnr.
ENDLOOP.
CLEAR r_belnr.
SELECT belnr
aufnr
FROM bseg
INTO TABLE i_bseg
FOR ALL ENTRIES IN i_aufk
WHERE bukrs IN s_bukrs
AND belnr IN r_belnr
AND gjahr EQ p_gjahr
AND gsber IN s_gsber
AND aufnr EQ i_aufk-aufnr.
Regards,
Priyanka.
2007 Mar 29 11:01 AM
i think here single means parameter if it is so
parmeter can take only one value so when you are further checking with parameter you have to put = for checking
parameters : p_matnr like mara-matnr.
select * from mara where matnr = p_matnr.
select-option can take multiple values and as well as range.
actually it is inttable with four fields sign option low high.
when you give any value in selection screen it automatically filled those 4 fields and update the select option table.
here in select you have to write the query like this
select-options : s_op for mara-matnr.
select * from mara where matnr in s_op.
ranges are same like select option but it will not appear in selection screen so you have to fill the range table programitically.
ranges : r_ng for mara-matnr.
r_ng-sign = 'I'.
r_ng-option = 'BT'.
r_ng-low = '10000'.
r_ng-high = '2000'.
append r_ng.
select * from mara where matnr in r_ng.
regards
shiba dutta
2007 Mar 29 11:03 AM
SINGLE gives one value from the tyable..
Select Single * from table...gives single record from the table...this reduces the database interaction and will increase the program speed.
Select-options: is used to get the result in selection screen.
this is used to give the range and will get the reult based ont he range...the values will be stored in internal table and we can use intervals.
Ranges: ios used when we know the values ...so that we can give in program and we can refer in the code logic...This ios used to get the result based on range...but nodisplay in selection screen
2007 Mar 29 11:05 AM
SINGLE gives one value from the tyable..
Select Single * from table...gives single record from the table...this reduces the database interaction and will increase the program speed.
Select-options: is used to get the result in selection screen.
this is used to give the range and will get the reult based ont he range...the values will be stored in internal table and we can use intervals.
Ranges: ios used when we know the values ...so that we can give in program and we can refer in the code logic...This ios used to get the result based on range...but nodisplay in selection screen
2007 Mar 29 11:13 AM
Hi akshitha,
Ranges is a part of SELECT-OPTIONS command which allows u for multiple selections ie, you can specify the range of values here
Whereas 'SINGLE' is used in a SELECT statement to retrieve a single record from the desired table.
Regards,
sowmya
2007 Mar 29 12:59 PM
Hi,
SINGLE is used to retrieve a single record from the desired table.
SELECT-OPTIONS & RANGES are similar in functionality. But coming to select-options system will define an internal table in runtime.
Where as in Ranges we have to define the internal table.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |