Skip to Content
0

BPC Flow END calculation

Dec 07, 2016 at 11:27 AM

82

avatar image

Dear Experts,

I have some problems with the END calculation after running account base calculation or consolidation.

We have the movementtype END and Hierachy for movementtypes where the flows f.e.

E10 to E60 are calculated to E70 (END).

In the default logic script I define:

//Write Movementtype's on END
*XDIM_MEMBERSET MOVEMENTTYPE=BAS(E70),D99,BAS(E90),BAS(F99),BAS(599)
//*XDIM_ADDMEMBERSET MOVEMENTTYPE=BAS(E70),D99,BAS(E90),BAS(F99),BAS(599)
*WHEN MOVEMENTTYPE
*IS*
*REC(FACTOR=1, MOVEMENTTYPE = END)
*ENDWHEN
*COMMIT

So when I save data the calculation works fine. But if I run the account base member calculation rule, it does not calculate the END flow.

For example I want calculate in the Account base member calculation the Account 1283000 Movementtype F26 -> Account 2226400 Movementtype E55

Here works the calculation to E70 fine (Herarchy) but it does not write me the value also on END. This is the problem, when I enter data on E10 it works fine and calculate to E70 and END, but after the account base calculation the END value is not right, i does not refresh the END. And I have the problem also on other flows when I run the eliminations, too.

Can someone help here. We have BPC 10.0 SP15.

Thanks and best Regards

Daniel

10 |10000 characters needed characters left characters exceeded

Please prepare the question in the readable form!

With full script code

With sample screenshot of data saved

With rules screenshots

With clear test steps

0

Here are some screens from the Rule, Script logic and a report where you can see some values or no values on end

Hope it helps to understand my problem.

logic-script-movementtype.jpg

example.jpg

account-based-calculation.jpg

Thanks

0

Why do you post links instead of pictures?

Your default.lgf is incorrect, please read https://blogs.sap.com/2014/06/09/how-to-write-defaultlgf/

You data save screenshot is not clear - what dimensions are used?

I asked to describe test steps?

0

I use the Account and Movementtype and AuditID dimension.

Testcase:

1. Step:

I enter value of 500 EUR on

Account: 2224000

AuditID: HB4

Movementtype: E25.

When I save data the default logic write me the amount of 500 to Movementtype END on the Account: 2224000.

This works fine.

2. Step:

Running of Account-based Calculations: When I run the rules (I insert it to the default logic stript) the END calculation does not work.

After running of Account-based Calculation I get the amount of -500 EUR (reverse sign in the rule) on

Account: 2224000 and

AuditID: RECLMINDIV

Momementtype: E25

but not on Movementtype: END. The sum of Movementtype E25 is 0 (HB4: 500 + RECLMINDIV: -500) but I have still on END 500. Default logic is not working here after running account-based calculation.

On the second Account of the Account-based calc rule BPC write me the amount von 500 EUR on

Account: 2240000

Movementtype: E25

AuditID: RECLMINDIV

This is ok, but not on the Movementtype END. So I have on the Account 2240000 on E25 an amount ov 500 but on the END an amount of 0.

And this ist the Problem, becuase my Movementtype E25 gives me after the Account-based Calculation on the Accounts the right amounts but not the Movementtype END.

I have this problems for many calculated accounts in Elim Rules also.

Hope my problem is a little more clear for you and you can help here.

Thanks!

0

"Running of Account-based Calculations: When I run the rules (I insert it to the default logic stript) the END calculation does not work."

Sorry, but from the very beginning I told you: "With full script code"

Without full script code this discussion is a waste of time!

0

Here is the full script code for the default script logic and also balancing and accountcalc which are included in default.

0
Show more comments

Ok, here are the codes of the scripts (hope this is so ok for you with this code format /lines)

1. DEFAULT.LGF

*INCLUDE ACCOUNTCALC.LGF
*COMMIT

