2009 Feb 09 4:06 PM
Hi gurus,
I have been using Parameters for long. Now I want to choose a range of values, which I need to retrieve from database.
I tried using select-options. Can't I use 2 parameters that is parameter1 and parameter2 and mention query BETWEEN para1 AND
para2, and when I use NO INTERVALS and NO EXTENSION together, it behaves same like parameter, then why did SAP gave these
extensions.
Hi gurus,
I have been using Parameters for long. Now I want to choose a range of values, which I need to retrieve from database.
I tried using select-options. Can't I use 2 parameters that is parameter1 and parameter2 and mention query BETWEEN para1 AND
para2, and when I use NO INTERVALS and NO EXTENSION together, it behaves same like parameter, then why did SAP gave these
extensions.
2009 Feb 09 4:10 PM
hi...
with parameters you can give only single value as input.
select-option is used when we have to give complex selection criteria which can be as
any one of following or combination of following.
single values.
range of values.
excluding single value.
excluding range.
for more detail you can refer
http://help.sap.com/saphelp_46c/helpdata/en/9f/dba78735c111d1829f0000e829fbfe/frameset.htm
along with this there is difference in functionality of both....
if parameter is empty it will return no selection.
if selet-option is space it will return all records
regards
2009 Feb 09 4:13 PM
You have half the answer in your question itself.
Select options for ranges and parameters for single value.
It depends on requirement when to use what..
For example if you want company code specific details
you can use prameters.
If parameters is space it will not fetch any data ,i.e sy-subrc = 4.
If select options is space it will fetch all the records,i.e sy-subrc =0.
Hope your confusion is cleared.
2009 Feb 09 4:18 PM
Hi,
Select-options works as ranges and parameters both.
But in case you want to include/exclude certain value to be used in query, then you can do this using select-options only as you get a button next to the high value.
If you use two parameters, then in that case you need to design that button and handle it, but with select-options you need not to worry about its functionality.
Hope this helps you.
Regards,
Tarun
2009 Feb 09 4:20 PM
Hi,
If you specify NO INTERVALS, NO EXTENSION then input will show like parameter only,
1) but you can specify more than one input values in a variable specified with select-options but where as at parameter variable you can specify only single value.
2) one big diffrence is if input is not specified at paramaeter input variable, the select statement will not fetch data and if you not specified Select-option input variable then select statement will fetch all records for that table.
Regards,
Sunil
2009 Feb 10 4:37 AM
Hello Nazeer,
SELECT-OPTIONS is special form of PARAMETERS.
The major difference between SELECT-OPTIONS and Parameters , is SELECT-OPTIONS can include or exclude the values, which Parameters cannot.
Moreover, when SELECT-OPTIONS are given with NO-EXTENSIONS and NO INTERVALS, it looks like Parameters, but behave differently.
Let me give an example:
PARAMETERS:
p_vbeln TYPE vbap-vbeln.
DATA:
w_vbeln TYPE vbap-vbeln.
SELECT-OPTIONS:
s_vbeln FOR w_vbeln NO-EXTENSIONS NO INTERVALS.1. select * from vbap into table t_vblen where vbeln eq p_vbeln.
2. select * from vbap into table t_vbeln where vbeln in s_vbeln.In 1st statement, when p_vbeln value is null, no record is retrieved.
In 2nd statement, when s_vbeln value is null, all records are retrieved.
Hope it helps you.
Thanks: Zahakson
2009 Feb 10 4:44 AM
Hi friend,
Simple differences between Select-options and parameters.
Select-Options Uses keyword 'for'
Parameters Uses keywords 'like', 'type'
Select-Options Uses operator 'in'
Parameters Uses operator '='
Select-Options Provides ranges for selection
Parameters No ranges only single value
Select-Options Creates selection table
Parameters No selection table
Select-Options When i/p blank all records selected
Parameters When i/p blank none is selected
Note:
Select options can act as parameters by using 'no-extension' 'no intervals', but all records will be selected when i/p is blank unlike parameters.
Might be helpful..
Thanks...
Edited by: Guest77 on Feb 10, 2009 5:44 AM
2009 Feb 10 4:49 AM
Hi,
Parameter is declared for a single value. When we declare a parameter it will not fetch any data(i.e parameter is empty)
Select-option is a complex selection. It will fetch data from database table.
It also has some options like
select single values
selct ranges
exclude single values
exclude ranges
Regards,
Rajani
2009 Feb 10 4:54 AM
Hi,
The main diffrence between select-options and parametrs is,
selct-options gives us a range of selctons but in parameter we can't do that
we can declare parameters as radio buttond and checkboxes but for select-options we can't..
if we mention no-intervals both exhibits the same but select-options occupy the memory where as parametrs does not..
Main difference when selction-criteria...
If we dont mention any values in select-options field at selection-screen it fetches all the values but in Parameters takes as blank value..
Regards
Kiran
2009 Feb 10 4:58 AM
Hi,
go through this link..
http://www.sap-basis-abap.com/abap/difference-between-select-options-and-parameters.htm
2009 Feb 10 5:00 AM
Hi,
In the parameter option you can give only one value,
but with the select-option you can give the value range also you can give the selected value by clicking on the button next to the second input field.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |