cancel
Showing results for 
Search instead for 
Did you mean: 

Time Dependent Hierarchies and Eliminations

karwen
Explorer
0 Kudos

Dear experts,

we are facing an issue with time dependent hierarchies in eliminations. I have included the KEYDATE in the DM package to give users the opportunity to choose the hierarchy version for the IC elimination. I also adjusted the related process chain for the KEYDATE to be considered. This step is working correctly and the KEYDATE will be passed. Result line from DM package:

SELECTION_KEYDATE = 20190101

Nevertheless, the called script logic which executes the elimination program US_ELIM does not consider the KEYDATE at all. It always uses the current system date as KEYDATE. I found a SAP note (2254535) which says that the KEYDATE must be included into the script logic to be considered. It also says that the script logic expects the KEYDATE in the format:

KEYDATE = YYYYMMDD

So I entered the following code into the script logic:

*RUN_PROGRAM US_ELIM
CATEGORY = %CATEGORY_SET%
CURRENCY = EUR,CHF
TID_RA = %TIME_SET%
OTHER = [PRCTR=%PRCTR_SET%]
KEYDATE = 20190101
*ENDRUN_PROGRAM

The program above runs as expected and does the correct elimination.

The problem is that I can't make the KEYDATE dynamic in the script logic like:

KEYDATE = %KEYDATE%

As soon as I do this, the system ignores the KEYDATE set and uses the current KEYDATE instead. This is understandable regarding the SAP note with the expected format of the KEYDATE. But I need to make the KEYDATE dynamic in the script logic in order to enable users to set it in the DM package.

Does anyone of you guys have had such an issue and knows how to solve it?

Thank you in advance,

Karsten

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

If this script is working correctly:

*RUN_PROGRAM US_ELIM
CATEGORY =%CATEGORY_SET%
CURRENCY= EUR,CHF
TID_RA =%TIME_SET%
OTHER=[PRCTR=%PRCTR_SET%]
KEYDATE =20190101
*ENDRUN_PROGRAM

you can pass KeyDate using REPLACEPARAM in advanced DM script:

PROMPT(SELECT,%SELECTION%,,"Please make your selections ...","%ENTITY_DIM%,%CATEGORY_DIM%,%TIME_DIM%",0)
PROMPT(KEYDATE,%KD%,"Key date",0)
INFO(%EQU%,=)
INFO(%TAB%,;)
TASK(/CPMB/IC_ELIMINATION_LOGIC,TAB,%TAB%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,EQU,%EQU%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,REPLACEPARAM,KD%EQU%%KD%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,SUSER,%USER%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,SAPPSET,%APPSET%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,SAPP,%APP%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,SELECTION,%SELECTION%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,LOGICFILENAME,ICELIM.LGF)

Then in the script you can use $KD$ variable:

*RUN_PROGRAM US_ELIM
CATEGORY =%CATEGORY_SET%
CURRENCY= EUR,CHF
TID_RA =%TIME_SET%
OTHER=[PRCTR=%PRCTR_SET%]
KEYDATE =$KD$
*ENDRUN_PROGRAM

Unable to test (I do not have TDH enabled in my current system), but will work to my mind.

By the way, it will pass KeyDate only to US_ELIM, if you have another logic in this script you will also need TASK KEYDATE.

Answers (5)

Answers (5)

karwen
Explorer
0 Kudos

Hi Vadim,

your approach works fine - ty very much.

Interestingly, I already tried this way of implementing in the DM script, but with the standard system variable "Selection_Keydate". So my script looked like:

TASK(/CPMB/IC_ELIMINATION_LOGIC,REPLACEPARAM,KEYDATE%EQU%%SELECTION_KEYDATE%)

and afterwards, I referred in the script logic to:

KEYDATE = $SELECTION_KEYDATE$

This approach did not work at all. But, as mentioned, your approach with the custom variable %KD% works fine. Strange behaviour.

