Using Input Fields
Prerequisites
You must already have created a dynamic document and added a form to it using the add_form method.
Context
You can use input fields to allow the user to enter data in a dynamic document. An input field can also trigger an event when the user presses F1 (field help), or ENTER.
Procedure
-
In the declaration part of your program, declare an object reference variable with the type REF TO cl_dd_input_element.
-
If you want to react to any of the events that can be triggered by an input field, create a local class in your program and write handler methods for the required events. Remember to import the special interface parameter sender, so that you can tell on which input field the event was triggered.
User action
Event triggered (event of class cl_dd_input_element)
User presses F1
help_f1
User presses ENTER
entered
-
Call the add_input_element method for the form instance with which you are currently working.
-
The method returns an object reference to the list box, which you should assign to the reference variable you declared in step 1.
-
Using the object reference returned by the method call, register the instance for the required events for which you defined event handler methods in step 2.