RFC Calls for Manipulating Internal Tables


These functions allow processing of ABAP internal tables in C.

ABAP internal tables follow the model of a relational database table.

ABAP internal tables consist of identical rows. When it is created, a table is empty. In ABAP you can fill rows into a table by the statements ‘Insert’ or ‘Append’. You can access a row by ‘Read Table’, and you can delete a row by ‘Delete’. You can free a table by ‘Free Table’, and you can receive information about tables by ‘Describe’.

These language constructs correspond to the following C routines:

  • ItCreate

creates a new internal table

  • ITAB_H

handle of an internal table

  • ItDelete

deletes the content of a complete internal table and frees storage

  • ItGetLine

reads a line from an internal table

  • ItInsLine

inserts a line into the given position of an internal table

  • ItAppLine

appends a line at the end of an internal table

  • ItDelLine

deletes a line from an internal table

  • ItGupLine

reads a line for update

  • ItFree

resets an internal table to initial state

  • ItFill

returns the number of lines in a table

  • ItLeng

returns the width of a table, i.e. the size of a row of the table

The syntax and semantics of the above RFC calls are identical for all platforms supported.

The syntax of the RFC calls is described in saprfc.h. The syntax of the RFC calls for manipulating internal tables is described in sapitab.h.

Creating and filling a new internal table

const int myTableSize = 200;
ITAB_H handle;
void * ptr;

handle = IitCreate("MyTable", myTableSize, 0,0);
if(handle == ITAB_NULL)
... error

ptr = ItAppLine(handle);;

if(ptr != NULL)
memcpy(ptr,..., myTableSize);
while(ptr != NULL);