cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Script Logic using user parameters/dynamic value ( BPC NW 7.5 SP18)

Former Member
0 Kudos
1,029

Hi, We are upgrading to BPC 7.5 Netweaver SP18 from BPC NW 7.5 SP14. This line in script logic works completely fine in our production SP14 instance, but it doesn't work in SP18 version. Is there a different way I can code this line to make it working?

*XDIM_FILTER CMRAW=[CMRAW].PROPERTIES("BUYER")=$BUYERCODE$

$BUYERCODE$ receives its value from what user entered on the pop-up screen while trying to run the job.

Here is what we have in the ADVANCED section of package to pass the value

TASK(Z_BPC_SC_CALC_LOGIC,REPLACEPARAM,BUYERCODE%EQU%%BUYERCODE%%TAB%FISYR%EQU%%FISYR%) Full logic in script:

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Here is the full logic in ADVANCED section of PACKAGE: PROMPT(TEXT,%BUYERCODE%,"YOU MUST Enter a Single Buyer Code (ex: GA)") PROMPT(TEXT,%FISYR%,"YOU MUST Enter a Fiscal Year (ex: 2011)") INFO(%EQU%,=) INFO(%TAB%,;) TASK(Z_BPC_SC_CALC_LOGIC,SUSER,%USER%) TASK(Z_BPC_SC_CALC_LOGIC,SAPPSET,%APPSET%) TASK(Z_BPC_SC_CALC_LOGIC,SAPP,%APP%) TASK(Z_BPC_SC_CALC_LOGIC,LOGICFILENAME,BUYER_ALLOC_REQ_QTY.LGF) TASK(Z_BPC_SC_CALC_LOGIC,REPLACEPARAM,BUYERCODE%EQU%%BUYERCODE%%TAB%FISYR%EQU%%FISYR%) Here is the full logic in script logic:

Former Member
0 Kudos

*XDIM_MEMBERSET CURRENCY=LOCAL *XDIM_MEMBERSET CMDATASRC=DS_BW *XDIM_MEMBERSET CMACCT=A_VOLUME *XDIM_MEMBERSET CMVENDOR=V_99 *XDIM_MEMBERSET FIN<>F_99 *XDIM_MEMBERSET PRDCNG_COPLANT=P_NONE *XDIM_MEMBERSET VERSIONBASE=MASTER *XDIM_FILTER TIME=[TIME].PROPERTIES("YEAR")=$FISYR$ *XDIM_FILTER CMRAW=[CMRAW].PROPERTIES("BUYER")=$BUYERCODE$ *RUNALLOCATION *FACTOR=0 *DIM CMACCT WHAT=A_VOLUME; WHERE=<<< *ENDALLOCATION

former_member186338
Active Contributor
0 Kudos

Try:

*XDIM_FILTER CMRAW=[CMRAW].PROPERTIES("BUYER")="$BUYERCODE$"

With quoted $BUYERCODE$!

Vadim

P.S. Is it possible to post messages in the readable format?

Former Member
0 Kudos

Thanks Vadim.... Yes, I was trying to post the message in a much readable format but the browser and webpage has been acting hard this morning and before I hit submit, it posted the message....sorry for the inconvenience.

former_member186338
Active Contributor
0 Kudos

And please, correct your advanced script in line with my post:

Instead of:

TASK(Z_BPC_SC_CALC_LOGIC,...

Use standard:

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,...

with the following lines:

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,TAB,%TAB%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,EQU,%EQU%)

Vadim

Former Member
0 Kudos

Hi Vadim, I corrected the script logic and also changed to standard, but it still is not working. Any other thoughts?

former_member186338
Active Contributor
0 Kudos

Sorry, but:

1. Can you show the corrected advanced DM script?

2. Have you tested the script logic in UJKT () - can you post a sceenshot?

Simply "not working" is meaningless...

Vadim

Former Member
0 Kudos

Hi Vadim, Please find attached the UJKT results attached here.

We have two script logics:

(1) runs full allocation based on the YEAR...so user enters year and that is fed into $YEAR$

(2) We have a job that does allocation for a specific buyer - so user enters $YEAR$ and $BUYERCODE$ - so this does allocation for that buyer only in that year.

Both scripts have exactly the same logic, except one has an additional variable for $BUYERCODE$. The first script runs just fine. we are having issues with second script. My BASIS team has moved the standard process chains to a different folder in RSA1 and hence I am unable to run the package when I change the DM Script to what you had provided. So, I switched back to the custom Z_BPC_SC....... Interestingly, these both script logics are running fine in SP14 production environment but not in SP18 test environment.

Note - I know there is a lot of ancient code in these scripts and there might be better way to do lot of things, but currently it is working in production so based on the amount of time I have before go-live I am trying to focus on fixing the issue and not re-designing the code ( which I plan to do later).

