cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member433506
Discoverer
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member186338
Active Contributor
0 Kudos

Concatenating properties like C_PROFITCENTER = %PCVAR1%%ENTVAR2% is a bad idea in general due to use of FOR/NEXT.

Please explain business requirements (not your script) and may be I will show you some better solution! Provide data sample and required results!

former_member433506
Discoverer
0 Kudos

Bonus question to add:

How can I do the equivalent to a <> when comparing dynamic properties like this and have it fit in my logic above? I will need it to do the other scenarios for same-diff, diff-same and diff-diff.

This doesn't work because it only accepts "=" when comparing dynamic properties:

*FOR %PCVAR1% = %PC_VAR1% AND %ENTVAR2% = %ENT_VAR2% //AND %ENTCROSS% = CROSSREG_ELIM

//same-same

*WHEN C_PROFITCENTER.VAR1

*IS = C_INTERCO.VAR1

*WHEN C_ENTITY.VAR2

*IS = C_INTERCO.VAR2

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

*ENDWHEN

//same-cross

*WHEN C_ENTITY.VAR2

*IS <> C_INTERCO.VAR2

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

*ENDWHEN


*ENDWHEN

*NEXT