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

Is it possible to use BPC Script REC commands to add values instead of posting deltas?

former_member201314
Participant
0 Likes
1,611

Hi guys,

in my current BPC Script Logic I am using REC(EXPRESSION...) commands in order to calculate new records to be posted in the database (i.e. planning model).

Apparently, the result of the calculation is then treated as the new target value triggering a delta posting in order to match the value.

Example:

1000 EUR are already existing on a particular account 500000. (the request ist open)

The script logic then calculates another 400 EUR to be posted additionally to the account 500000.

Now: Instead of adding the 400 EUR, the system posts a delta of -600 EUR in order to meet the 400 EUR. This of course is as per design as long as all records (1000 EUR and 400 EUR) reside in the same open request.

Question:

I suppose closing the open request is potentially the only way to handle this. However, is there any other solution approach that would allow to end up with 1,400 EUR on the account 500000 without the need to close the request? (Different REC statement?)

Thanks for your thoughts...

Kind Regards

Claus

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member201314
Participant
0 Likes

Hi Vadim,

Thanks for your valuable thoughts!

Let me try to explain what I am trying to achieve:

Say, we have two logic files:

The first one is supposed to calculate 10% of the net revenue account (100,000 EUR) and post the calculated amount of 10,000 EUR to the cash account.

The logic closes with the commit statement.

The second logic, being processed right afterwards (e.g. via data package link) should calculate 20% of another revenue account (20,000 EUR) and should post the calculated amount of 4,000 EUR against the same cash account, basically adding the 4,000 EUR on top of the already existing 10,000 EUR of the first logic.

The second logic also ends with the commit statement.

Desired outcome: cash account = 14,000 EUR (10,000 EUR + 4,000 EUR).

Current outcome: cash account = 4,000 EUR (10,000 EUR + (-6,000 EUR)).

Is there a possibility to achieve the desired outcome and avoid the current outcome?

Cheers

Claus

former_member201314
Participant
0 Likes

Ok - important to mention.

Both records, calculated by logic 1 and logic 2, consist of the same granularity! The source account does not form part of the granularity of the target record to be posted against the cash account.

former_member186338
Active Contributor
0 Likes

Sorry, have to repeat the third time - ABSOLUTELY unclear!

Use simple test script and read: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

"The first one is supposed to calculate 10% of the net revenue account (100,000 EUR) and post the calculated amount of 10,000 EUR to the cash account." - no script provided, no data sample, nothing!

"The logic closes with the commit statement." - commit is absolutely useless statement in BPC NW

"The second logic, being processed right afterwards (e.g. via data package link) should calculate 20% of another revenue account (20,000 EUR) and should post the calculated amount of 4,000 EUR against the same cash account, basically adding the 4,000 EUR on top of the already existing 10,000 EUR of the first logic." - no script provided, no data sample, nothing!

I have explained you already 2 times that if you want to ADD - you have to use script like in my previous answers!

"The second logic also ends with the commit statement." - also useless!

Sorry, but what is not clear??

P.S. "Both records, calculated by logic 1 and logic 2, consist of the same granularity! The source account does not form part of the granularity of the target record to be posted against the cash account." - absolutely unclear statement! Try to read it yourself...

former_member186338
Active Contributor
0 Likes

Sorry, your description is not clear!

Sample:

Account A1=1000

Account A2=400

And we want to have in A1 = A1 (prev value=1000) + A2(400)=1400

*XDIM_MEMBERSET ACCOUNT=A1 //scope only single account
*WHEN ACCOUNT
*IS * //A1 as scoped
*REC(EXPRESSION=%VALUE%+[ACCOUNT].[A2]) //1000+400=1400
*ENDWHEN

The issue is that in this case if there is no record in A1 the script will not work

Or we can do the same in different way with same result, but no issues with missing record:

*XDIM_MEMBERSET ACCOUNT=A1,A2 //scope both accounts
*WHEN ACCOUNT
*IS * //A1 and A2 as scoped
*REC(EXPRESSION=%VALUE%,A1) //1000 and 400 will be aggregated to 1400 to be written to A1
*ENDWHEN

Hope it's clear

gcybill
Active Participant
0 Likes

There are many alternative solutions, one of them is to utilize 2 Audit Trails, e.g.: Input & Calc

Assuming Calc contains 1000 EUR

Assuming Input will be filled with 400 EUR by another calculation

*XDIM_MEMBERSET ACCOUNT=500000

*WHEN AUDITTRAIL

*IS Input, Calc

*REC(FACTOR=1,AUDITTRAIL=Calc)

*ENDWHEN

then Calc will get incrementally accumulated in the report.

former_member186338
Active Contributor

The question author didn't explained "The script logic then calculates another 400 EUR"

It may come from other accounts etc... then you don't need different audittrails!

former_member186338
Active Contributor
0 Likes

Not 100% clear what do you want, but:

*REC(EXPRESSION=%VALUE%+400)

will result in 1000+400=1400

and open/closed request is not related to the subject.

former_member201314
Participant
0 Likes

Hi Vadim,

basically, what I am trying to achieve is that the result of a REC statement will be added to what's already on the account.

Let's assume the first script logic posts + 1000 EUR to the cash account, based on %value% of an existing source record. (e.g. 10% of 10,000 EUR)

Then, the second script logic should post another + 400 EUR to the same cash account, but based on a different %value% of a another existing source record. (e.g. 20% of 2,000 EUR)

Currently - since ist's the same cash account - the system will post the delta between +1000 and +400 = - 600 EUR in order to end up with the + 400 EUR of the second REC calculation.

Hence my question: Is there a way that will allow to post +1000 EUR of the first script logic and +400 EUR of the second script logic, which would then end up wit the correct amount of + 1400 EUR.

Kind Regards

Claus