DM Script (Advanced): PROMPT(TEXT,%BUYERCODE%,"YOU MUST Enter a Single Buyer Code (ex: GA)") PROMPT(TEXT,%FISYR%,"YOU MUST Enter a Fiscal Year (ex: 2011)") INFO(%EQU%,=) INFO(%TAB%,;) TASK(Z_BPC_SC_CALC_LOGIC,SUSER,%USER%) TASK(Z_BPC_SC_CALC_LOGIC,SAPPSET,%APPSET%) TASK(Z_BPC_SC_CALC_LOGIC,SAPP,%APP%) TASK(Z_BPC_SC_CALC_LOGIC,LOGICFILENAME,BUYER_ALLOC_REQ_QTY.LGF) TASK(Z_BPC_SC_CALC_LOGIC,REPLACEPARAM,BUYERCODE%EQU%%BUYERCODE%) TASK(Z_BPC_SC_CALC_LOGIC,REPLACEPARAM,FISYR%EQU%%FISYR%)

former_member186338
Active Contributor
0 Kudos

Sorry, but "My BASIS team has moved the standard process chains to a different folder in RSA1 and hence I am unable to run the package when I change the DM Script to what you had provided." - can't help with a broken system! Please, repair!

And the mentioned lines:

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,TAB,%TAB%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,EQU,%EQU%)

are NOT optional!

Vadim

P.S. In general, the script logic code is very old and some parts can create issues with the  latest SP's... It's highly recommended to rewrite it - not a huge job!

Former Member
0 Kudos

Hi Vadim,

I created a test package called ISTEST.LGF which has the same logic as my sript_2.lgf except that I Have hardcoded the buyer code to see if that works.

I also used the standard process chain you specified and created a new package to run this test script via the standard process chain. It ran fin this time, but it did not move the data. Please see the DM Script (Advanced) here:

PROMPT(SELECTINPUT,,,,"%CATEGORY_DIM%,%CURRENCY_DIM%,%TIME_DIM%")

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPPSET,%APPSET%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPP,%APP%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SELECTION,%SELECTION%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,ISTEST.LGF)

Also attached is the script logic in ISTEST.LGF

What other parts in the logic you think need to be absolutely changed?

Former Member
0 Kudos

the data is not moving to my destination app that is what I mean when I say it is not working

former_member186338
Active Contributor
0 Kudos

Advanced script is incorrect! You have to use (already posted!!!!):

PROMPT(TEXT,%BUYERCODE%,"YOU MUST Enter a Single Buyer Code (ex: GA)")

PROMPT(TEXT,%FISYR%,"YOU MUST Enter a Fiscal Year (ex: 2011)")

INFO(%EQU%,=)

INFO(%TAB%,;)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPPSET,%APPSET%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPP,%APP%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,TAB,%TAB%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,EQU,%EQU%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,BUYER_ALLOC_REQ_QTY.LGF)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM,BUYERCODE%EQU%%BUYERCODE%%TAB%FISYR%EQU%%FISYR%)

then you don't need to hardcode values!

Second:

And what is working? Allocation? Copy to first Destination???? Etc...

You script logic code performs multiple calculations in the sequence....

Vadim

Former Member
0 Kudos

I tried the exact same DM Script logic that you gave:

PROMPT(TEXT,%BUYERCODE%,"YOU MUST Enter a Single Buyer Code (ex: GA)")

PROMPT(TEXT,%FISYR%,"YOU MUST Enter a Fiscal Year (ex: 2011)")

INFO(%EQU%,=)

INFO(%TAB%,;)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPPSET,%APPSET%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPP,%APP%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,TAB,%TAB%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,EQU,%EQU%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,BUYER_ALLOC_REQ_QTY.LGF)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM,BUYERCODE%EQU%%BUYERCODE%%TAB%FISYR%EQU%%FISYR%)

Also, used "$BUYERCODE$" - quotes in the logic

And everything else works except the BAPI to actually move the data to a different application (COSTMODEL)

This is my problem logic(see in bold below), it is trying to add a dimension and move the data to that application.

*XDIM_MEMBERSET CURRENCY=LOCAL

*XDIM_MEMBERSET CMACCT=A_VOLUME

*XDIM_MEMBERSET CMDATASRC=DS_BW,DS_MANOVERRIDE

*XDIM_MEMBERSET CMDRIVER=D_NONE

*XDIM_MEMBERSET PRDCNG_COPLANT=P_NONE

*XDIM_MEMBERSET FIN=F_99

*XDIM_MEMBERSET VERSIONBASE=MASTER

*XDIM_MEMBERSET CMVENDOR=BAS(V_DETAILVENDORS)

*XDIM_FILTER TIME=[TIME].PROPERTIES("YEAR")="$FISYR$"

*XDIM_FILTER CMRAW=[CMRAW].PROPERTIES("BUYER")="$BUYERCODE$"

*START_BADI DAPP

