SAP PARAMETERS TYPE ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• TYPE PARAMETERS
• DECIMALS PARAMETERS
• LIKE PARAMETERS

PARAMETERS, type_options
Short Reference

ABAP_SYNTAX
... ${ TYPE type $[DECIMALS dec$] $}
$| ${ LIKE dobj $}
$| ${ LIKE (name) $} ...

ABAP_ALTERNATIVES:
1 ... TYPE type $[DECIMALS dec$]
2 ... LIKE dobj
3 ... LIKE (name)

What does it do?
These additions define the data type of the selection parameter. If none of the additions is specified, the selection parameter has the type c. The data type can be defined using a static reference to an existing data type type, using a static reference to a data object dobj, or using a dynamic reference to a data type from the ABAP Dictionary in name.
If the addition NO-DISPLAY is not specified, the data type of a selection parameter must be elementary and flat, except for string, and the numeric type f is not allowed. If the addition NO-DISPLAY is specified, any data types, except reference types and enumerated types, are possible.



Latest notes:

If there is a reference to data types from the ABAP Dictionary, the selection parameter adopts all screen-relevant properties defined here. Conversion routines defined in the domain may be executed during the data transport from and to the input field. The text defined in the ABAP Dictionary can be inherited as a selection text. It should be noted, however, that the input field on the selection screen is linked with a global data object of the program and does not have a real reference to the ABAP Dictionary, as is the case for dynpro fields created in the Screen Painter with reference to the dictionary. This has a particular effect on automatic support for input help (F4) and value checking. In comparison to general dynpros, input help functionality is limited here in such a way that dependencies between fields and previously entered data are not respected. A value check is not performed automatically but can be executed using the addition VALUE CHECK .
ABAP_HINT_END

ABAP Alternative 1 ... TYPE type $[DECIMALS dec$]

What does it do?
This addition gives the selection parameter the data type type. type can be specified as:
The built-in ABAP types, except for b, s, f , and xstring.
A non-generic data type from the ABAP Dictionary, a CDS simple type, a non-generic public data type of a global class, or a data type from the same program, already defined using TYPES, and which is elementary and not of the type f or xstring (unless NO-DISPLAY is used) and which is not an enumerated type.
If the built-in ABAP type p is specified, DECIMALS can be used to define the number of digits after the decimal point dec. If DECIMALS is not specified, the number of decimal places is 0. If DECIMALS is specified, the same applies as to the statement TYPES.
If type is a type from the ABAP Dictionary that has the type CHAR , length 1, and the fixed values X and blank in the domain, the input field on the selection screen is displayed automatically as if the addition AS CHECKBOX were specified.



Latest notes:

Enumerated types cannot be specified, regardless of the base type.
ABAP_HINT_END



Example ABAP Coding

Declaration of a selection parameter with reference to the component carrid of the database table spfli. On the selection screen, a three-character input field with a callable field help and input help is created.
ABEXA 00488
ABAP_EXAMPLE_END

ABAP Alternative 2 ... LIKE dobj

What does it do?
Using this addition, the selection parameter applies all the properties of a data object dobj already declared, in particular a possible reference to the ABAP Dictionary. The same applies to dobj as to TYPES ... LIKE, except that the specified data object can be elementary and flat , except for string, it cannot have the type f (unless NO-DISPLAY is used) and cannot be an enumerated type.



Latest notes:

LIKE can be used to reference the public attributes of global classes.
For reasons of compatibility, LIKE can also be used for an obsolete type reference.
ABAP_HINT_END

ABAP Alternative 3 ... LIKE (name)

What does it do?
This addition creates the data object para with the data type c and the length 132. The input field is displayed on the selection screen, but with a length, field help, and input help appropriate for the data type specified in name.
name expects a flat character-like data object containing the name of a component in a flat structure from the ABAP Dictionary in uppercase letters when the selection screen is called. The following can be specified for name:
Constant If the data object name is specified as a constant, it can be evaluated statically, and the specified component is identified as the used object.
Variable
BEGIN_SECTION ID PARAMETERS-LIKE-DYNAMIC If the data object name is specified as a variable, it is specified only dynamically, and the content is not evaluated statically.
END_SECTION ID PARAMETERS-LIKE-DYNAMIC
A text field literal can be specified for name, but its content is not evaluated. If the text pool currently loaded does not contain a selection text for the selection parameter, the output field displays the corresponding field label from the ABAP Dictionary. When the data is transported from the input field to the data object para, the content is converted in such a way as if it were assigned by the respective ABAP data type (no formatting characters, decimal separation character is period symbol, data format is yyyymmdd, and so on).
If the content of name is not a component structure from the ABAP Dictionary or a literal is specified for name, the input field is displayed according to the actual type of the selection parameter. If no selection text is created for the selection parameter in the currently loaded text pool, the output field contains the text Dynamic Parameter.



Latest notes:

The field name of the program in which the selection screen is defined is used. If the selection screen is defined in a logical database, the field name of the database program is used, even if the selection screen from the assigned executable program is displayed.
ABAP_HINT_END



Example ABAP Coding

Dynamic formatting of the input field of the selection parameter p_dyn. On the selection screen, a three-character input field with the input help for the column carrid in the database table spfli is displayed. If the selection parameter does not have a selection text, the text Airline Carrier is displayed in the output field.
ABEXA 00489
ABAP_EXAMPLE_END

Return to menu