Creating a Table Object 

You create a Table object by using either the Add method (in the Tables collection) or the NewTable method (in the TableFactory object). However, these methods do not define the structure for the table. You can define the structure in one of the following ways:

Use the Create method. You provide the table name and the internal length of one row. In order to build a structure, just add new columns to the Table object. (You do this with the Columns collection

Both methods use an RFC connection to obtain the actual structure of a table in the R/3 System. The first parameter for these functions is the RFC connection: either a Connection object (as produced by the SAP Logon Control), or a native RFC handle (a parameter of type Long). C/C++ programmers can use the VisualRFCService Handle by using a VARIANT of type CY, with the application handle in the lower part and the Login ID in the upper part of that structure.

Use the method CreateFromTable to do this.

After creating the Table’s structure, you can always change it by adding, removing and changing the column description. However, these changes must never exceed the row length originally defined by the Create methods.

This dynamic behavior of the Columns allows RFC-enabled programs to use black box (generic) tables. An example is a function module that passes back information in a single-column table and provides information about the table’s structure in a second table. This approach enables the use of RFC functions that can return different types of tables based on the values of input parameters.