Monday, March 30, 2020

Writing data into cube in delta mode

If there is a need to write data from ABAP code (e.g. from some UI technology like WebDynpro) there are a function modules like RSDRI_CUBE_WRITE_PACKAGE and RSDRI_CUBE_WRITE_PACKAGE_RFC to support that. The FMs are writing so called planning requests “Request w/o InfoPackage (APO Request)” means that particular cube needs to be set to transactional (real time) status.

It is not very well known fact that these function modules support also writing data in delta mode. By specifying input parameter called I_DELTA (to TRUE value), the system first calculates delta as difference between the data that is already present in the cube and data that is to be written into the cube. All characteristic tuples are evaluated of data set.

There are two prerequisites that must be fulfilled by the cube while using the delta function:

1. It works for cubes that contain cumulative key figures only and the cube is not a non-cumulative cube.

2. The delta feature must be permitted explicitly in the cube. It can be set on in the t-code in RSDCUBE. The flag “Delta Load Allowed with RSDRI” is stored in table RSDCUBE-DELTA_LOAD.

8 comments:

Serra said...

Hi Martin

It's possible to used this FM RSDRI_CUBE_WRITE_PACKAGE in S4hana SAP BW system??

Regards

Pedro Serra

Serra said...

Hi Martin

its possible to used this FM in S4hana SAP BW system.

Regards

Martin Maruskin said...

hi Pedro,

Assuming you are talking about BW/4HANA (BW/4, B4H, BW4) yes the FM RSDRI_CUBE_WRITE_PACKAGE still can be used in SAP BW/4HANA 1.0 and SAP BW/4HANA 2.0.

cheers

Serra said...

Hi Martin

Yes, my system is BW/4HANA.
I don't know if you can help me with my issues, but when I use this FM I get an exception "infocube_not_found".
I'm trying to move data between two Advanced DataStore object.

Regards

Martin Maruskin said...

Are you sure you using correct technical name of the aDSO object? What is a source code you are using? Is your aDSO object newly created or it is migrated from original infocube?

Serra said...

Hi Martin

Yes, I'm sure, below you can see my source code and the aDSO is newly.

TECHNICAL NAME: /CPMB/IMITJ7Q

CALL FUNCTION 'RSDRI_CUBE_WRITE_PACKAGE'
EXPORTING
i_infocube = '/CPMB/IMITJ7Q'
* i_curr_conversion = abap_false
* i_mdata_check = lv_valid
* i_delta = lv_delta
* IMPORTING
* e_ts_msg = em_message
CHANGING
c_t_data =
EXCEPTIONS
infocube_not_found = 1
illegal_input = 3
rollback_error = 5
duplicate_records = 6
request_locked = 7
not_transactional = 8
OTHERS = 9.
IF sy-subrc <> 0.
*End of change Accenture (FG): 06.12.2012 18:43:43
RAISE EXCEPTION TYPE cx_uja_admin_error EXPORTING textid = cx_uja_admin_error=>ex_failed_write_cube_data.
ENDIF.
ENDIF.

Martin Maruskin said...

hi Pedro,

I see your aDSO falls under BPC naming convention. Can you check if the aDSO is not in planning mode? The object where you are writing the data needs to be in loading mode in order to allow writing.

cheers

Serra said...

Hi Martin

Thank you, it's works.

Regards