Application Development 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: 

reports

Former Member
0 Kudos

what is the difference between parameters and select-options?

8 REPLIES 8

Former Member
0 Kudos

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 .

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

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

former_member156446
Active Contributor
0 Kudos

Hi Chinna

with parameters you can give only one value.

with select-option you can check the range of values.


parameter: pa_vbeln like vbak-vbeln.
select-options: so_vbeln for vbak-vbeln.

*Usage:*
vbeln *eq* pa_vbeln.

Vbeln *in* so_vbeln.

reward points if helpful.

Former Member
0 Kudos

parameter is just an input filed for a filed

while select option is a input filed where you can give value range if needed

more basic info regarding this can be easily found in F1 help of these keywords

Former Member
0 Kudos

Usha,

Parameters : It will allow to enter on on input value in

selection screen

Select-OPRIONS : It will allow range of objects.

EX : From 'A' To 'F'.

It will act as an internal table.

Don't forget to reward if useful....

Former Member
0 Kudos

hi,

If you want to enable the user to enter values for single fields on the selection screen, you must define specific variables (parameters) in the declaration part using the PARAMETERS statement. Each parameter declared with the PARAMETERSstatement appears as an input field on the relevant selection screen.

Parameters are used for simple queries of single values. For example, you can use parameters to control the program flow. However, if you want to restrict database accesses or perform complex selections, you should use selection criteria.

Unlike parameters that are declared as elementary variables in ABAP programs, selection criteria are based on special internal tables, called selection tables. To define a selection criterion, you must declare a selection table in the declaration part using the SELECT-OPTIONSstatement. The relevant possible entries then appear on the selection screen.

You can use the SELECT-OPTIONS statement for both standard and user-defined selection screens. If the program is linked to a logical database, you must consider several special rules for handling selection criteria. The following sections explain the variants of the SELECT-OPTIONS statement which are important for program-specific selections.

plz reward points if helpful..

Former Member
0 Kudos

Hi,

PARAMETERS

Syntax

PARAMETERS {para(len)}|{para LENGTH len}

type_options

screen_options

value_options

ldb_options.

Effect

Declaration of a para parameter of length len. Parameters are components of a selection screen that are assigned a global elementary data object in the ABAP program and an input field on the selection screen.

The name of the para parameter may contain a maximum of eight characters. This statement is permitted in the global declaration part of executable programs, function groups and module pools. In function groups and module pools it is only permitted within the definition of a independent selection screen. In executable programs, it is otherwise automatically assigned to the standard selection screen.

The length len can only be specified if the data type specified in type_options is generic regarding the length (c, n, p, and x). The length len must be specified as a numeric literal or as a numeric constant within the corresponding interval ranges. If len is not specified, the length is set to 1 for a generic data type, or else it is set to the length of the data type. As of Release 6.10, it is possible to specify the length using the LENGTH addition.

In detail, the PARAMETERS statement has the following effect:

The statement declares a global variable para of the specified length in the program. The type of the data object is specified in type_options.

On the current selection screen, an input field with the same name and a suitable external data type is created in a new line at position 35. The length of the input field is aligned with the length of the parameter. The maximum length of the input field is 132. The maximum visible length of the input field is between 39 and 45, depending on the nesting depth in blocks with frames. If the len length is greater than the maximum visible length, the content is displayed as movable.

In front of the input field, in the first possible position, an automatically generated output field is displayed as a description, whose length is between 23 and 30 depending on the nesting depth in blocks with frames. The output field contains either the name of the para parameter or the selection text to which the parameter is assigned in the text elements of the program. If the user requests field or input help on the output field using the F1 or F4 function keys, the same output is displayed as when the input field itself is selected.

The attributes of the elements on the selection screen can be influenced in screen_options and with the SELECTION-SCREEN statement.

Before the selection screen is sent, the content of the para data object is transported to the input field on the selection screen and a convertion routine may be executed. If the length of the parameter is greater than 132, the content is truncated from the right. Settings regarding the content of the input field can be made in value_options. After a user action on the selection screen, the content of the input field is transported to the data object and the content of character-type fields is converted into uppercase by default. Afterwards, a conversion routine may be executed. Various selection screen events are triggered after the transport.

If parameters are defined in the selection include in the logical database, additional ldb_options additions are necessary or possible.

select-potions:

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.

Check this thread..

http://www.sap-img.com/abap/difference-between-select-options-ranges.htm

regards,

vasavi.

kindly reward if helpful.

Former Member
0 Kudos

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

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 .

Former Member
0 Kudos

Hi,

1. in s-o : we can provide range

in Para : it is not possible

2. Select-options accepts rage of values.

we can make select-options behave like

paramenters by using additon "no intervals",

but vice versa is not possible.

3. In select option through user put input data in range.

and select option create internal table with option, low,

high, sign.

parameter through can not provde input in range. It can't

occupy memory.

4. If we do not provide any value for SELECT-OPTIONS in

selection screen, it displays all the values.

whereas for PARAMETERS if we not provide any value

it takes as blank value and displays nothing

5. select-options store in internal table whereas parameters

will store in single field.

Reward if helpful.