SAP Combobox
The SAP combobox is a combobox that cannot be edited. In an application, the SAP combobox control enables an input field to be filled by selecting an option from a predefined dropdown list.
Like all other controls, the SAP combobox control is represented by a global class that provides a range of methods. These methods can be used by application development to influence the behavior of the respective instance of the SAP combobox.
Prerequisite
The SAP combobox control is available in:
- SAP GUI for Windows as of Release 7.30, patch level 5
- SAP GUI for Java as of Release 7.40
Functions of the SAP Combobox Control
- Application development can create a list of options that are assigned to the instance of the combobox for display.
- One of the options of this list can be selected as the default display.
- A label text can be assigned to the input field.
- The length of the label can be defined explicitly.
- The control provides an event that application development can react to:
- If the selection of the list was changed or the input button pressed, the SELECTED event is sent to the back end.
Implementation
The instance of the combobox control is defined with class CL_GUI_COMBOBOX, the associated instance hierarchy is CL_GUI_OBJECT -> CL_GUI_CONTROL -> CL_GUI_COMBOBOX.
| SET_ITEMS | Builds a table of entries for the option list |
| SET_LABEL | Sets the text of the field label |
| SET_SELECTED_ITEM | Sets the key of the entry from the options list that is to be displayed as the default entry |
| GET_SELECTED_ITEM | Transfers the key of the selected entry |
| SET_LABEL_WIDTH | Sets the length of the label text |
| ACTIVATE_SELECTION_EVENT | After selection, it triggers event SELECTED |
| SELECTED | Triggered if an option was selected from the list |
See also, program SAP_LISTBOX_DEMO_TEST in the system.