*INCLUDE BALANCING.LGF
*COMMIT
//Write Movementtype's on END
*XDIM_MEMBERSET MOVEMENTTYPE=BAS(E70),D99,BAS(E90),BAS(F99),BAS(599)
//*XDIM_ADDMEMBERSET MOVEMENTTYPE=BAS(E70),D99,BAS(E90),BAS(F99),BAS(599)
*WHEN MOVEMENTTYPE
*IS*
*REC(FACTOR=1, MOVEMENTTYPE = END)
*ENDWHEN
*COMMIT

2. ACCOUNTCALC.LGF

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %ACTUALITY_SET%
CURRENCY = %RPTCURRENCY_SET%
TID_RA = %TIME_SET%
//CALC=A
OTHER = [ENTITY=%COMPANY_SET%]// or OTHER=[ENTITY=C1000] or [ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]
*ENDRUN_PROGRAM
*COMMIT

3. BALANCING.LGF

// Write P&L-result of 3849999 in Equity (2226400)
*XDIM_MEMBERSET MOVEMENTTYPE=END
//*XDIM_ADDMEMBERSET MOVEMENTTYPE=END
//*XDIM_MEMBERSET ACCOUNT=*
*XDIM_ADDMEMBERSET ACCOUNT=*
*XDIM_ADDMEMBERSET AUDITID=*
*WHEN ACCOUNT.GROUP
*IS PL
*WHEN MOVEMENTTYPE
*IS END
*WHEN AUDITID
*IS *
//*WHEN INTERCO
//*IS P999999
*REC(ACCOUNT=2226400,MOVEMENTTYPE=E40)
//*REC(ACCOUNT=2226400,MOVEMENTTYPE=END)
*ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT

// Write P&L-result of 3860000 in Equity (2240000)
*XDIM_MEMBERSET MOVEMENTTYPE=END
//*XDIM_ADDMEMBERSET MOVEMENTTYPE=END
//*XDIM_MEMBERSET ACCOUNT=*
*XDIM_ADDMEMBERSET ACCOUNT=*
*WHEN ACCOUNT.GROUP
*IS PM
*WHEN MOVEMENTTYPE
*IS END
//*WHEN INTERCO
//*IS P999999
*REC(ACCOUNT=2240000,MOVEMENTTYPE=E40)
*REC(ACCOUNT=2240000,MOVEMENTTYPE=END)
*ENDWHEN
*ENDWHEN
//*ENDWHEN
*COMMIT
0
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Vadim Kalinin Dec 08, 2016 at 12:14 PM
0

First: You are including account calculations BEFORE your script is writing END movement! How do you want it to calculate???

Second: Your scripts are not correct in general, it's a bad idea to use *XDIM_MEMBERSET in default.lgf. Looks like you didn't read https://blogs.sap.com/2014/06/09/how-to-write-defaultlgf

