Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Run allocation on condition

I want to run allocation logic on condition.

My allocation logic is as follows:

//  COPYING ABOVE RATE TO ALL HQs

*XDIM_MEMBERSET TIME = BAS(%TIME_SET%)

*XDIM_MEMBERSET CATEGORY=Actual

*XDIM_MEMBERSET ZVALUATION = RATE

*XDIM_MEMBERSET ACCOUNT = PL010

*XDIM_MEMBERSET RPTCURRENCY = <ALL>

*RUNALLOCATION //COPYING RATE FROM NO_HQ TO ALL HQ

  *FACTOR = 1

  *DIM ZHQ_CNTRY_CUST WHAT = NO_HQ; WHERE=BAS(ALL_HQ)

*ENDALLOCATION

*COMMIT

What above script does is just copies data from "NO_HQ" and replicates it on BAS(ALL_HQ)

But I want to copy the rates to BAS(ALL_HQ) on condition that member of ALL_HQ should have value in ZVALUATION=VALUE

Eg:

ZVALUATIONVALUERATE
ZHQ_CNTRY_CUST(Data available from BW Remark
NO_HQ 50calculated by different logic script
HQ15000050Want to copy rate
HQ20 Don’t want to copy rate
HQ36000050Want to copy rate
HQ49000050Want to copy rate
HQ50 Don’t want to copy rate
Tags:
Former Member
replied

The rule you want to implement:

If VALUE <> 0 for HQx the copy RATE from NO_HQ to HQx

Then after RUNALLOCATION you may clear RATE with WHEN/ENDWHEN:

*XDIM_MEMBERSET TIME = BAS(%TIME_SET%)

*XDIM_MEMBERSET CATEGORY=Actual

*XDIM_MEMBERSET ZVALUATION = RATE

*XDIM_MEMBERSET ACCOUNT = PL010

*XDIM_MEMBERSET RPTCURRENCY = <ALL>

*RUNALLOCATION //COPYING RATE FROM NO_HQ TO ALL HQ

  *FACTOR = 1

  *DIM ZHQ_CNTRY_CUST WHAT = NO_HQ; WHERE=BAS(ALL_HQ)

*ENDALLOCATION

// have to repeat scope definition after *ENDALLOCATION!

*XDIM_MEMBERSET TIME = BAS(%TIME_SET%)

*XDIM_MEMBERSET CATEGORY=Actual

*XDIM_MEMBERSET ZVALUATION = RATE

*XDIM_MEMBERSET ACCOUNT = PL010

*XDIM_MEMBERSET RPTCURRENCY = <ALL>

*XDIM_MEMBERSET ZHQ_CNTRY_CUST = BAS(ALL_HQ)

*WHEN ZVALUATION

*IS *

*REC(EXPRESSION = [ZVALUATION].[VALUE]==0 ?  0 : %VALUE%)

*ENDWHEN

Vadim

P.S. And NEVER use COMMIT if you are not using MDX calculations!

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question