Show TOC

Procedure documentationTable Manipulation Locate this document in the navigation structure

 

In many applications it is not sufficient to be able to access table fields or navigate through a table, you also often need to add or delete rows. SAP JCo provides methods that enable you to do this. Normally, you add rows for table parameters that are sent to the SAP server (for example, adding items to a customer order). This example uses the table returned by the BAPI CompanyCode.GetList.

This graphic is explained in the accompanying text.

Figure 1: Table Manipulation

  • If the method deleteRow() is called without parameters, it deletes the current row. If you define a row number, the corresponding row is deleted.

  • The method appendRow() adds a row at the end of the table. If you want to append multiple rows simultaneously, you can specify an integer argument. This leads to better performance than with adding rows individually.

  • The method insertRow(int) inserts a row at any position in the table.

  • The method deleteAllRows() deletes all rows of a table.

For an example program containing some of these methods, see:

The following table summarizes the JCO.Table methods that are not contained in JCO.Structure.

This graphic is explained in the accompanying text.

Figure 2: JCO.Table Methods