SAP Function RSDRI_CUBE_WRITE_PACKAGE - Write data package into specific InfoCube

Parameter Reference Type Length Default Optional Text
I_CURR_CONVERSION RS_BOOL C 1 RS_C_TRUE X Convert Currency Indicator into DB Format Yes/No
I_DELTA RS_BOOL C 1 RS_C_FALSE X Write Delta for existing Cube content
I_INFOCUBE RSD_INFOCUBE 0 InfoCube Name
I_MDATA_CHECK RSDRI_MDATA_CHECK C 1 RS_C_FALSE X Error if No Master Data Exists
I_NCUM_INIT RS_BOOL C 1 RS_C_FALSE X Initialize Set?

Parameter Reference Type Length Text
E_RECORDS I I 4 Number of Records Written
E_REQUID RSREQUNR C 30 Request ID Under Which the Data Was Inserted
E_TS_MSG RSDRI_TS_MSG h 712 Message Table for InfoCube Writes

Parameter Reference Type Length Default Optional Text
C_T_DATA STANDARD TABLE 0 Data (structure: V2 view of the cube)

Exception Text
DUPLICATE_RECORDS Duplicates When Writing in the Cube
ILLEGAL_INPUT Incorrect Input Parameter
INFOCUBE_NOT_FOUND InfoCube does not exist
INHERITED_ERROR Other Error
NOT_TRANSACTIONAL No transactions can be written
REQUEST_LOCKED
ROLLBACK_ERROR Error Deleting Request from Cube

Functionality
This module enables you to write data to an InfoCube. An RFC-compatibleversion of this module also exists:
RSDRI_CUBE_WRITE_PACKAGE_RFC.
The class CL_RSDRI_INFOCUBE also allows you to write to an InfoCube. Themodules RSDRI... are also a wrapper for this class.

  • If the InfoCube to which you want to write is a transactional InfoCube
  • in planning mode, the data is written to an open planning request. Thisplanning request will be used jointly by all write programs that useRSDRI_CUBE_WRITE_PACKAGE to write to the InfoCube. The system closes theplanning request automatically and opens a new planning request, if thecurrently open planning request has reached a certain size. Only oneopen planning request can exist for each InfoCube.
    If a write error occurs that is intended to cause a termination (seeparameter i_mdata_check), the current package is not written at all. Theopen planning request remains in the state it had before it was called.In this case, no further actions from outside are required to roll thedata back.
    • If the InfoCube is in staging mode, or if the InfoCube is not a
    • transactional InfoCube, RSDRI_CUBE_WRITE_PACKAGE opens a new planningrequest. In this case, only one write program at a time can write to theAPO request, since only one planning request can be open at a time. Theopened planning request is closed again at the end of theRSDRI_CUBE_WRITE_PACKAGE call. This means that eachRSDRI_CUBE_WRITE_PACKAGE call results in a new planning request, whichis closed at the end.
      If a write error occurs that is intended to cause a termination (seeparameter i_mdata_check), the request that has just been opened haserrors and is closed. It is then deleted automatically.

      Update Task
      In principle it is possible to use an update task-compatible module tocall RSDRI_CUBE_WRITE_PACKAGE or its RFC-compatible variantRSDRI_CUBE_WRITE_PACKAGE_RFC. The following restrictions exist, however:
      Writes with delta determination are not possible in the update task.
      If the InfoCube has changed in the meantime, the InfoCub write programmust be generated again. In the update task, this possible only withouta COMMIT, meaning that other write programs have to wait until theupdate task that has regenerated the write program has executed aCOMMIT.
      If the structure of an InfoCube for which delta determination has beenpermitted has changed (see parameter i_delta), the staging table mustalso be regenerated as part of the write program generation. This is notpossible in the update task and raises the exception INHERITED_ERROR.
      Settings in the InfoCube, such as "automatic ROLLUP of a request" or"automatic COMPRESSION of a request, are not possible if thetransactional request has been closed in the UPDATE task.
      Speedy rollups or compressions can be guaranteed by scheduling a regularbackground job.
      To avoid these generation problems, we recommend that you call thefunction moduleRSDRI_INFOCUBE_GEN_PROGRAM for theInfoCube in question before the update task is called. This moduleregenerates the InfoCube write program and if necessary, alsoregenerates the staging table.
      CALL FUNCTION 'RSDRI_INFOCUBE_GEN_PROGRAM'
      EXPORTING
      I_INFOCUBE = l_infocube
      EXCEPTIONS
      OTHERS = 1.

      Description
      This parameter specifies whether currency key figures need to beconverted into the internal SAP format. In this internal format,currencies are always stored with two decimal places. The table TCURXcontains the conversion factor for converting from the external to theinternal format.
      The quantity fields in InfoCubes always have two decimal places,potentially leading to rounding errors when the data is written to theABAP table c_t_data, which is passed to the module.

      Value range
      Value,,Meaning
      ' ',,The passed data is already in the internal format. No conversion isnecessary.
      'X',,The passed data is ´in the external format. The data must beconverted.

      Description
      If you choose this option, the data provided is written to the InfoCubein such a way that, for all characteristic tuples included, the total ofthe data in the cube matches this data.
      In other words, the system determines the delta with the data thatcurrently exists in the InfoCube and writes it to the InfoCube.
      The calling program itself is responsible for locking the characteristictuples in the data provided. If someone else writes identical tupleswith delta determination to the cube at the same time, the resultingdelta can be incorrect.
      This option is possible only if the InfoCube contains cumulative keyfigures only, the cube is not a non-cumulative cube, and the SAP releaseis at least 701 or higher. In addition, delta determination must bepermitted explicitly in the data load properties in transaction RSDCUBE.
      Caution:
      When writing with delta determination, the number of records written(E_RECORDS) may differ from the number of data records provided. Recordswithout a delta (whose key figures are all initial), are not written tothe InfoCube. On the other hand, duplicates in the dimension tables cancause the number of written records to be larger than the number ofrecords provided.

      Value range
      Value,,Meaning
      RS_C_FALSE,,The data is written to the InfoCube without a delta beingdetermined. This is the standard setting.,,
      RS_C_TRUE,,The data is written to the InfoCube and a delta isdetermined.

      Description
      Do you want records without master data to be written to the InfoCube?

      Value range
      'A': Error, if no master data exists for a record. The entire packageremains unwritten if errors occur.
      'X': Error, if no master data exists for a record. Records with errorsare not written.
      ' ': Master data is generated if it does not exist yet. Records witherrors cause the entire package to remain unwritten.

      Description
      Is the data package that you want to write a stock initialization?
      Caution:
      Multiple stock initializations cause unexpected reporting results, andto terminations of compressions.

1170084Termination when using RSDRI_CUBE_WRITE_PACKAGE after SP16
1120747P17: OutlookSoft: Only one open APO request permitted
917177Status of transactional requests BW 7.0; performance