Skip to Content
avatar image
Former Member

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

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

capture.jpg (33.7 kB)
capture.jpg (23.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Jan 23 at 03:16 PM

    "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!

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

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

      Thank you Vadim !

  • Jan 23 at 02:50 PM

    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/

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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" !

  • Jan 23 at 03:04 PM

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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

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

  • avatar image
    Former Member
    Jan 23 at 03:12 PM

    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
    Add comment
    10|10000 characters needed characters exceeded