Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

diff b/w parameters & select-options

Former Member
0 Likes
2,094

what z the difference between Parameters and select options other than

parameters - only one value can be accepted whereas

select options - range of values

6 REPLIES 6
Read only

Former Member
0 Likes
1,180

Hi Kota,

Difference between Select-Options and Parameters

The main difference between select-options and parameters is that the select-option creates a selection table consisting of 4 fields.

Please go thru the following details to learn more bout it...

Description of the individual components:

SIGN

The data type of SIGN is C with length 1. The contents of SIGN determine for each row whether the result of the row condition is to be included in or excluded from the resulting set of all rows.

Possible values are I and E.

– I stands for "inclusive" (inclusion criterion - operators are not inverted)

– E stands for "exclusive" (exclusion criterion - operators are inverted)

OPTION

The data type of OPTION is C with length 2. OPTION contains the selection operator. The following operators are available:

– If HIGH is empty, you can use EQ, NE, GT, LE, LT,CP, and NP. These operators are the same as those that are used for logical expressions. Yet operators CP and NP do not have the full functional scope they have in normal logical expressions. They are only allowed if wildcards ( '*' or '+' ) are used in the input fields.

If wildcards are entered on the selection screen, the system automatically uses the operator CP. The escape character is defined as #.

– If HIGH is filled, you can use BT (BeTween) and NB (Not Between). These operators correspond to BETWEEN

and NOT BETWEEN that you use when you check if a field belongs to a range. You cannot use wildcard characters.

- LOW

The data type of LOW is the same as the column type of the database table, to which the selection criterion is linked.

– If HIGH is empty, the contents of LOW define a single field comparison. In combination with the operator in OPTION, it specifies a condition for the database selection.

– If HIGH is filled, the contents of LOW and HIGH specify the upper and lower limits for a range. In combination with the operator in OPTION, the range specifies a condition for the database selection.

- HIGH

The data type of HIGH is the same as the column type of the database table, to which the selection criterion is linked. The contents of HIGH specify the upper limit for a range selection.

The parameter statement does not create a selection table .

The second thing is select-option gives us a range for selection, whereas parameter doesn't .

Using the parameter you can define radio buttons and checkboxes where as select-options can't .

With PARAMETERS you can force a VALUE CHECK (through Foriegn key or Domain Values) Where as you cannot do this in SELECT-OPTIONS.

The KEYWORD for PARAMETERS is VALUE CHECK.

Regards,

Priyanka.

Read only

Former Member
0 Likes
1,180

The main difference lies in the data selection when parameters and select options are used. Using a parameter, if the selection screen field is left blank, then no data is selected. But if the select option is left blank and is used in select statement, all the data from db is selected.

Another difference is that parameter acts as a variable whereas select option acts as an internal table with a predefined structure.

Read only

Former Member
0 Likes
1,180

Hi,

Parameters takes single value

and we use = in where condition for that field

When you declare select-options a selection tables like Internal table with 4 fields like SIGN,OPTION,LOW and High gets created to store the multiple values that are entered in the select -options.

and and we use IN in where condition for that s select-options field

reward if useful

regards

Anji

Read only

former_member404244
Active Contributor
0 Likes
1,180

Hi,

Yes u r correct..we can have only one value for parameters and for select-options we have range of values.

plz go through the below link...

http://www.sap-basis-abap.com/abap/difference-between-select-options-and-parameters.htm

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,180

You have also some other differences :

VALUE CHECKING :

parameters you have to use =, >, <>, ...

select-options you have to use IN

With select-options, if the user don't put any value, it will means that all data are correct. Not with parameters.

For example :

SELECT *
   FROM mara
   WHERE
     MATNR IN s_matnr.

If s_matnr is initial you will return all datas

SELECT *
   FROM mara
   WHERE
     MATNR = p_matnr.

If p_matnr is initial you won't have any data.

Hope this help,

Mathieu

Read only

Former Member
0 Likes
1,180

hi

<b>For the select-options</b> (complex selection), you will be using IN operator in the SQL..If there is no record in the select-options the field value in the where clause is not considered.

<b>But for parameters</b> (single selection), you will be using EQ operator in the SQL..if there is no value in the parameter which means blank..Then if you are selecting with a blank value you will not get any record..unless there is a record available in the database with a blank value.

<b>It is because of the select-options property that when it is leave empty all values will be selected. and when parameter is empty no value will be selected.</b>

regards

ravish

<b>plz reward points if helpful</b>