Entering content frameBasic Form of Parameters Locate the document in its SAP Library structure

You use the PARAMETERS statement to declare variables, similarly to the DATA statement Variables declared with the PARAMETERS statement are called parameters. For each parameter declared, an input field appears on the corresponding selection screen. On the left hand side of the input field, the name of the parameter is displayed as text. You can modify this text as Structure link selection text. Values entered into the input field by the user are assigned to the corresponding variable while the system processes the selection screen. The position of the statement in the declaration part of the program determines the selection screen to which the input field belongs.

The basic form of the PARAMETERS statement is as follows:

PARAMETERS <p>[(<length>)] [TYPE <type>|LIKE <obj>] [DECIMALS <d>].

This statement creates parameter <p>. Currently, parameter names are limited to eight digits. The additions <length>, TYPE|LIKE and DECIMALS are the same as for the DATA statement. Note that the data types valid for parameters include all elementary ABAP types except data type F. You cannot use data type F, references and aggregate types.

If the parameter refers to data types from the Dictionary, it adopts all attributes of the Dictionary field. Currently, parameters can only refer to fields of database tables, views and structures. In particular, the field help (F1) and the possible entries help (F4) defined for these fields in the Dictionary are available to the user. To check a user entry against a value list in the Dictionary, you must use the special addition VALUE CHECK.

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.

Example

REPORT DEMO.

PARAMETERS: WORD(10) TYPE C,
DATE TYPE D,
NUMBER TYPE P DECIMALS 2,
CONNECT TYPE SPFLI-CONNID.

In this example, four parameters are created for the standard selection screen: a character field, WORD, of length 10; a date field, DATE, of length 8; a packed number field, NUMBER, with two decimals; and a field, CONNECT, that refers to the SPFLI-CONNID type in the ABAP Dictionary. When the user starts the program, the input fields appear as follows on the standard selection screen:

This graphic is explained in the accompanying text

 

 

 

 

Leaving content frame