Skip to Content
0
May 25, 2018 at 11:10 AM

BPC Script Logic - post results to PC based on concatenated properties

161 Views Last edit May 25, 2018 at 11:25 AM 2 rev

Hello BPC Experts,

I need a script that will compare properties for PC and INTCO and then Entity and INTCO then if equal post results via the *REC statement by concatenating two of the properties (PC/ENTITY) to derive the profit center elim member to post to. If not equal it will post to a fixed PC Elim. I've created properties in each these dimensions so that they can be compared and when combined creates the ELIM PC. I have a few other scenarios that need to be included as well - total of four (same-same, same-diff, diff-same, diff,diff). Here is a copy of the code for same-same and same-diff I have so far, which kinda works if I comment out the same-diff portion, but it creates too many records - 4 records instead of 1. The loop appears to be over doing it. We don't have a BADI option right now, so I'm stuck with the standard script logic. Any suggestions are greatly appreciated!. See system config info below.

//PC ELIM - PART 1

*SELECT (%PC_SEL%, ID, C_PROFITCENTER, VAR1 <>"")

*SELECT (%ENT_SEL%, ID, C_ENTITY, VAR2 <>"")

*SELECT (%PC_VAR1%, VAR1, C_PROFITCENTER, ID = %PC_SEL%)

*SELECT (%ENT_VAR2%, VAR2, C_ENTITY, ID = %ENT_SEL%)

*XDIM_MEMBERSET C_AUDITTRAIL = AT_INPUT

*XDIM_MEMBERSET C_ENTITY = %ENT_SEL%

*XDIM_MEMBERSET C_PROFITCENTER = %PC_SEL%

*FOR %PCVAR1% = %PC_VAR1% AND %ENTVAR2% = %ENT_VAR2%

*WHEN C_PROFITCENTER.VAR1 //same-same - this portion works but too many records

*IS = C_INTERCO.VAR1

*WHEN C_ENTITY.VAR2 //same-same

*IS = C_INTERCO.VAR2

*REC(EXPRESSION = %VALUE%,C_PROFITCENTER = %PCVAR1%%ENTVAR2%,C_AUDITTRAIL = AT_PCELIMCALC)

//*IS * // same-diff - but it doesnt work and nothing happens at all when included

//*REC(EXPRESSION = %VALUE%,C_PROFITCENTER = %PCVAR1%CROSSREG_ELIM,C_AUDITTRAIL = AT_PCELIMCALC)

*ENDWHEN

*ENDWHEN

*NEXT

System Configuration:

- BPC 10.1 NW on HANA sp 8

- Standard - SAP BW 7.4 sp13