on 08-28-2017 11:14 PM
Hello
We are having an issue with default logic scripts after migrating from SAP BPC 10.0 on BW 7.3 to BPC 10.1 on BW 7.5 SP6.
The issue seems to be that when we have a variable being defined in sub 1 and being referenced in sub 2, it cannot recognize the variable at all.
Our code is something like below:
DEFAULT.LGF
SUB1 (Fills up variable %V_TIME%)
SUB2 (References variable %V_TIME%).
The statement in SUB2 that references variable %V_TIME% error's out. Do we have to change anything on the scripts as part of the migration to BPC 10.1? All the data saves are happening properly?
Thanks for your help.
Bhavin, can you add a CALC=N in *SELECT(%TIMEPER%,"[ID]",TIME,"[TIMEID]>= %STIME% AND [TIMEID]<= %ETIME% AND [LEVEL]='MONTH'"). Just would like to narrow down if parent members are retrieved by the select.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use SELECT statements outside of *SUB - at the beginning of SUB_HEADCOUNT.LGF
In general there is no reason to use includes and functions/subs. Use plain code for default.lgf without includes and subs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for looking into this. If I take all the code out in the sub out and put in default.LGF this works but only if %CCTR_SET% and %EMPID_SET% have values. If I leave them to <all> in the prompt box it throws an error with value RUN_LOGIC:Line No:21; Allocation Format Error. Is it thinking that it's mandatory to input a value?
We have all these subs so that they can be reused in other scripts.
Sure. That's what I did (code below). The issue now I have is if I don't explicitly set anything in the CCTR and EMPID dimension prompt, it throws an error. Not sure why it doesn't want to accept <all>. Any idea?
I tried removing the V_CCTR and V_EMPID and directly referencing %CCTR_SET% and %EMPID_SET% in the run allocation but that doesn't work either.
*FUNCTION V_CCTR=%CCTR_SET%
*FUNCTION V_EMPID=%EMPID_SET%
*SELECT(%SPER%,"[SPER]",SCENARIO,"[ID] = %SCENARIO_SET%")
*SELECT(%EPER%,"[EPER]",SCENARIO,"[ID] = %SCENARIO_SET%")
*SELECT(%STIME%,"[TIMEID]",TIME,"[ID] = %SPER%")
*SELECT(%ETIME%,"[TIMEID]",TIME,"[ID] = %EPER%")
*SELECT(%TIMEPER%,"[ID]",TIME,"[TIMEID]>= %STIME% AND [TIMEID]<= %ETIME% AND [LEVEL]='MONTH'")
*RUNALLOCATION *FACTOR = 0
*DIM ACCOUNT WHAT=A900100,A900600,A900900,A900800; WHERE=<<<
*DIM CCTR WHAT=V_CCTR; WHERE=<<<
*DIM COMPANY WHAT=BAS(ALCO); WHERE=<<<
*DIM DATASRC WHAT=GAAP; WHERE=<<<
*DIM FAREA WHAT=BAS(ALFA); WHERE=<<<
*DIM EMPID WHAT=V_EMPID; WHERE=<<<
*DIM PCTR WHAT=BAS(ALPC); WHERE=<<<
*DIM TIME WHAT=%TIMEPER%; WHERE=<<<
*DIM RPTCURRENCY WHAT=USD; WHERE=<<<
*DIM SCENARIO WHAT=WFCST; WHERE=<<<
*ENDALLOCATION
The logic of this script is strange in general:
For any data saved in the model perform clear for some months for some accounts. What is the idea???
Also, if you simultaneously save data for 2 or more categories - the script will do strange things...
May be it's better to start with business requirements and then create a correct script?
Sorry, but without full script text it's not possible to discuss the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
No there is no validation error. Validation is successful.
Here is the script for your reference:
DEFAULT.LGF
*INCLUDE RT_HC_SELECT
*INCLUDE SUB_HEADCOUNT
PLAN_PERIODS_SELECT
INIT_DELETE
RT_HC_SELECT.LGF
*FUNCTION V_CCTR=%CCTR_SET%
*FUNCTION V_EMPID=%EMPID_SET%
SUB_HEADCOUNT.LGF
*SUB PLAN_PERIODS_SELECT
*SELECT(%SPER%,"[SPER]",SCENARIO,"[ID] = %SCENARIO_SET%")
*SELECT(%EPER%,"[EPER]",SCENARIO,"[ID] = %SCENARIO_SET%")
*SELECT(%STIME%,"[TIMEID]",TIME,"[ID] = %SPER%")
*SELECT(%ETIME%,"[TIMEID]",TIME,"[ID] = %EPER%")
*SELECT(%TIMEPER%,"[ID]",TIME,"[TIMEID]>= %STIME% AND [TIMEID]<= %ETIME% AND [LEVEL]='MONTH'")
*ENDSUB
*SUB INIT_DELETE
*RUNALLOCATION *FACTOR = 0
*DIM ACCOUNT WHAT=A900100,A900600,A900900,A900800; WHERE=<<<
*DIM CCTR WHAT=V_CCTR; WHERE=<<<
*DIM COMPANY WHAT=BAS(ALCO); WHERE=<<<
*DIM DATASRC WHAT=GAAP; WHERE=<<<
*DIM FAREA WHAT=BAS(ALFA); WHERE=<<<
*DIM EMPID WHAT=V_EMPID; WHERE=<<<
*DIM PCTR WHAT=BAS(ALPC); WHERE=<<<
*DIM RPTCURRENCY WHAT=USD; WHERE=<<<
*DIM SCENARIO WHAT=%SCENARIO_SET%; WHERE=<<<
*DIM TIME WHAT=%TIMEPER%; WHERE=<<<
*ENDALLOCATION
*ENDSUB
Error message after running the script
RUN_LOGIC:Line No:7; Allocation Format Error model: Headcount. Package status: ERROR
The issue is that it cannot pass the parameter (%TIMEPER%) from SUB PLAN_PERIODS_SELECT to SUB INIT_DELETE. If we hardcode the value on TIMEPER in SUB INIT_DELETE it works. If we copy all the code from SUB PLAN_PERIODS_SELECT to SUB INIT_DELETE it works too.
Appreciate you guys looking into this.
Bhavin
If it was working in BPC 10.0 and not working now in BPC 10.1, it should be a bug. Is there any validation error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When we merge all the code in subroutine 1 and subroutine 2 into 1 subroutine, it's working fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just wanted to add that all these scripts are running fine today in our BPC 100 environment. Also, our new BW 7.5 system is now running on HANA 2.0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
3 | |
2 | |
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.