Skip to Content

Script logic with multiple REC statements

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on May 15 at 07:28 AM

    "is overwritten by last REC statement as 0." - incorrect idea!

    Inside single WHEN/ENDWHEN multiple records to the same target are aggregated and not overwritten. And you have the same target based on your script:

     *REC(EXPRESSION = ...,GRP_ACCNT_ID = ZXXXXX,FISC_PERIOD = %FISC_PERIOD_SET%)
    
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.