SAP Input Field
The input field control enables an input field to be created for free texts with an associated label. Two different types of input field are provided:
- With a simple input field the user can enter a text and then pass this to the application by pressing the input key.
- The SAP input field control provides the option to activate an input history. In this case, a user can either select an entry used earlier from the dropdown menu, or enter a new text.
Like all other controls, the SAP input field 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 input field.
Prerequisite
The SAP input field 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 Input Field Control
- Application development can activate usage of the input history.
- A label text can be assigned to the input field.
- The length of the label can be defined explicitly.
- A Find button with an icon can be added to the input field.
- A default text can be defined for the input field. This text can be overwritten by the user at runtime.
- An auto-submit function can be activated. If so, the content of the input field is automatically sent to the back end, shortly after the user enters the text (after 400 milliseconds).
- The control provides events that application development can react to:
- If the Find button is clicked or the input button pressed, the SUBMIT event is sent to the back end.
- If auto-submit is activated, an event is sent to the back end as soon as the user finishes entering text or interrupts the input.
Implementation
The instance of the input field control is defined with class CL_GUI_INPUT_FIELD. The associated instance hierarchy is CL_GUI_OBJECT -> CL_GUI_CONTROL -> CL_GUI_INPUT_FIELD.
| SET_TEXT | Sets the text of the field label |
| GET_TEXT | Reads the text of the field label |
| SET_INPUT_PROMPT | Sets an initial text in the input field that can be overwritten (example: "Enter search text") |
| SET_LABEL | Sets a label for the input field |
| SET_LABEL_WIDTH | Sets the length of the label text |
| ACTIVATE_HISTORY | Activates the input history |
| ACTIVATE_FIND_BUTTON | Displays the Find button and triggers event SUBMIT |
| SET_FIND_BUTTON_ICON | Sets the icon information for the Find button |
| SET_FIND_BUTTON_TOOLTIP | Sets the tooltip for the Find button |
| SUBMIT | Triggered if the Find button is clicked or the input button pressed |
See also program SAP_LISTBOX_DEMO_TEST in the system.