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 of parameter and select-options

Former Member
0 Likes
645

Hi,

i want to know why all of them are using the keyword parameter, even thay have select-option keyword.

I know select-option plays as a internal table but parameter not like that. than whats use of parameter, why all the people using parameter and select-option both in the program.

plz give me a idea.

Mohana.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
612

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.

***********************************

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. You can use the PARAMETERS statement for both standard and user-defined selection screens The basic form of the PARAMETERS statement is as follows: PARAMETERS

[(<length>)] [TYPE <type>|LIKE <obj>] [DECIMALS <d>] PARAMETERS: WORD(10) TYPE C, DATE TYPE D. To assign a default value to a parameter, you use the following syntax: PARAMETERS

...... DEFAULT <f> ...... To define the input field of a parameter as a checkbox, you use the following syntax: PARAMETERS

...... AS CHECKBOX ...... To define the input field of a parameter as a radio button, you use the following syntax: PARAMETERS

...... RADIOBUTTON GROUP <radi>...... To modify the appearance of an input field on the selection screen, you must assign the parameter to a modification group as follows: PARAMETERS

...... MODIF ID <key> ...... To define the input field of a parameter as a required field, you use the following syntax: PARAMETERS

...... OBLIGATORY ...... A search help is a ABAP Dictionary object used to define possible values (F4) help ( see Input Help in the ABAP Dictionary). You can link a search help to a parameter as follows: PARAMETERS

... MATCHCODE OBJECT <search_help>. select-options. 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-OPTIONS statement You use the statement SELECT-OPTIONS <seltab> for <f>. The row type of a selection table is a structure that consists of the following four components: SIGN, OPTION, LOW and HIGH. Each row of a selection table that contains values represents a sub-condition for the complete selection criterion. 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. 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. If HIGH is filled, you can use BT (BeTween) and NB (Not Between). LOW The data type of LOW is the same as the column type of the database table, to which the selection criterion is linked. 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. To assign default values to a selection criterion, you use the following syntax: SELECT-OPTIONS <seltab> FOR <f> DEFAULT <g> [TO <h>] .... To allow the user to process only the first row of the selection table on the selection screen, you use the following syntax SELECT-OPTIONS <seltab> FOR <f> ..... NO-EXTENSION ..... To allow the user to process only single fields on the selection screen, you use the following syntax: SELECT-OPTIONS <seltab> FOR <f> ..... NO INTERVALS ..... SPA/GPA parameters as default values SELECT-OPTIONS <seltab> FOR <f> ... MEMORY ID <pid>.......... Upper and lower case for selection criteria: SELECT-OPTIONS <seltab> FOR <f> ... LOWER CASE .............. To make the From field a required field on the selection screen, use: SELECT-OPTIONS <selcrit> FOR <f> ... OBLIGATORY .............. To hide input fields on the selection screen, use: SELECT-OPTIONS <selcrit> FOR <f> ... NO DISPLAY .............. To modify input fields on the selection screen, use: SELECT-OPTIONS <selcrit> FOR <f> ... MODIF ID <key>

If you select from a data base where some field equals a parameter and the parameter is empty, the results will be rows where the field is empty.

If you select from a data base where some field is in the SELECT-OPTION and the SELECT-OPTION is empty, then all rows will be returned.

Regards

Vasu

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.

***********************************

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. You can use the PARAMETERS statement for both standard and user-defined selection screens The basic form of the PARAMETERS statement is as follows: PARAMETERS

[(<length>)] [TYPE <type>|LIKE <obj>] [DECIMALS <d>] PARAMETERS: WORD(10) TYPE C, DATE TYPE D. To assign a default value to a parameter, you use the following syntax: PARAMETERS

...... DEFAULT <f> ...... To define the input field of a parameter as a checkbox, you use the following syntax: PARAMETERS

...... AS CHECKBOX ...... To define the input field of a parameter as a radio button, you use the following syntax: PARAMETERS

...... RADIOBUTTON GROUP <radi>...... To modify the appearance of an input field on the selection screen, you must assign the parameter to a modification group as follows: PARAMETERS

...... MODIF ID <key> ...... To define the input field of a parameter as a required field, you use the following syntax: PARAMETERS

...... OBLIGATORY ...... A search help is a ABAP Dictionary object used to define possible values (F4) help ( see Input Help in the ABAP Dictionary). You can link a search help to a parameter as follows: PARAMETERS

