‎2005 Dec 20 1:47 PM
Hi,
I want to know the diff between
RANGE and SELECT-OPTIONS.
Thanks,
pillac
‎2005 Dec 20 1:56 PM
Hi,
A select-option will appear on the selection screen, for the user to input values, whereas a range will not.
You have to populate values in a range through code. Select-option values can also be populated / modified with code, before and after user input.
There is no difference between the two except that one (select-options)gives a range input on the selection screen, and ranges must be filled programmatically.
use selct options when allowing the users to input the selections
use ranges to internally set up the data e.g. to select only limited type of FI documents on BKPF or setting up certain profit center or cost center ranges within the program.
Since the int. table generated is same select does not give any performance difference on the use of two.
Regards,
Raj
‎2005 Dec 20 1:50 PM
Hi pillac,
SELECT-OPTIONS are for use on the selection screen and enable the user to enter/select input values for a Program. RANGES are for use inside the Program. Once indie the Program both SELECT-OPTION & RANGES are avialble during runtime just like any other internla table. Both of them have the same structure.
Regards,
Suresh Datti
‎2005 Dec 20 1:53 PM
Conceptually, its the same i.e. its an internal table with the columns high, low, option & sign.
SELECT-OPTIONS is something which the user can see on the screen & interact with.
RANGES is used internally within the program (not visible to the user) in cases where we want to build a value range.
e.g. If the user enters no Company Codes on the screen, you can build a range with all Company Codes from the T tables. This can then be used in your SELECT statements, so that it optimizes your selection.
Check the ABAP help, its very comprehensive..
‎2005 Dec 20 1:55 PM
something more i am adding :
if you provide select-options(S_MATNR for example) in WHERE condition of select statement:
IF s_matnr is empty, select will fetch all matnrs.
if you use Ranges in where condition,
if R_matnr is empty, it will fetch nothing for you.
so based on your requirement, you need to select the select-options/ranges.
if you are specific about any problem, pl get back to us.
thanks
srikanth
‎2005 Dec 20 2:30 PM
<i>
if you use Ranges in where condition,
if R_matnr is empty, it will fetch nothing for you.
</i>
This is not true. S_MATNR and R_MATNR work the same... at least on my system.
‎2005 Dec 20 1:56 PM
Hi,
A select-option will appear on the selection screen, for the user to input values, whereas a range will not.
You have to populate values in a range through code. Select-option values can also be populated / modified with code, before and after user input.
There is no difference between the two except that one (select-options)gives a range input on the selection screen, and ranges must be filled programmatically.
use selct options when allowing the users to input the selections
use ranges to internally set up the data e.g. to select only limited type of FI documents on BKPF or setting up certain profit center or cost center ranges within the program.
Since the int. table generated is same select does not give any performance difference on the use of two.
Regards,
Raj
‎2005 Dec 20 2:15 PM
Hi,
Rangees can be used to select a set of values.
tables: mara.
ranges sel for mara-matnr occurs 0.
data: begin of it_mara occurs 0,
matnr like mara-matnr,
mtart like mara-mtart,
end of it_mara.
sel-option = 'EQ'.
sel-low = '1'.
append sel.
sel-low = '6'.
append sel.
sel-low = '3'.
append sel.
select matnr
mtart
from mara
into table it_mara
where matnr in sel.
loop at it_mara.
write: it_mara-matnr,
it_mara-mtart.
endloop.
Regards,
Neelima.
‎2005 Dec 20 2:33 PM
Hi Pillac
Welcome to SDN.
RANGES and SELECT-OPTIONS are same with the exception that SELECT-OPTION will create a input fields on the selection screen.
You can use RANGES to pass value to interface of the other programs as well.
Regards,
Abdul
‎2005 Dec 21 5:06 AM
‎2005 Dec 21 5:47 AM
Hi pillac,
Ranges and select-options seems to be same.for both these things seltab will be there.the only difference between these two is.
in select-options u r enabling the enduser to enter the input where as in the range u r giving the values for low,high,sighn and options.it means u r giving the selection criteria at the same time u r coding.if it is not clear for u let me know i'll give u brief description.
if this satisfies u credit me the points.
Regards,
suresh boyina