Attribute and hierarchy change run : If you change master data (navigation attributes) or hierarchies of a characteristic that is contained in aggregates, you must adjust these aggregates. This ensures that queries that access the InfoCube or assigned aggregates are consistent. Unlike in the aggregates, no data that refers to navigation attributes or hierarchies is stored in the InfoCube. The master data or the hierarchy tables are joined with the tables of the cube when the query is executed.Regardless of whether or not aggregates exist, the system does not automatically transfer master data record changes, rather you must activate this master data explicitly. If aggregates are involved, you must adjust them using the change run before you can 'release' the data record changes (the corresponding InfoObjects or hierarchies are registered for the next change run: Transaction RSA1 -> Tools -> Apply Hierarchy/Attribute Change -> InfoObject List or Hierarchy List).
Solutions:
1. Shift Change runs from info package level to global level and/or process chain level in order of priority. Means instead of keeping ACR after each infopackage update we can accumulate all in one ACR at end of Process Chain or in a separate chain, if this data is not dependent for next loads(means no look ups).
2. Increase CR_MAXWAIT time. CR_MAXWAIT is to create a delay for second attribute change run while the first attribute change run is running in the system.
At any single point in time, there can only be one CR in the startphase. Every other CR will immediately fail when unsuccessfullytrying to acquires the startlock. No wait is done here.
Above option is helpfull When the running CR is in the workphase, only then will a second CR enter the start phase and wait as long as specified in CR_MAXWAIT.And when the second CR is in the startphase, all other CRs trying to start will again immediately fail.
3. Created an ABAP Program and included before each Attribute Change Run in Process Chains. This Program checks if any ACR running in the system or not. If any ACR is running it delays 10 Secs. Recursively it checks and delays 10 secs every time. Program execution finishes only when there is not ACR running in the system and allows next process(Attribute Change Run) to trigger in Process Chain. After implementation of this program no ACR failures in our system. Check the coding at end of this blog in appendix.
Appendix:
How to Integrate an ABAP Program in a Process Chain
Note 903886 - Hierarchy and attribute change run
Note 825927 - The BW Changerun: CR_MAXWAIT
Code :
*REPORT ZRSDDS_CHANGERUN_MONITOR.
TYPE-POOLS: rsdds, rrhi, rsd.
SELECTION-SCREEN BEGIN OF BLOCK NO_TIMES WITH FRAME.
PARAMETERS : L_TIMES TYPE I. --> Create a variant provide value(ex: 100, then it will wait at max 100*10 secs).
SELECTION-SCREEN END OF BLOCK NO_TIMES.
DATA: l_cr_state TYPE rsdds_cr_state,
l_t_chanm TYPE rsd_t_iobjnm,
l_s_chanm TYPE rsd_s_iobjnm,
l_t_hieid TYPE rshi_t_hieid,
l_hieid TYPE rshi_hieid,
l_t_aggrstate TYPE rsdds_t_aggrstate,
l_s_aggrstate TYPE rsdds_s_aggrstate,
l_t_msg TYPE rs_t_msg,
l_s_msg TYPE rs_s_msg.
write: /1 'Date' color 7, 12 'Time' color 7,
22 'Attribute change run Status'
color 7 .
Write AT /1(52) SY-ULINE.
DO L_TIMES TIMES.
CALL FUNCTION 'RSDDS_CHANGERUN_MONITOR'
IMPORTING
e_cr_state = l_cr_state
e_t_chanm = l_t_chanm
e_t_hieid = l_t_hieid
e_t_aggrstate = l_t_aggrstate
e_t_msg = l_t_msg.
case l_cr_state.
when rsdds_c_cr_state-finished.
write: /1 sy-datum, 12 sy-timlo,
22 'No Attribute change run Running'
color col_positive . --> We can check this program is usefull or not... how many times it saved dataload failues due to ACR Collision (SPOOl we can check at TCODE: SP01)
EXIT.
when rsdds_c_cr_state-start.
write: /1 sy-datum, 12 sy-timlo,
22 'Attribute change run Started'
color 3.
wait up to 10 SECONDS.
when rsdds_c_cr_state-running.
write: /1 sy-datum, 12 sy-timlo,
22 'Attribute change run Running'
color col_negative.
wait up to 10 SECONDS.
when rsdds_c_cr_state-canceld.
write: /1 sy-datum, 12 sy-timlo,
22 'Attribute change run Cancelled'
color 4.
EXIT.
endcase.
ENDDO.
8 Responses to How to avoid Attribute Change Run Collision
Hello there,
Great Blog and very useful.
I have a slight problem with the ABAP attached as it seems parameter types have been altered in Function Module RSDDS_CHANGERUN_MONITOR in BW 7.0.
Export Parameters are:
E_TS_STATE_CR TYPE RSDDS_TS_STATE_CR
E_TS_CHANM_IN_AGGR TYPE RSDDS_TS_CHABAS
E_TS_HIER_CR TYPE RSDDS_TS_HIER_CR
E_TS_CHABASNM_CR TYPE RSDDS_TS_CHABASNM_CR
E_T_AGGREGATE_CR TYPE RSDDS_T_AGGREGATE_CR
E_TS_TREXAGGR_CR TYPE RSDDS_TS_TREXAGGR_CR
E_TSX_MSG_CR TYPE RSDDS_TSX_MSG_CR
Kind regards
Klaus
Like this it should work. If you need to check hierarchies just add import parameter for hierarchies...
Kind regards
Klaus
REPORT ZRSDDS_CHANGERUN_MONITOR.
TYPE-POOLS: rsdds, rrhi, rsd.
SELECTION-SCREEN BEGIN OF BLOCK NO_TIMES WITH FRAME.
PARAMETERS : L_TIMES TYPE I.
*--> Create a variant provide value(ex: 100, then it will wait at max 100*10 secs).
SELECTION-SCREEN END OF BLOCK NO_TIMES.
DATA:
l_cr_state TYPE rsdds_cr_state,
X_TS_STATE_CR TYPE RSDDS_TS_STATE_CR ,
c_TS_STATE_CR TYPE rsdds_cr_state,
X_TS_CHANM_IN_AGGR TYPE RSDDS_TS_CHABAS ,
X_TS_HIER_CR TYPE RSDDS_TS_HIER_CR ,
X_TS_CHABASNM_CR TYPE RSDDS_TS_CHABASNM_CR,
X_T_AGGREGATE_CR TYPE RSDDS_T_AGGREGATE_CR,
X_TS_TREXAGGR_CR TYPE RSDDS_TS_TREXAGGR_CR,
X_TSX_MSG_CR TYPE RSDDS_TSX_MSG_CR.
constants: rsdds_c_changrun(30) type c value 'RSDDS_CHANGERUN'.
write: /1 'Date' color 7, 12 'Time' color 7,
22 'Attribute change run Status'
color 7 .
Write AT /1(52) SY-ULINE.
DO L_TIMES TIMES.
CALL FUNCTION 'RSDDS_CHANGERUN_MONITOR'
IMPORTING
e_ts_state_cr = X_TS_STATE_CR
*e_ts_state_cr = l_cr_state
E_TS_CHANM_IN_AGGR = X_TS_CHANM_IN_AGGR
*E_TS_HIER_CR =
E_TS_CHABASNM_CR = X_TS_CHABASNM_CR
E_T_AGGREGATE_CR = X_T_AGGREGATE_CR
*E_TS_TREXAGGR_CR =
E_TSX_MSG_CR = X_TSX_MSG_CR
.
*l_cr_state = X_TS_STATE_CR .
*
case l_cr_state.
when rsdds_c_cr_state-finished.
write: /1 sy-datum, 12 sy-timlo,22 'No Attribute change run Running' color col_positive .
**--> We can check this program is usefull or not... how many times it saved dataload failues due to ACR Collision (SPOOl we can check at TCODE: SP01)
EXIT.
when rsdds_c_cr_state-start.
write: /1 sy-datum, 12 sy-timlo,22 'Attribute change run Started' color 3.
wait up to 10 SECONDS.
when rsdds_c_cr_state-running.
write: /1 sy-datum, 12 sy-timlo,
22 'Attribute change run Running' color col_negative.
*wait up to 10 SECONDS.
when rsdds_c_cr_state-canceld.
write: /1 sy-datum, 12 sy-timlo,
22 'Attribute change run Cancelled' color 4.
EXIT.
endcase.
ENDDO.
Hi Klaus,
Thanks a lot.
Srini
Hi
Srini
Thanks a lot for this useful information.. great work!!!
Hi Klaus,I tried executing the Program.Eventhough I have some ACR running in background the program is not identifying it...Can you elaborate a little bit more on the program
Thanks,
Prashant.
the function module used in this code, checks only for running change runs if I'm not mistaken... It does not account for change runs that are released, but due to lack of BGD processes are not yet active (job delay).
This is at least something that we are facing...
Yes, It checks only active or running jobs only. No need to check released once.
Until job is not active locking not happens. so no need to consider.
Hope it Helps.
Based on SAP Note 1388570, in
BW 7.X this should not be an issue anymore.
Something to say?