... MATCHCODE OBJECT <search_help>. select-options. 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-OPTIONS statement You use the statement SELECT-OPTIONS <seltab> for <f>. The row type of a selection table is a structure that consists of the following four components: SIGN, OPTION, LOW and HIGH. Each row of a selection table that contains values represents a sub-condition for the complete selection criterion. 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. 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. If HIGH is filled, you can use BT (BeTween) and NB (Not Between). LOW The data type of LOW is the same as the column type of the database table, to which the selection criterion is linked. 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. To assign default values to a selection criterion, you use the following syntax: SELECT-OPTIONS <seltab> FOR <f> DEFAULT <g> [TO <h>] .... To allow the user to process only the first row of the selection table on the selection screen, you use the following syntax SELECT-OPTIONS <seltab> FOR <f> ..... NO-EXTENSION ..... To allow the user to process only single fields on the selection screen, you use the following syntax: SELECT-OPTIONS <seltab> FOR <f> ..... NO INTERVALS ..... SPA/GPA parameters as default values SELECT-OPTIONS <seltab> FOR <f> ... MEMORY ID <pid>.......... Upper and lower case for selection criteria: SELECT-OPTIONS <seltab> FOR <f> ... LOWER CASE .............. To make the From field a required field on the selection screen, use: SELECT-OPTIONS <selcrit> FOR <f> ... OBLIGATORY .............. To hide input fields on the selection screen, use: SELECT-OPTIONS <selcrit> FOR <f> ... NO DISPLAY .............. To modify input fields on the selection screen, use: SELECT-OPTIONS <selcrit> FOR <f> ... MODIF ID <key>

If you select from a data base where some field equals a parameter and the parameter is empty, the results will be rows where the field is empty.

If you select from a data base where some field is in the SELECT-OPTION and the SELECT-OPTION is empty, then all rows will be returned.

Regards

Vasu

3 REPLIES 3
Read only

Former Member
0 Likes
612

parameters for providing single value

select-options for range of values

Read only

0 Likes
612

I know this also, any other different, any code changing?

Read only

Former Member
0 Likes
613

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.

***********************************

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. You can use the PARAMETERS statement for both standard and user-defined selection screens The basic form of the PARAMETERS statement is as follows: PARAMETERS

[(<length>)] [TYPE <type>|LIKE <obj>] [DECIMALS <d>] PARAMETERS: WORD(10) TYPE C, DATE TYPE D. To assign a default value to a parameter, you use the following syntax: PARAMETERS

...... DEFAULT <f> ...... To define the input field of a parameter as a checkbox, you use the following syntax: PARAMETERS

...... AS CHECKBOX ...... To define the input field of a parameter as a radio button, you use the following syntax: PARAMETERS

...... RADIOBUTTON GROUP <radi>...... To modify the appearance of an input field on the selection screen, you must assign the parameter to a modification group as follows: PARAMETERS

...... MODIF ID <key> ...... To define the input field of a parameter as a required field, you use the following syntax: PARAMETERS

...... OBLIGATORY ...... A search help is a ABAP Dictionary object used to define possible values (F4) help ( see Input Help in the ABAP Dictionary). You can link a search help to a parameter as follows: PARAMETERS

... MATCHCODE OBJECT <search_help>. select-options. 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-OPTIONS statement You use the statement SELECT-OPTIONS <seltab> for <f>. The row type of a selection table is a structure that consists of the following four components: SIGN, OPTION, LOW and HIGH. Each row of a selection table that contains values represents a sub-condition for the complete selection criterion. 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. 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. If HIGH is filled, you can use BT (BeTween) and NB (Not Between). LOW The data type of LOW is the same as the column type of the database table, to which the selection criterion is linked. 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. To assign default values to a selection criterion, you use the following syntax: SELECT-OPTIONS <seltab> FOR <f> DEFAULT <g> [TO <h>] .... To allow the user to process only the first row of the selection table on the selection screen, you use the following syntax SELECT-OPTIONS <seltab> FOR <f> ..... NO-EXTENSION ..... To allow the user to process only single fields on the selection screen, you use the following syntax: SELECT-OPTIONS <seltab> FOR <f> ..... NO INTERVALS ..... SPA/GPA parameters as default values SELECT-OPTIONS <seltab> FOR <f> ... MEMORY ID <pid>.......... Upper and lower case for selection criteria: SELECT-OPTIONS <seltab> FOR <f> ... LOWER CASE .............. To make the From field a required field on the selection screen, use: SELECT-OPTIONS <selcrit> FOR <f> ... OBLIGATORY .............. To hide input fields on the selection screen, use: SELECT-OPTIONS <selcrit> FOR <f> ... NO DISPLAY .............. To modify input fields on the selection screen, use: SELECT-OPTIONS <selcrit> FOR <f> ... MODIF ID <key>

If you select from a data base where some field equals a parameter and the parameter is empty, the results will be rows where the field is empty.

If you select from a data base where some field is in the SELECT-OPTION and the SELECT-OPTION is empty, then all rows will be returned.

Regards

Vasu