P.S. *COMMIT is useless with *WHEN/*ENDWHEN and *RUN_PROGRAM

A lot of other minor issues...

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

I change the default logic to :

*INCLUDE ACCOUNTCALC.LGF
*COMMIT

*INCLUDE BALANCING.LGF
*COMMIT

*WHEN MOVEMENTTYPE
*IS BAS(E70),D99,BAS(E90),BAS(F99),BAS(599)
*REC(FACTOR=1, MOVEMENTTYPE = END)
*ENDWHEN

The thing is why I include the account calculations before writing END because I would like to write END after the calculation on E25. Thats the problem. When I run the account calculation I get the value on Movementtype E25 and not on END. And with the END default logic I would have it also on END after I have it on E25. Thats why I take this order. I can change it, but then it write the Movementtype END and then run the account calculation on E25 so I will also not get the value on END or I am wrong?

Or should I punt the END writing logic then the account calculation and END writing again?

0

I change the Business rule and I get now the amount in the account-based calculationalso on END but the problem is, I get on END just the last saved amount. For example the Sum E70 hast the Movementtypes E10, E15, E40,E45. On E70 I have then the right amount but on END I get the last saved amount. So if I put on E40 an amount of 100 I have on END 100, after that I put on E45 an amount of 250 I should have on END 350 but I get 250 (the last amount) but on E70 I have the right amount of 350.

I think the script with BAS (E70) does not work well to rec the sum on END.

0
Vadim Kalinin Dec 08, 2016 at 04:39 PM
0

Unfortunately my answer is lost due to SCN bug...

Anyway, I am unable to understand completely the calculation logic looking on your scripts (incorrect in some cases).

Please start again with detailed text description like:

Case 1

If user send data with AUDITID=HB4 and MOVEMENTTYPE=E25 and ACCOUNT=(list of Account ID's - please provide!).

I want:

Create record with negative original amount for same MOVEMENTTYPE=E25 and ACCOUNT=(list of Account ID's) but with AUDITID=RECLMINDIV

Then assuming that MOVEMENTTYPE=E25 is a children of some: E70,E90,F99,599 (is it correct?)

I want to recalculate MOVEMENTTYPE=END as a sum of E70,D99,E90,F99,599 for AUDITID= HB4 and RECLMINDIV and for ACCOUNT=(list of Account ID's)

Other Case ...

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

Case 1

If user send data with AUDITID=HB4 and MOVEMENTTYPE=E25 and ACCOUNT=2224000

I want:

Create record with AUDITID=HB4 original amount for MOVEMENTTYPE=END and ACCOUNT=2224000

Create record with negative original amount for same MOVEMENTTYPE=E25 and ACCOUNT=2224000

AUDITID=RECLMINDIV

Create record with negative original amount for MOVEMENTTYPE=END and ACCOUNT=2224000

AUDITID=RECLMINDIV

also

Create record with AUDITID=RECLMINDIV original amount for MOVEMENTTYPE=E25 and ACCOUNT=2240000

and

Create record with AUDITID=RECLMINDIV original amount for MOVEMENTTYPE=END and ACCOUNT=2240000

Then assuming that MOVEMENTTYPE=E25 is a children of some: E70

(D99, F99,599 are parenths of other Movementtypes which I need also on END)

I want also to recalculate MOVEMENTTYPE=END for ACCOUNT= 3849999 from MOVEMENTTYPE E40 for AUDITID=HB4 and from ACCOUNT=2226400 ((ACCOUNT=3849999, MOVEMENTTYPE=END) = (ACCOUNT=2226400,MOVEMENTTYPE=E40))

That is the case what I need to calculate in BPC, hope it is better for understanding.

0
Vadim Kalinin Dec 09, 2016 at 10:32 AM
0

Sorry but logic described is strange:

Lines in yellow will result in zero

Result


logic.png (51.3 kB)
result.png (4.4 kB)
Show 14 Share
10 |10000 characters needed characters left characters exceeded

P.S. "I want also to recalculate MOVEMENTTYPE=END for ACCOUNT= 3849999 from MOVEMENTTYPE E40 for AUDITID=HB4 and from ACCOUNT=2226400 ((ACCOUNT=3849999, MOVEMENTTYPE=END) = (ACCOUNT=2226400,MOVEMENTTYPE=E40))"

But how it's related to changes in account 2224000?

2224000 is a children of 2226400???

Absolutely not clear!

0

2226400 ist not parenth of 2224000.

2226400 is a Net Income account.

Here is a different rule logic: As described:

Data on ACCOUNT=3849999 (sum of PL Accounts), MOVEMENTTYPE=END

I want to record on ACCOUNT=2226400,MOVEMENTTYPE=E40 and MOVEMENTTYPE= END

0

"2226400 ist not parenth of 2224000"

Ok, is 2224000 a base member under 2226400?

0

Simply explain your accounts hierarchy with some screenshot

0

2224000 ist not children of 2240000.

So the last two lines should be recorded on 224000 and in this case 2224000 E25 and END are not zero, but over all AUDITID they are zero.

they should be two last two lines

5. 2240000 E25 RECLMINDIV 100

6. 2240000 END RECLMINDIV 100

0

"2224000 ist not children of 2240000." - what do you mean???? For sure some account can't be a children of itself!

"So the last two lines should be recorded on 224000 and in this case 2224000 E25 and END are not zero, but over all AUDITID they are zero." - unable to understand what you want to say!

Look on the table prepared in line with your requirements! The last 4 lines will result in zero.

0

2224000 and 2240000 are not the same account ;) there is one 2 more in the first account. This are two different BAS Accounts. That is why the last two lines are not correct.

0

OK, now it's clear!

In the first steps we have changes in 2224000 and 2240000 for some movement types and audiid's.

Then I want to understand the recalculation details (please show account hierarchy!)

0

Here is the hierarchy of PL

and I want to record value from the ACCOUNT=3849999 MOVEMENTTYPE=END

to ACCOUNT=2226400, MOVEMENTTYPE=E40 and MOVEMENTTYPE= END





hierarchy-pl.jpg (37.1 kB)
0

On this screenshot I can see only 3849999 account, but I want to see also

2226400

2224000

2226100

2226200

2226300

2240000

0

I want to understand why do we need to recalculate something... how the changed accounts are related to accounts used in calculation of 2226400 from 3849999

0
Show more comments

Script to perform first steps without rules will be:

*WHEN AUDITID
*IS HB4
*WHEN MOVEMENTTYPE
*IS E25
*WHEN ACCCOUNT
*IS 2224000
*REC(FACTOR=1,MOVEMENTTYPE=END) //line 2
*REC(FACTOR=-1,AUDITID=RECLMINDIV) //line 3
*REC(FACTOR=-1,AUDITID=RECLMINDIV,MOVEMENTTYPE=END) //line 4
*REC(FACTOR=1,AUDITID=RECLMINDIV,ACCCOUNT=2240000) //line 5
*REC(FACTOR=1,AUDITID=RECLMINDIV,MOVEMENTTYPE=END,ACCCOUNT=2240000) //line 6
*ENDWHEN
*ENDWHEN
*ENDWHEN
0

For all accounts in the rule just use:

*IS 2224000,2226100,2226200,2226300,2226400

instead of

*IS 2224000

0
Vadim Kalinin Dec 09, 2016 at 12:55 PM
0

Then I do not understand why do you need to recalculate 2226400 MOVEMENTTYPE=E40 from ACCOUNT=3849999 MOVEMENTTYPE=END

Nothing was changed on the previous step!

For 2226400 MOVEMENTTYPE=END it's another story:

It will be changed in:

*IS 2224000,2226100,2226200,2226300,2226400
*REC(FACTOR=1,MOVEMENTTYPE=END) //line 2

but also not clear!

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

because I would like to have the amount from ACCOUNT=3849999 MOVEMENTTYPE=END also on Account 2226400 E40 for the retained earnings. Because on 22264000 there are also other MOVEMENTTYPES which sum is on E70 and this should be recorded on this ACCOUNT=2226400 and MOVEMENTTYPE=END

0

You don't understand me!

Calculation of ACCOUNT=3849999 MOVEMENTTYPE=END to 2226400 MOVEMENTTYPE=E40

is not related to data entry to 2224000,2226100,2226200,2226300,2226400 with MOVEMENTTYPE=E25

For data entry to P&L accounts with MOVEMENTTYPE=END the logic has to be:

*WHEN ACCCOUNT.GROUP
*IS PL
*WHEN MOVEMENTTYPE
*IS END
*REC(EXPRESSION=[ACCOUNT].[3849999],ACCOUNT=2226400,MOVEMENTTYPE=E40)
*ENDWHEN
*ENDWHEN
0

Logic of ACCOUNT=2226400 and MOVEMENTTYPE=END calculation is still not clear!

0