Skip to Content

At times in SAP Business Planning and Consolidation, when writing a *WHEN-*REC-*ENDWHEN structure in script logic, we may come across a scenario where we want to post value to an intersection/region where there is no data. This was not supported previously as calculations happen in transaction mode by default.

The above is not a limitation anymore in SAP BPC NW with the new script logic keyword -*WHEN_REF_DATA. This allows us to switch our calculation mode to either transaction data or master data.  

Syntax

1)      To enable master data mode

*WHEN_REF_DATA = MASTER_DATA     

//*WHEN-*REC-*ENDWHEN CONSTRUCT

 

2)      To enable transaction data mode

*WHEN_REF_DATA = TRANS_DATA     

//*WHEN-*REC-*ENDWHEN CONSTRUCT

 

  • In transaction data mode, calculations will happen based on the transaction data in the source data region
  • In master data mode, calculations will happen based on the Cartesian product of the source data region no matter if the transaction data exists or not
  • The mode is set to transaction by default. So when we do not use this keyword in our logic, all the calculations in *WHEN construct will happen in transaction mode
  • When we use the *WHEN_REF_DATA statement, all the calculations in following *WHEN  constructs will happen in the mode specified until the next *WHEN_REF_DAT (if specified) 

Example

*XDIM_MEMBERSET TIME=2010.MAR

*WHEN ACCOUNT

*IS  ACC1

*REC(EXPRESSION=1000, ACCOUNT=ACC2)

*ENDWHEN

Here we have no *WHEN_REF_DATA and thus calculations will happen in the default mode i.e. transaction data mode. A value of 1000 will be written to ACC2 wherever there is a value for ACC1 in the period 2010.MAR.

Now, let us look at the same example in master data mode.

*XDIM_MEMBERSET TIME=2010.MAR

*WHEN_REF_DATA = MASTER_DATA    

*WHEN ACCOUNT

*IS  ACC1

*REC(EXPRESSION=1000, ACCOUNT=ACC2)

*ENDWHEN

In this case, 1000 will be written to ACC2 even when there is no data for ACC1 in the period 2010.MAR.

Please check the Note 1474115 for further details.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Michelle Crapo
    I’m begining to sound like I’m repeating myself.  But I’ve been trying to get to the WIKIs more often.

    Any chance you could post this information in the WIKI?   It’s good stuff, and I don’t want to lose it.

    Thank you!

    Michelle

    (0) 

Leave a Reply