SAP PARAMETERS VALUE ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• DEFAULT PARAMETERS
• LOWER CASE PARAMETERS
• MATCHCODE OBJECT PARAMETERS
• MEMORY ID PARAMETERS
• VALUE CHECK PARAMETERS

PARAMETERS, value_options
Short Reference

ABAP_SYNTAX
... $[DEFAULT val$]
$[LOWER CASE$]
$[MATCHCODE OBJECT search_help$]
$[MEMORY ID pid$]
$[VALUE CHECK$] ...

ABAP Addition
1 ... DEFAULT val
2 ... LOWER CASE
3 ... MATCHCODE OBJECT search_help
4 ... MEMORY ID pid
5 ... VALUE CHECK

What does it do?
Using these additions, it is possible define a start value that allows lowercase letters, a search help, or SPA/GPA parameter to be bound, or a check to be executed against a value list.

ABAP Addition

What does it do?
This addition defines a start value for the content of the selection parameter para. The start value val can either be specified as a literal or as a built-in 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. For the time stamp type utclong, only a character literal that contains a valid representation of a time stamp can be specified as a literal. Without the addition DEFAULT, the initial value linked with the data type is used as a start value.
There are two times when a start value can be passed to the selection parameter:
When an executable program is started using SUBMIT , all values val specified at program start using DEFAULT are passed between the events LOAD-OF-PROGRAM and INITIALIZATION to the associated selection parameters para.
If a program is not loaded into an ABAP_ISESS using a SUBMIT call, but using a dialog or an object transaction, or in an external procedure call instead, all the values val specified using DEFAULT are passed to the associated selection parameters para when any selection screen is called for the first time using CALL SELECTION-SCREEN before the event AT SELECTION-SCREEN OUTPUT .
In both cases, all the selection parameters are supplied with their start values, regardless of the selection screen on which they are defined. If a selection parameter is not initial at the time the data is passed, the start value is not passed.



Latest notes:

The associated input field on the selection screen is only filled with the start value if the value for para is no longer changed before the selection screen is sent. The system displays the exact value that the selection parameter has at the end of processing of the event AT SELECTION-SCREEN OUTPUT.
If start values are specified, these must have the internal format of the ABAP values, and not the output format of the screen display.
ABAP_HINT_END

ABAP Addition

What does it do?
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.
The addition LOWER CASE cannot be combined with the additions AS CHECKBOX or RADIOBUTTON.



Latest notes:

If a parameter is connected to a DDIC domain , the conversion to upper case letters can also be prevented by the respective semantic property of the domain .
ABAP_HINT_END

ABAP Addition

What does it do?
This addition links the input field of the selection parameter with a search help search_help from the ABAP Dictionary. The name of the search help must be specified directly. The input help key is displayed for the input field of the selection 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 the ABAP Dictionary, a message is displayed in the status line when the input help is requested.
The addition MATCHCODE OBJECT cannot be combined with the additions AS CHECKBOX or RADIOBUTTON.



Latest notes:

For search helps with more than one value, the first value of the search help is linked with the input field.
The predecessors of the search helps in the ABAP Dictionary were called matchcode objects, which 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.
ABAP_HINT_END



Example ABAP Coding

Linking the selection parameter p_carrid with a suitable search help. When the input help is selected 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.
ABEXA 00490
ABAP_EXAMPLE_END

ABAP Addition

What does it do?
This addition links the input field of the selection parameter with a SPA/GPA parameter in the user 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 SPA/GPA parameter in the user memory if 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 user memory. If no SPA/GPA parameter exists for the specified ID, it is created.
If the specified ID pid is not contained in the database table TPARA , the extended program check reports an error.



Latest notes:

The addition DEFAULT overrides the addition MEMORY ID.
ABAP_HINT_END



Example ABAP Coding

The selection parameter p_prog is linked with the SPA/GPA parameter RID , which in turn is linked with the input field for the program name in the dynpros of the ABAP Workbench. Accordingly, the input field of the selection parameter is filled with the name of the program last processed.
ABEXA 00491
ABAP_EXAMPLE_END

ABAP Addition

What does it do?
This addition can only be specified if the type of the selection parameter is defined using a reference to a data type from the ABAP Dictionary.
If a user action is performed on the selection screen, the current content of the input field is checked against any fixed values 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 displaying the selection screen, the screen is displayed if an error occurs.
The addition VALUE CHECK cannot be combined with the additions AS CHECKBOX, RADIOBUTTON, AS LISTBOX, or NO-DISPLAY.



Latest notes:

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.
Table buffering is effective for the database accesses performed for the check.
ABAP_HINT_END

Return to menu