The CBoTable Template Class 

This class is defined in cboglobal.h.

This class is used in conjuntion with the reference structure type proxy classes (see The Reference Structure Type Classes) for accessing the rows and their fields in table parameters. The reference structure type proxy classes are used as template arguments for CBoTable template class. The resulting class, for example, CBoTable<CBoBapi0015_1> , then offers the functions necessary to access the rows in the table parameter of type BAPI0015_1 , and setter and getter functions to access the fields.

 

Example:

The following example shows how the application program uses a table parameter proxy class to access the rows and fields of a table parameter. Note that this example uses the reference structure type CBoBapi0015_1 , which describes a profit center. The table parameter itself is called Profitcenters, and the function CBoProfitCenter::CGetlistParams::GetProfitcenters() returns a reference to an object of the table parameter proxy class CBoTable<CBoBapi0015_1> . And, the CBoTable<CBoBapi0015_1> object offers the GetRow() and GetConstRow() functions for the application program to obtain access to a specified row object, which is in turn, a CBoBapi0015_1 object.

CBoProfitCenter::CGetlistParams GetlistParams;

CBoTable<CBoBapi0015_1>& Profitcenters;

Profitcenters = GetlistParams.GetProfitcenters();

for(int i=0; i < Profitcenters.GetRowCount(); i++)

{

string strOut;

CBoBapi0015_1& ThisRecord = Profitcenters.GetRow(i);

// or use ‘const’ when only reading from fields

// const CBoBapi0015_1& ThisRecord = Profitcenters.GetConstRow(i);

strOut = ThisRecord.GetCoArea();

cout << strOut << endl;

strOut = ThisRecord.GetProfitCtr();

cout << strOut << endl;

strOut = ThisRecord.GetValidTo();

cout << strOut << endl;

strOut = ThisRecord.GetPctrName();

cout << strOut << endl;

strOut = ThisRecord.GetInCharge();

cout << strOut << endl;

}

 

Construction

CBoTable

The application program does not need to construct an object of this class.

Operations

AppendToTable

Appends a new, initialized row to the table parameter, and returns a reference to a reference structure type proxy object that represents the newly appended row.

ClearTable

Deletes all rows in the embedded table parameter.

CopyLineFrom

Copies the content of a specified memory area to the specified row in a table parameter.

CopyLineTo

Copies the content of the specified row in a table parameter to a specified memory area.

GetConstRow

Returns a ‚const‘ reference to an object of the reference structure type proxy class that represents the desired table parameter row specified by the index.

GetLength

Returns the number of bytes in each row of the embedded table parameter.

GetRow

Returns a reference to an object of the reference structure type proxy class that represents the desired table parameter row specified by the index.

GetRowCount

Returns the number of rows currently in the embedded table parameter.

InsertIntoTable

Returns a reference to an object of the reference structure type proxy class.

RemoveRow

Removes the specified row.