Now, I have only one issue left. With your DM script I get two prompts for the KEYDATE. Please see the screens below.

First selection mask:

Second selection mask:

Is there a way to reduce the selection to just one KEYDATE input? Another strange behaviour is, that you can't leave the KEYDATE to standard in the selection window. Once you do that, the DM package will fail since KD has not been defined.

Thank you in advance,

Karsten

former_member186338
Active Contributor
0 Kudos

"and afterwards, I referred in the script logic to:"

KEYDATE =$SELECTION_KEYDATE$

incorrect reference!

In REPLACEPARAM the variable is KEYDATE, not SELECTION_KEYDATE:

TASK(/CPMB/IC_ELIMINATION_LOGIC,REPLACEPARAM,KEYDATE%EQU%%SELECTION_KEYDATE%)

former_member186338
Active Contributor
0 Kudos

Try to remove the line:

PROMPT(KEYDATE,%KD%,"Key date",0)

And in REPLACEPARAM use:

TASK(/CPMB/IC_ELIMINATION_LOGIC,REPLACEPARAM,KD%EQU%%SELECTION_KEYDATE%)

or

TASK(/CPMB/IC_ELIMINATION_LOGIC,REPLACEPARAM,KD%EQU%%KEYDATE%)

Not sure which variable is assigned. Please test.

In script logic - no changes: $KD$

karwen
Explorer
0 Kudos

That's the right one:

TASK(/CPMB/IC_ELIMINATION_LOGIC,REPLACEPARAM,KD%EQU%%SELECTION_KEYDATE%)

Works perfectly, thank you very much 🙂

karwen
Explorer
0 Kudos

Hi Vadim,

the BPC system has recently been updated to BPC 10.1 NW SP16. I will tell you the BW release on monday since I don't have access remotly.

Thank you in advance,

Karsten

karwen
Explorer
0 Kudos

Dear all,

please find my DM script below:

PROMPT(SELECT,%SELECTION%,%KEYDATE%,"Please make your selections ...","%ENTITY_DIM%,%CATEGORY_DIM%,%TIME_DIM%",0)
INFO(%SELECTION_KEYDATE%)
INFO(%KEYDATE%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,SUSER,%USER%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,SAPPSET,%APPSET%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,SAPP,%APP%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,KEYDATE,%SELECTION_KEYDATE%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,SELECTION,%SELECTION%)
TASK(/CPMB/IC_ELIMINATION_LOGIC,LOGICFILENAME,ICELIM.LGF)

The approach works as shown in the DM log:

/CPMB/MODIFY completed in 0 seconds
/CPMB/IC_ELIMINATION_LOGIC completed in 8 seconds
/CPMB/CLEAR completed in 0 seconds

[Selection]
--------------------------------------------------------------
SELECTION = /OneMIS_HANA/Planning_DEV/PRIVATEPUBLICATIONS/WENZEL_K/TempFiles/FROM.TMP@@@SAVE@@@@@@EXPAND@@@|DIMENSION:CATEGORY|F10|DIMENSION:PRCTR||DIMENSION:TIME|
SELECTION_KEYDATE = 20190101

[Message]
--------------------------------------------------------------
model: Planning_DEV. Package status: SUCCESS

I also added the KEYDATE to the process chain /CPMB/IC_ELIMINATION.

The KEYDATE is only considered if I specify this in the script logic in the following way:

KEYDATE = 20190101

If I use the following statements, always the system date will be taken as KEYDATE independent of the setting in the DM package.

KEYDATE = %KEYDATE%

or

KEYDATE = %SELECTION_KEYDATE%

Thank you in advance,

Karsten

former_member186338
Active Contributor
0 Kudos

Can you also provide your bpc and BW version/SP?

lucas_costa3
Active Contributor
0 Kudos

2508760- What BPC Data Manager Packages should have %KEYDATE% parameter after Time Dependent Hierarchy is enabled

former_member186338
Active Contributor
0 Kudos

Please provide your advanced DM script