Creating Standard Tables

Prerequisites

You must have already instantiated a dynamic document.

Context

Use a standard table if you need a table into which you can place any kind of element, or if you need to place more than one element in each cell.

Procedure

  1. Declare a reference variable with the type cl_dd_table_element. You will use this to construct the table.
  2. Decide how many columns your table should have. For each column, declare a reference variable with the type cl_dd_area.
  3. Call the add_table method of your document instance, specifying the number of columns that your table should have. In the CALL METHOD statement, receive the TABLE parameter into a reference variable of type cl_dd_table_element.
  4. Call the method add_column of your table element instance. This returns a reference to the column Repeat this step for each column in your table.

    You now have an object reference for each column of your table.

  5. Use the methods of these object references to insert objects into the columns in the current line.
  6. When you have filled the current line, call the new_row method.

    You can now create the next row of your table. The reference variables that represent the columns now point to the corresponding column in the new row.