Creating a Quick Table

Use

If you want to construct a table containing only text, icons, and links, especially if the table is large, you should use a quick table. At runtime, the system can construct a quick table far faster than a standard table.

In a standard table, each column is a separate object, which means that the system has a lot of "construction work" to do for the table framework. When you construct a quick table, on the other hand, you paste the table contents directly into a single area object.

Prerequisites

You must already have instantiated a dynamic document.

Procedure

  1. Declare a reference variable with the type cl_dd_table_area .
  2. If you want to set column styles in your table, declare a reference variable with the type cl_dd_table_element .
  3. Call the add_table method of your document instance, specifying the number of columns your table should have, and whether you want it to have headings. Assign the tablearea parameter to the reference variable you declared in step 1 and the table parameter to the reference variable you declared in step 2 (if applicable).
  4. If you want to set column styles, call the set_column_style method for the object you received from the table parameter.
  5. If your table is to have headings, call the add_heading method for each column of the table.

    The headings are inserted into the table sequentially from left to right.

  6. Add elements to the first row of your quick table. You may use one method call for each column of the table.
  7. Conclude the row by calling the new_row method. The next element that you insert will appear in the first column of the next row.

You must call new_row at the end of your final row, otherwise it will not be displayed.

See also:

Coding Example