PARAMETERS - value_options
... [DEFAULT val]
[MATCHCODE OBJECT search_help]
[MEMORY ID pid]
[VALUE CHECK] ... .
... DEFAULT val
This addition defines a start value for the content of the parameter
para. The start value
val can either be specified as a literal or as a predefined data object.
If the data type of the specified start value does not match the data type of the declaration, it is converted in accordance with the conversion rules. Without the addition
initial value associated with the data type is used as a start value.
There are two times when a start value can be passed to the parameter:
When an executable program is started using
SUBMIT, all the values
valspecified at program start using
DEFAULTare passed between the events
INITIALIZATIONto the associated parameters
If a program is not loaded into an internal session using a
SUBMITcall, but using a dialog or a OOtransaction, or in an external procedure call instead, then all the values
DEFAULTare passed to the associated parameters
parawhen any selection screen is called for the first time using
CALL SELECTION-SCREENbefore the event
AT SELECTION-SCREEN OUTPUT.
In both cases, all the parameters are supplied with their start values, irrespective of the selection screen on which they are defined. If a parameter is not initial at the time the data is passed, the start value will not be passed.
The associated input field on the selection screen is only filled with the start value if the value
parais no longer changed before the selection screen is sent. The system displays the exact value that the parameter has at the end of processing of the event
AT SELECTION-SCREEN OUTPUT.
When start values are specified, these must have the internal format of the ABAP values, and not the output format of the screen display.
... LOWER CASE
This addition prevents the content of character-like fields from being converted to uppercase letters when the input field on the
selection screen is transported to the data object
para in the program and vice versa.
... MATCHCODE OBJECT search_help
This addition associates the input field of the parameter with a search help
from ABAP Dictionary. The name of the search help must be specified directly. The input help key is displayed for the input field of the parameter on the
selection screen. When the input help
(F4) is requested, the hit list from the search help is displayed to the
user. When an entry is selected, the corresponding value is placed in the input field. If no search
help for the specified name exists in ABAP Dictionary, a message is displayed in the status line when the input help is requested.
The predecessors of the search helps in ABAP Dictionary were called matchcode objects. This is why this
addition has the name
MATCHCODE OBJECT. Matchcode objects that have not yet been replaced by search helps are still supported by this addition.
Associating the parameter
p_carrid with a suitable search help. When you
select the input help on the selection screen, a list with the names of the airline carriers is displayed. If a name is selected, the corresponding abbreviation is placed in the input field.
PARAMETERS p_carrid TYPE s_carr_id MATCHCODE OBJECT demo_f4_de.
... MEMORY ID pid
This addition associates the input field of the parameter with a SPA/GPA parameter in the SAP Memory. The ID pid of the SPA/GPA parameter must be specified directly and it can contain a maximum of 20 characters.
When the selection screen is called, the input field is filled with the current value of the SAP/GPA
parameter in the SAP memory, provided the data object
para is initial after
processing of the event AT SELECTION-SCREEN
OUTPUT. Otherwise, the value of
para is displayed. If there is
a user action on the selection screen, the content of the input field is assigned to the SPA/GPA parameter in the SAP memory. If no SPA/GPA parameter exists for the specified ID, it is created.
If the specified ID
pid is not in the database table TPARA, the extended program check reports an error.
DEFAULT overrides the addition
p_prog is associated with the SPA/GPA parameter RID, which in turn is associated with the input field for the program name in the
ABAP Workbench. Accordingly, the input field of the parameter is filled with the name of the program last processed.
PARAMETERS p_prog TYPE sy-repid MEMORY ID rid.
... VALUE CHECK
This addition can only be specified if the type of the parameter is defined using a reference to a data type from ABAP Dictionary.
If you have a user action on the selection screen, the current content of the input field is checked against the
fixed values possibly defined in the domain of the data type. If the data type is a component of a
foreign key table, a check against the check table is executed. If the check is not successful, an
error message is displayed
in the status line of the selection screen. If the program was called using
SUBMIT without the selection screen being displayed, the screen is displayed if an error occurs.
The check against a check table is executed even if the input field is empty. Therefore, it is advisable
to use the addition
OBLIGATORY at the same time.