Skip to Content
0

BPC script Not working after Migrating SAP BPC 10.0 BW 7.3 to BPC 10.1/BW 7.5

Aug 28, 2017 at 10:14 PM

83

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

avatar image
Former Member Aug 28, 2017 at 10:20 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 28, 2017 at 10:26 PM
0

When we merge all the code in subroutine 1 and subroutine 2 into 1 subroutine, it's working fine.

Share
10 |10000 characters needed characters left characters exceeded
Charlie Lin
Aug 29, 2017 at 01:49 AM
0

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?

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi

No validation error. I just pasted the script below. Please if you can take a look as well, it will be very helpful as well.

Thanks guys !!

0
Vadim Kalinin Aug 29, 2017 at 04:40 PM
0

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.

Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

0

SUBS without parameters are useless!

Just INCLUDE the code you have in SUB

0
Former Member

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

0

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?

0
Vadim Kalinin Aug 29, 2017 at 06:13 AM
0

Sorry, but without full script text it's not possible to discuss the issue.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0
Charlie Lin
Sep 05, 2017 at 12:54 AM
0

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

With [LEVEL]='MONTH' no reason to add CALC=N

0