add_table_item2 

You use this method to add an internal table to the link server.

This method is different from add_table_item in that, in this case, you do not have to call the Data Provider yourself.

CALL METHOD link_server->add_table_item2
     EXPORTING item_name    = item_name
               item_title   = item_title
               ddic_name    = ddic_name
               description  = description
               date         = date
               time         = time
               no_flush     = no_flush
     IMPORTING error        = error
               retcode      = retcode
     CHANGING  data_table   = data_table
               fields_table = fields_table
               properties   = properties.

Description of parameters

Parameter

Optional

Description

item_name

 

The name of the internal table in the ABAP program

item_title

X

Describes the table

ddic_name

X

Name of the table or structure in the ABAP Dictionary.

description

X

Optional description

date

X

Date of last change

time

X

Time of last change

data_table

 

Data table

fields_table

X

Description of the table structure (if you have not already passed it using the ddic_name parameter).

Create the table with reference to the type SOI_FIELDS_TABLE .

properties

X

Additional properties

Create the table with reference to the type SOI_PROPERTIES_TABLE .

If you specify an internal table whose structure is defined in the ABAP Dictionary, enter the name of the structure as the parameter ddic_name. This transfers the column names to the SAPgui along with the table, so that you can address a column by its ABAP Dictionary name in a macro.

However, if the table structure is defined in a type pool or directly in the program, the system generates numbers for the column names. If you then still want to address a column using a meaningful name, you must program the name transfer yourself. To do this, create an extra table to contain the column information. Then use the function module DP_GET_FIELDS_FROM_TABLE to retrieve the column descriptions:

CALL FUNCTION 'DP_GET_FIELDS_FROM_TABLE'

       TABLES

             DATA             = SALES_TABLE

             FIELDS           = FIELDS_TABLE.

You can then use your own column names, as shown in the following example:

   READ TABLE FIELDS_TABLE INDEX 1.

   FIELDS_TABLE-FIELDNAME = 'Region'. "#EC NOTEXT

   MODIFY FIELDS_TABLE INDEX 1.

   READ TABLE FIELDS_TABLE INDEX 2.

   FIELDS_TABLE-FIELDNAME = 'Sales'. "#EC NOTEXT

   MODIFY FIELDS_TABLE INDEX 2.

You can now use the table with column information when you call the method add_table_item2.

You cannot add structures directly to the link server. However, you can create a single-line table and send it to the link server.