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: 

Difference between Parameters and Select-Options

Former Member
0 Kudos

Hi ,

I am new to ABAP and I searched some articles in SDN,I didn't find the answer.

The question was , in parameters if we didn't give any value then it didn't retrieve data from data base.select query fails,but in select-options case

if we didn't give any value it fetches the entire table.What is the reason for this.

Regards

Shek

4 REPLIES 4

former_member192429
Active Participant
0 Kudos

When parameter is used in select it would expect to bring the results for that value. When parameter is blank it will fetch data with field EQ BLANK value. In case of select option it looks for a range of values as it is not trying to match a single value, it picks up all values. I guess as the condition does not exist then the where condition is not at all set in the query.

alex_campbell
Contributor
0 Kudos

A parameter entry and a select-options entry represent two different things. A parameter entry represents a value (for example, the quantity 1, or the material 'ABC'). A select-options entry represents a domain, which is a range of values (for example, all quantities between 0 and 10, or all materials that start with the characters 'AB').

When you use a parameter in a DB query, and that value is blank, you're asking the database "which records have the value blank". If records exist where that field has the value blank (for example, try SELECT * FROM MARA WHERE LVORM = P_LVORM, create a parameter for P_LVORM, and leave it blank. You'll get some records back).

In the case of a select-options, SAP has decided that having a blank select-options is like not having a select-options at all (as Kriss said, the where condition is not set at all in the query). A blank select-options represents the range of all values.

raymond_giuseppi
Active Contributor
0 Kudos

(FAQ) You question does not actually relate on PARAMETERS/SELECT-OPTIONS but in relational operators EQ and IN of the WHERE clause of a SELECT statement. The big difference if that a IN clause is true if the range defined by the select-options has no values/no values, where the EQ will only select records with initial value. Read WHERE log_exp online help first.

Also try first to find yourself before posting, read Rules of Engagement. The information can be found via F1 key.

Regards,

Raymond

Former Member
0 Kudos

Hi..

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 .