Defining the Layout of Select Options
Use
You can define the layout of the Select Options with method INIT_SELECT_OPTIONS. You can find this method in the interface controller of the component. The method returns a reference to interface IF_WD_SELECT_OPTIONS_20.
Method INIT_SELECT_OPTIONS has various parameters you can use to change the layout of the Select Options to suit your requirements. The table below contains a list of these parameters:
-
ACTUAL_SEARCH (type: STRING): Uses the search currently displayed
-
GENERAL_TEXTS (type: structure WDR_SO_S_GENERAL_TEXTS): Sets texts
-
GENERAL_VISIBILITY (type: structure WDR_SO_S_GENERAL_VISIBILITY):
This parameter specifies the visibility of buttons and titles.
-
With component BUTTON_SEARCH_IS_DEFAULT you can define the Search or Search button as the default button for the search criteria area. The search is then performed as soon the user presses ENTER (provided the cursor is in the search criteria area).
- With component LOCATION_SAVED_SEARCHES you can specify whether the DropDownListBox for saved searches is displayed in the Search Criteria panel or above it.
- With component IMG_BUTTON you can define icons for the Search, Delete Entries, and Reset to Default buttons.
For more information, see Handling Images and Web Icons.
-
-
SAVED_SEARCHES (type: structure WDR_CONTEXT_ATTR_VALUE_LIST): Content of the dropdown menu
-
GLOBAL_OPTIONS (type: structure WDR_SO_S_GLOBAL_OPTIONS): Enables you to make standard settings for the Select Options (see table).
|
NR_DEFAULT_ROWS |
Number of rows to display initially. Rows with read-only or mandatory attributes and attributes with free text text search are always output even if the value in parameter NR_DEFAULT_ROWS is smaller. If no value for this parameter is specified, one row is displayed for each attribute. |
|
DEFAULT_MAX_NR_ROWS |
Maximum number of results |
|
NO_OPERATORS |
List of attributes is displayed without operators, IS/EQUALS default value |
|
NO_PLUS_MINUS |
List of attributes is displayed without a plus or minus sign |
|
NO_ATTRIBUTE_SELECTION |
The rendered attribute cannot be changed. The dropdown menu of the attribute cannot be selected. |
|
FIXED_WIDTH_FOR_USE_IN_POPUP |
Width of the display window if it is displayed in a popup. |
|
NO_RANGE_CONVERSION |
If this parameter equals ABAP_TRUE, the range conversion is ignored. All attributes are typed and passed in the internal format. |
|
NO_ENTER_ON_SETTING_F4_VALUE |
If this parameter is ABAP_TRUE, event ON_ENTER is not triggered in the following cases:
|
|
NO_MULTI_PASTE |
With this flag the option to paste multiple values from a table or text editor using CTRL-C / CTRL-V is suppressed. |
|
NO_COLLAPSE_EXPAND |
With this flag the automatic grouping of multiple sequential rows and creating a header is suppressed. |
|
NO_ONLINE_HELP |
Suppresses the standard online help |
|
WIDTHS |
Enables column widths to be changed (specifications in em). If fixed elements are rendered (e.g. save search), sufficient width sizes must be defined, |
|
RENDER_SMALL |
Along with the WIDTHS settings this enables a narrow rendering by splitting fixed rows like Search, Save Search, and Criteria to Exclude into two rows. |
|
ALLOW_PERSONALIZATION |
Provides users with a dialog box for personalization options. The dialog box can only be provided if the saved searches are active and the Search Criteria panel can be expanded. |
|
ALLOW_EASY_MODE |
Allows the user to use a Simple Search instead of searching with all search criteria. With a simple search the user only sees the input field for free text search. If simple search is active, it is offered to users as the default search. Users can change this in the personalization settings. With simple search, no predefined searches can be automatically performed.
You can use the parameter only under the following conditions:
If free text search allows multiple operators, the default operator is always used in the simple search. |
Label
You have the option to display a label in front of an attribute. For fields with free text input, the text that is specified in the attribute property TEXT is used as the label.
Events in the Public Interface of Component WD_SELECT_OPTIONS_20
|
Name of Event |
When Event Is Triggered |
|---|---|
|
ON_ATTRIBUTE_CHANGE |
When a different attribute in a line is selected. |
|
ON_CLEAR |
When one of the buttons Clear or Delete Input is chosen after the data has been removed from the Select Options component. |
|
ON_DELETE_SEARCH |
The Delete Search button is pressed. The Select Options component does not delete any data. |
|
ON_EDIT_MULTI_VALUE |
When the edit button of a multi-value field is chosen. |
|
ON_ENTER |
If NO_ENTER_ON_SETTING_F4_VALUE = ABAP_TRUE, the ENTER event is triggered only when the ENTER key is pressed. |
|
ON_EXECUTE |
When the Search button is chosen. The Select Options component does not perform any further action. |
|
ON_LOAD_SEARCH |
When the Load Search button is chosen. The Select Options component does not perform any further action. |
|
ON_OVS |
When the F4 key is pressed. |
|
ON_RESET |
When the Reset or Reset button is chosen. The Select Options component does not perform any further action. |
|
ON_SAVE_SEARCH |
When the Save Search button is chosen. The search is not saved within the Select Options component. |
|
ON_PLUS |
When the plus button at the end of a line is chosen. |
|
ON_MINUS |
When the minus button at the end of a line is chosen. |
|
ON_SAVE_PERS |
Saving in dialog box for personalization options |
Procedure
To define the layout, call method INIT_SELECT_OPTIONS, for example, in method WDDOINIT (either of the view or of the component controller).
You can find an example of the source code for the method call in Embedding Select Options.