Show TOC

Procedure documentationDefining the Layout of the Select Options Locate this document in the navigation structure

 

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 adapt 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): Specifies the visibility of the buttons and the titles

  • 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).

Structure of GLOBAL_OPTIONS Parameter

NR_DEFAULT_ROWS

Number of rows to display initially

Zeilen mit schreibgeschützten oder erforderlichen Attributen und Attribute mit freier Textsuche werden immer ausgegeben, auch wenn der Wert im Parameter NR_DEFAULT_ROWS kleiner ist. 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:

  • If checkboxes with two or three statuses are selected

  • If a value is selected in the dropdown menu

  • If a value is selected in the value help

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.

For more information about the multi-paste function, see Inserting Multiple Values Simultaneously into Select Options.

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), the width specifications must be large enough.

RENDER_SMALL

Along with the WIDTHS settings this enables a small rendering by splitting fixed lines like Search, Save Search, and Criteria to Exclude into two lines.

Note Note

The multi-paste and collapse/expand functions are not generally released in releases SAP_BASIS 7.31 to SP4; they can be used only by activated packages. In higher releases they are activated automatically.

End of the note.
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

When the Delete Search button is chosen.

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

  • When the ENTER key is pressed

  • When an entry is selected in the dropdown menu

  • When a checkbox is selected

  • When a tristate field is selected

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 button is chosen.

The Select Options component does not perform any further action.

Note Note

To find out what should be displayed with the ON_RESET event, refer to the guidelines and transfer the relevant data and searches in methods IF_WD_SELECT_OPTIONS_20->RESET and IF_WD_SELECT_OPTIONS_20->SET_SAVED_SEARCHES.

End of the note.

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.

Procedure

To define the layout, call method INIT_SELECT_OPTIONS, for example, in method WDDOINIT (either of the view or of the component controller).

Note Note

Make sure that this call is made before the rendering.

End of the note.

You can find an example of the source code for the method call in Embedding Select Options.