‎2007 Oct 15 4:36 PM
WHAT IS THE DIFFERENCE BETWEEN PARAMETERS,SELECT-OPTIONS AND RANGES?
‎2007 Oct 15 4:41 PM
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
‎2007 Oct 15 4:41 PM
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