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

BPC NW 10.1 (BW 7.5 SP05) : logic script with hierarchy node

Former Member
0 Likes
781

Hello BPC expert,

I have a rather simple query that would need the use of logic script.

The logic script must do a multiplication between an account and a hierarchy and the result of this multiplication can be stored in another account.

Let us take an example :

- I have an account called "TAX_RATE" and an hierarchy account called "PBIT". TAX_RATE is completed through input form. Hierarchy accounts have input data and journals data.

- PBIT has other hierarchy nodes below and of course base level accounts (such as P701000, P701020).

- Destination account can be called "RESULT".

- taxe rate is 0,20. PBIT has a total of 100,00€ where P701000 is 60,00€ and P701020 is 40,00€. RESULT would simply be 20,00€.

I have researched on forums regarding this matter and found some blogs such as "BPC script for dummies" but couldn't find answers to multiply with a node member.

I therefore tried an alternative by creating a property "GROUP" where I fill "PBIT" for every account that needs to be multiplied.

Here is the script (in DEFAULT.LGF) I wrote :

*SELECT(%PBIT%,ID,ACCOUNT,[GROUP]="PBIT")
*WHEN ACCOUNT
*IS TAXRATE
*REC(EXPRESSION=%VALUE%*[ACCOUNT].[%PBIT%],ACCOUNT=T_EXP)
*ENDWHEN


Each time I save a figure on TAX_RATE through input form, I got the following error message :

System does not recognize an account that does exist in the dimension.

What can I do to multiply a simple base level member with an hierarchy ?

Thank you in advance for your help,

Dat

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Likes

"I would like the calculation to be run only when TAX_RATE is updated through input form."

OK:

*WHEN ACCOUNT
*IS TAXRATE
*REC(EXPRESSION=%VALUE%*[ACCOUNT].[PBIT],ACCOUNT=T_EXP)
*ENDWHEN

Assuming you have account PBIT

What's the issue? Parent member can be used in logic expression!

Former Member
0 Likes

Oh... I thought that parent member cannot be included in logic script for sure... Bad assumption.

Thank you Vadim !

Answers (3)

Answers (3)

Former Member
0 Likes

Just noticed my logic script had wrong input with what I have explained in the first post.

*SELECT(%PBIT%,ID,ACCOUNT,[GROUP]="PBIT")
*WHEN ACCOUNT
*IS TAX_RATE
*REC(EXPRESSION=%VALUE%*[ACCOUNT].[%PBIT%],ACCOUNT=RESULT)
*ENDWHEN
former_member186338
Active Contributor
0 Likes

Why do you use property if you have parent account PBIT???

former_member186338
Active Contributor
0 Likes

Please DON'T edit original question! Hard to find changes! Please answer my questions in comment!

Former Member
0 Likes

Apologies, I just forgot to be polite in the end of my topic, I did not change the content otherwise.

former_member186338
Active Contributor
0 Likes

If you are talking about default.lgf then when do you want the calculation to run?

On any data save to base member under parent PBIT?

And on any change of TAX_RATE?

Have you read my blog: https://blogs.sap.com/2014/06/09/how-to-write-defaultlgf/

Former Member
0 Likes

Hello Vadim,

I would like the calculation to be run only when TAX_RATE is updated through input form.

I do not need this calculation when data are loaded into PBIT base level members or from journals.

I am currently reading your blog. I should have googled "default.lgf" instead of "logic script" !