Creating a Form

Purpose

Using a form in a dynamic document allows you to use interactive elements that are not allowed in the main document, namely

  • input fields
  • pushbuttons
  • dropdown list boxes

Prerequisites

In order to create a form, you must already have instantiated a dynamic document. You must also declare a reference variable with the type cl_dd_form_area .

Process Flow

  1. Call the method add_form for your main document. This inserts a form area into the document and returns an object reference to it.
  2. Fill the form by calling the methods of the object returned in step 1. It may contain all of the display elements that you can use in a main document. In addition, it may contain the following elements that are only allowed on forms:

To insert this element

Use method

See also

Pushbutton

add_button

Using Pushbuttons

Input field

add_input_element

Using Input Fields

Dropdown list box

add_select_element

Using Dropdown List Boxes

  1. When you have finished creating both your form area and the main document, use the merge_document method of the main document instance to include the form in the main document.

 

Do not nest forms, since the results can be unpredictable.