Function sapnwrfc::binding::RfcGetString [] [src]

pub unsafe extern "C" fn RfcGetString(
    dataHandle: DATA_CONTAINER_HANDLE,
    name: *const SAP_UC,
    stringBuffer: *mut SAP_UC,
    bufferLength: c_uint,
    stringLength: *mut c_uint,
    errorInfo: *mut RFC_ERROR_INFO
) -> RFC_RC

Returns the value of the specified field as null-terminated string.

The charBuffer will be filled with a null-terminated string representation of the field value. In case the buffer is too small, e.g. no place for string termination, the function will return RFC_BUFFER_TOO_SMALL. stringLength contains the number of written characters, or the required number of characters in case RFC_BUFFER_TOO_SMALL was thrown. The result will be null-terminated.

The field specified by name needs to be of one of the following data types. If the field has one of the listed non-char-like data types, the RFC library will convert the field value to string format. Example:\n If "name" specifies a field of type INT4 with the value 4711 and stringBuffer is an SAP_UC[10], then the buffer will be filled as follows: "4711\0xxxxx". (x: left unchanged.)

Note: If the target field has type BYTE or XSTRING, the bytes will be converted to a hex encoded string representation.

\in dataHandle A data container (function handle, structure handle or table handle). If dataHandle is a table handle, the function will read the field value of the current row. \in *name The name of the field to read. \out *stringBuffer Pre-allocated buffer, which will receive the (converted) field value. \in bufferLength Size of the buffer in SAP_UC. \out *stringLength Always returns the string's length, no matter whether the stringBuffer had been large enough or not. (Note that if you want to try again after an RFC_BUFFER_TOO_SMALL, you need to make the stringBuffer at least *stringLength + 1 in order to account for the terminating null.) \out *errorInfo More information in case the field does not exist or a conversion fails. \return RFC_RC