Skip to Content
0
May 15, 2020 at 06:20 AM

Script logic with multiple REC statements

141 Views

Hello Experts,

I am on SAP BPC NW 10.1 SP15 and using following logic to calculate value in ZXXXXX account.

The account ZXXXXX has some value in previous period for both COST_ID dimension, ZYYYYY has no value.

Also there is no increase/decrease in Ownership module so nothing is calculated in that lookup piece in middle of the logic.

The issue is that for COST ID 111 value is calculated but for 1221 it is overwritten by last REC statement as 0.

*SELECT (%COMPALL%,"ID","COMPANY_CODE","DEL_TYPE = '1'" AND "DIVEST_DATE = ' '")

*XDIM_MEMBERSET GRP_ACCNT_ID = XXXXX, ZXXXXX, YYYYY, ZYYYYY

*XDIM_MEMBERSET FISC_PERIOD = TMVL(-1,%GCR_FISC_PERIOD_SET%)

*XDIM_MEMBERSET CURR_CODE = USD

*XDIM_MEMBERSET COMPANY_CODE = SU01

*XDIM_MEMBERSET CONSOL_GROUP = GSU00

*XDIM_MEMBERSET COST_ID = 111, 1221

*WHEN GRP_ACCNT_ID

*IS ZYYYYY

*REC(FACTOR = 1,GCR_GRP_ACCNT_ID = ZXXXXX,FISC_PERIOD = %FISC_PERIOD_SET%)

*IS ZXXXXX

*REC(FACTOR = 1,GCR_GRP_ACCNT_ID = ZXXXXX,FISC_PERIOD = %FISC_PERIOD_SET%)

*ENDWHEN

*LOOKUP OWNERSHIP

*DIM P_INC:FISC_PERIOD = %FISC_PERIOD_SET%

*DIM P_INC:O_ACCOUNT = PINC_NET

*DIM P_INC:TRD_PTR_CODE = ThirdParty

*FOR %A_COMP% = %COMPALL%

*DIM PNET_%A_COMP%:COMPANY_CODE = %A_COMP%

*NEXT

*ENDLOOKUP

*WHEN GRP_ACCNT_ID

*IS XXXXX

*REC(EXPRESSION = %VALUE%*LOOKUP(P_INC)+[GRP_ACCNT_ID].[ZXXXXX],GRP_ACCNT_ID = ZXXXXX,FISC_PERIOD = %FISC_PERIOD_SET%)

*IS YYYYY

*REC(EXPRESSION = %VALUE%*LOOKUP(PNET_INC)+[GRP_ACCNT_ID].[ZYYYYY],GRP_ACCNT_ID = ZXXXXX,FISC_PERIOD = %FISC_PERIOD_SET%)

*ENDWHEN

Thanks,

HKJ