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

PARAMETERS,SELECT-OPTIONS &RANGES

Former Member
0 Likes
300

WHAT IS THE DIFFERENCE BETWEEN PARAMETERS,SELECT-OPTIONS AND RANGES?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
271

Parameters -

Defines Program Parameters

Objects that you define with this statement can have two functions:

1. In executable (type 1) programs:

You can run executable programs using the r SUBMIT statement. The PARAMETERS and SELECT-OPTIONS statements form their interface. This is usually the interface between the program and the user, that is, the parameters and select-options are filled out by the user on the selection screen (see also the NO-DISPLAY addition and the SUBMIT statement without the VIA SELECTION-SCREEN addition).

2. In any program (apart from a subroutine pool, that is, a program with type S):

Objects in a program, defined on a selection screen that is filled out by the user at runtime.

SELECT-OPTIONS

Variants:

1. SELECT-OPTIONS sel FOR f.

2. SELECT-OPTIONS sel FOR (f).

Declaring a variable selection option

Effect

Declares a variable selection option.

Objects defined using this statement can have two purposes:

1. In reports (programs with type 1):

2. You can execute reports with the SUBMIT statement. The statements SELECT-OPTIONS and PARAMETERS determine the technical interface and the user interface. The parameters and selection options you specify are displayed on the selection screen for the user to enter values (see also the addition NO-DISPLAY or SUBMIT without the addition VIA SELECTION-SCREEN.

3. In all programs (except subroutine pools, that is, programs with type S):

4. Program-internal objects, that are filled at runtime by user input on selection screens. The SELECT-OPTIONS filled in this way can then be used in the WHERE clause of a SELECT statement for selecting data.

RANGES

Basic form

RANGES sel FOR f.

Addition:

... OCCURS n

Prohibit RANGES.

Effect

Defines an internal table similar to a selection

criterion sel defined using the SELECT-OPTIONS sel FOR f statement.

The above statement is identical to:

DATA: BEGIN OF sel OCCURS 10,

SIGN(1),

OPTION(2),

LOW LIKE f,

HIGH LIKE f,

END OF sel.

Note

If you use the IN operator in conjunction with SUBMIT, CHECK, IF, WHILE or SELECT, always define the associated internal table using SELECT-OPTIONS or RANGES (never directly).

Addition

... OCCURS n

Effect

Changes the OCCURS value 10 to the value of occ.

Please see this link for more details -

http://www.geocities.com/rmtiwari/Resources/Utilities/ABAPReference/ABAPReference.html

ashish

1 REPLY 1
Read only

Former Member
0 Likes
272

Parameters -

Defines Program Parameters

Objects that you define with this statement can have two functions:

1. In executable (type 1) programs:

You can run executable programs using the r SUBMIT statement. The PARAMETERS and SELECT-OPTIONS statements form their interface. This is usually the interface between the program and the user, that is, the parameters and select-options are filled out by the user on the selection screen (see also the NO-DISPLAY addition and the SUBMIT statement without the VIA SELECTION-SCREEN addition).

2. In any program (apart from a subroutine pool, that is, a program with type S):

Objects in a program, defined on a selection screen that is filled out by the user at runtime.

SELECT-OPTIONS

Variants:

1. SELECT-OPTIONS sel FOR f.

2. SELECT-OPTIONS sel FOR (f).

Declaring a variable selection option

Effect

Declares a variable selection option.

Objects defined using this statement can have two purposes:

1. In reports (programs with type 1):

2. You can execute reports with the SUBMIT statement. The statements SELECT-OPTIONS and PARAMETERS determine the technical interface and the user interface. The parameters and selection options you specify are displayed on the selection screen for the user to enter values (see also the addition NO-DISPLAY or SUBMIT without the addition VIA SELECTION-SCREEN.

3. In all programs (except subroutine pools, that is, programs with type S):

4. Program-internal objects, that are filled at runtime by user input on selection screens. The SELECT-OPTIONS filled in this way can then be used in the WHERE clause of a SELECT statement for selecting data.

RANGES

Basic form

RANGES sel FOR f.

Addition:

... OCCURS n

Prohibit RANGES.

Effect

Defines an internal table similar to a selection

criterion sel defined using the SELECT-OPTIONS sel FOR f statement.

The above statement is identical to:

DATA: BEGIN OF sel OCCURS 10,

SIGN(1),

OPTION(2),

LOW LIKE f,

HIGH LIKE f,

END OF sel.

Note

If you use the IN operator in conjunction with SUBMIT, CHECK, IF, WHILE or SELECT, always define the associated internal table using SELECT-OPTIONS or RANGES (never directly).

Addition

... OCCURS n

Effect

Changes the OCCURS value 10 to the value of occ.

Please see this link for more details -

http://www.geocities.com/rmtiwari/Resources/Utilities/ABAPReference/ABAPReference.html

ashish