DESTINATION_APP="COSTMODEL"

   WRITE=OFF

   ADD_DIM="CMDATASRC=DS_BW"

*END_BADI

*XDIM_MEMBERSET CURRENCY=LOCAL

*XDIM_MEMBERSET CMACCT=A_VOLUME

*XDIM_MEMBERSET CMDATASRC=DS_BW,DS_MANOVERRIDE

*XDIM_MEMBERSET CMDRIVER=D_NONE

*XDIM_MEMBERSET PRDCNG_COPLANT=P_NONE

*XDIM_MEMBERSET FIN=F_99

*XDIM_MEMBERSET VERSIONBASE=MASTER

*XDIM_FILTER TIME=[TIME].PROPERTIES("YEAR")="$FISYR$"

*XDIM_FILTER CMRAW=[CMRAW].PROPERTIES("BUYER")="$BUYERCODE$"

*START_BADI DAPP

DESTINATION_APP="COSTMODEL"

   WRITE=OFF

  ADD_DIM="CMDATASRC=DS_BW","CMVENDOR=V_99"

*END_BADI

Former Member
0 Kudos

COPY to destination - NOT WORKING Allocation of data within the same application - WORKING

former_member186338
Active Contributor
0 Kudos

I know what is DAPP badi - it's the VERY old 7.0 badi to write data to another application. In BPC 7.5 you have to use standard supported operator *DESTINATION_APP instead of this unsupported badi. Rewrite script with *DESTINATION_APP.

If you really want to understand what's wrong with DAPP - use ABAP debug of this badi execution

Vadim

P.S. I really see no evidence that "This is my problem logic(see in bold below), it is trying to add a dimension and move the data to that application." - the code is not working! No log, nothing to discuss!

former_member186338
Active Contributor
0 Kudos

P.S. In your UJKT test this badi was working!

former_member186338
Active Contributor
0 Kudos

And I prefer to use SELECT (instead of *XDIM_FILTER) like:

*SELECT(%FM%,[ID],TIME,"[YEAR]=$FISYR$")

*SELECT(%BC%,[ID],CMRAW,"[BUYER]=$BUYERCODE$")

*XDIM_MEMBERSET TIME=%FM%

*XDIM_MEMBERSET CMRAW=%BC%

*XDIM_MEMBERSET CURRENCY=LOCAL

*XDIM_MEMBERSET CMACCT=A_VOLUME

*XDIM_MEMBERSET CMDATASRC=DS_BW,DS_MANOVERRIDE

*XDIM_MEMBERSET CMDRIVER=D_NONE

*XDIM_MEMBERSET PRDCNG_COPLANT=P_NONE

*XDIM_MEMBERSET FIN=F_99

*XDIM_MEMBERSET VERSIONBASE=MASTER

*XDIM_MEMBERSET CMVENDOR=BAS(V_DETAILVENDORS)

*DESTINATION_APP = COSTMODEL

*WHEN TIME //any dimension can be used

*IS * //already scoped

*REC(EXPRESSION=%VALUE%,CMDATASRC=DS_BW)

*ENDWHEN

Result:

Values for CMDATASRC=DS_BW,DS_MANOVERRIDE will be written (with accumulation) to DS_BW in COSTMODEL

Assumption - current model and COSTMODEL use the same set of dimensions!

Vadim

Former Member
0 Kudos

Thanks Vadim...one quick question -

Is there a better/different way to write this statement? ( in bold)

*RUNALLOCATION

*FACTOR=1

*DIM CMDATASRC WHAT=DS_BW; WHERE=DS_BW,DS_MANOVERRIDE,DS_NEGOVERRIDE,DS_AUTOOVERRIDE

*DIM PRDCNG_COPLANT WHAT<>P_NONE; WHERE=P_NONE

*ENDALLOCATION

I am trying to sum all the data in those data sources and move it back to DS_BW. As I test more examples, it seems that is not working as expected.

Can I break it down to multiple or any other syntax?

former_member186338
Active Contributor
0 Kudos

The logic of this allocation is strange:

It will copy the value in DS_BW to DS_BW,DS_MANOVERRIDE,DS_NEGOVERRIDE,DS_AUTOOVERRIDE

why to DS_BW?

And will sum PRDCNG_COPLANT members <>P_NONE to P_NONE

I do not know what do you mean by "as expected"???

Please spend some time with easy samples to understand how allocation works...

Vadim

Former Member
0 Kudos

It is not copying the values from DS_BW,DS_MANOVERRIDE,DS_NEGOVERRIDE,DS_AUTOOVERIDE to DS_BW, which is why the problem is occuring. Which is why I asked you if there was an alternate way to do the same thing by using a different syntax. I have not developed this code and supporting the code that was written 5-6 years ago.

former_member186338
Active Contributor
0 Kudos

Then test this part of the code on some small data set in UJKT and post the results!