on 05-25-2018 12:10 PM
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
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.