PARAMETERS

Get Example source ABAP code based on a different SAP table
  


Standard SAP Help for PARAMETERS

PARAMETERS


Short Reference

• PARAMETERS ABAP Statement
• LENGTH PARAMETERS


ABAP SyntaxPARAMETERS {para[(len)]}|{para [LENGTH len]}

[type_options]
[screen_options]
[value_options]
[ldb_options].


What does it do?Declaration of a parameter para of length len . Parameters are components of a selection screen that are assigned a global elementary data object in the ABAP program and an input field on the selection screen.

The name of the parameter para can contain a maximum of eight characters. This statement is allowed in the global declaration part of executable programs, function groups, and module pools. In function groups and module pools, the statement is only allowed within the definition of an independent selection screen. In executable programs, the statement is otherwise automatically assigned to the standard selection screen.

The length len can only be specified if the data type specified in type_options has a generic length (c, n, p, and x). The length len must be specified directly as a number or as a numeric constant within the associated interval ranges. If len is not specified, the length is set to 1 for a generic data type; otherwise it is set to the length of the data type.

The PARAMETERS statement has the following effect:
The statement declares a global variable (para) of the specified length in the program. The type of the data object is specified in type_options.
An input field with the same name and a suitable external data type is created in a new row at position 35 on the current selection screen. The length of the input field is determined by the length of the parameter. The maximum length of the input field is 255. The maximum visible length of the input field is between 39 and 45, depending on the nesting depth in blocks with frames. If the length len is greater than the maximum visible length, the content is displayed as movable.

An output field generated automatically is displayed in the first position available to the left of the input field as a description with a length of between 23 and 30, depending on the nesting depth in blocks with frames. The output field contains either the name of the parameter para or the selection text to which the parameter is assigned in the text elements of the program. If the user requests a field help or input help in the output field by pressing F1 or F4, the same data is displayed as when the input field itself is selected.

The attributes of the elements on the selection screen can be modified in screen_options and with the SELECTION-SCREEN statement.
Before the selection screen is sent, the content of the para data object is transported to the input field on the selection screen and a conversion routine may be executed. If the length of the parameter is greater than 255, the content is truncated from the right. You can configure settings for the content of the input field in value_options. After a user action on the selection screen, the content of the input field is transported to the data object and the content of character-like fields is converted to uppercase by default. A conversion routine may then be executed. Various selection screen events are triggered after the transport.
If parameters are defined in the selection include of a logical database, further ldb_options additions are necessary or possible.


Latest notes:If a parameter is given data using SUBMIT when an executable program is called, a conversion routine may also be called and the content truncated on the right at position 255. The conversion routine is skipped and the content not truncated only if the parameter is declared with the addition NO-DISPLAY.
To ensure legibility, we recommend that you do not omit the length specification for the generic types and always use the LENGTH addition instead of parentheses.
The name of a parameter must not be one of the keywords of the screen flow logic (MODULE, SELECT, or VALUES).
If the parameter is a decimal floating point number which does not relate to a data type in the ABAP Dictionary, the output style scaling retained is set for the entry field on the selection screen, which means that closing zeros are retained after the decimal point. If there is a reference to a data type in the ABAP Dictionary, the output style defined there is used.
If the type of the selection criteria is a packed number or a decimal floating point number defined in the ABAP Dictionary, the property sign must be set for the type property, so that negative numbers can be displayed on the selection screen. This setting is only possible for domains and not for the direct specification of a predefined type for data elements or structure components. If a negative number is entered on the selection screen and this property is not set, the system rejects it with an error message. If the parameter contains a negative number when the selection screen is called, an unhandleable exception occurs.
If the parameter type is a decimal floating point number defined in the ABAP Dictionary for which the output style 'currency amount' is specified, only numbers with the corresponding amount of decimal places can be entered on the selection screen. If, when the selection screen is called, the corresponding ABAP data object is a number with more decimal places, an unhandleable exception occurs. If the output style is 'extended currency amount', additional decimal places can be displayed.


Return to menu