ABAP to Native Data Type Mapping 

ABAP Data Type

C++ Native Data Type

CHAR

string (of Standard C++ Library)

INT4

int

INT2

int

INT1

int

NUMC

string

PACK

double

LANG

string

CURR

double

CUKY

string

DATS

string

UNIT

string

TIMS

string

DEC

double

QUAN

double

ACCP

string

CLNT

string

FLTP

double

RAW

string (see note), void*

 

Note: the RAW data type is mapped to the string class of the Standard C++ Library, but care must be taken when using this object. When the application program calls a field getter function (Get<fieldname>()) on a field of RAW type and retrieves a string object, the string object encapsulates a character array of length equal to the ABAP-defined length of the field. The character array encapsulated inside the string object may contain null character in the beginning or the middle of the array, therefore this array cannot be treated as a normal character string. Using cout of the iostream class would output a truncated character string, terminated by the first null character. Also, when the application program calls a field setter function (Set<fieldname>()), the argument passed is void* , a pointer that points to the raw byte array to be copied to the intended field.