SAP Function RSDRI_ODSO_INSERT_RFC - Inserts Data Records into a Transactional ODS Object (RFC Version)

Parameter Reference Type Length Default Optional Text
I_ODSOBJECT BAPI6116-ODSOBJECT C 30 ODS Object
I_RFCDATA_UC XSTRING y 0 X Parameter for Transfer of Data to Be Inserted

Parameter Reference Type Length Text
E_NUMROWS BAPI6116XX-NUMROWS I 4 Number of Inserted Records

Parameter Reference Length Optional Text
I_T_DATA BAPI6116DA 251 Table with Data to Be Inserted

Exception Text
ACTIVE_TABLE_NAME_NOT_FOUND Name of Active Table Not Found
ARRAY_INSERT_FAILED Insertion of Array Failed
DATA_TARGET_NOT_ODS Data Target Is Not an ODS Object
INTERNAL_ERROR Unexpected Error
ODS_TYPE_NOT_TRANSACTIONAL ODS Object Type Is Not "Transactional"
RECORD_KEY_ALREADY_EXISTS At Least One of the Data Records Has a Key That Already Exists

Functionality
This function module receives the technical name of the DataStore objectas a return parameter. Data is either transferred in the generic table(i_t_data) or using the XSTRING parameter (i_rfcdata_uc). A check iscarried out to see whether the DataStore object is a DataStore objectfor direct writing. Then, the data records transferred are converted tothe structure of the DataStore object, and the data is inserted into theobject. The number of data records inserted is returned (e_numrows). Inthe event of errors during this process, the relevant exception isreturned.

Notes
You must use data transfer with the parameter I_RFCDATA_UC especially ifyou are dealing with packed data formats in the DataStore object (INT4,Float, ...), because of the fact that conversion errors may occur duringthe internal table transfer.
You must load the data into a table with the structure of the DataStoreobject first. The data must then be exported in the following way:
EXPORT rsdri = TO DATA BUFFER
rsdri is a constant that MUST be used. The objects in parenthesis are,on the one hand, a table that is filled with the data and, on the otherhand, the XString variable to which the data is transferred.
Table I_T_DATA has a flat, 250 byte long structure. Data is stored inthe DATA field. If the structure of the DataStore object table is longerthan 250 bytes, additional rows are required; the first row of theCONTINUATION field should be blank and each additional row should beflagged with X.
Data is either accepted in full or rejected in full. For this reason,you must ensure that the data is correct and in particular that thestructure of the data matches the structure of the DataStore objecttable exactly. Incorrect data or structures may result in SQL errors,exceptions, or in data being transferred in the wrong format.

  • Since a DataStore object for direct writing is often supplied with new
  • data, lock management must be implemented in the calling object. Forexample, you might implement no lock (except at database level) forquick insertion of a small number of records but implement a lock forlengthy inserts involving a large number of records.

    Further technical notes:
    The RFC-enabled function module RSDRI_ODSO_INSERT_RFC uses the localfunction module RSDRI_ODSO_INSERT.
    For remote calls, you should use the function moduleRSDRI_ODSO_INSERT_RFC. For local calls, you should use the functionmodule RSDRI_ODSO_INSERT, so that data conversions are saved before andafter the call and also to improve performance.

    Description
    Technical name of the DataStore object.