cancel
Showing results for 
Search instead for 
Did you mean: 

Nested calculation of Accounts in Script logic

daniel_cepok2
Participant
0 Kudos

Dear Experts,

I have some problems with nested accounts in BPC. We are implementing BPC NW 10.0. As I know, in member formulas nested rules / calculation are not possible, so we tried to make the calculation with script logic. But here it takes me just the base members and calculatet it, but not the calculated accounts. We have the calculations in the consolidation model for the accounts.

For example, we would have some calculations on nested accounts:

First step:

Amount of Account 124200 with F14 and F16 should be write on Account CF162000

Second step:

Amount of Account CF161000 + CF162000 should be write on Account CF160000

First step calculation works well but the second step ist not working.

We wrote the following logic script but it does not work well:

*XDIM_MEMBERSET ACCOUNT=1242000
*XDIM_ADDMEMBERSET ACCOUNT=1242000
*WHEN ACCOUNT
*IS 1242000
*WHEN MOVEMENTTYPE
*IS F14,F16
*REC(FACTOR=-1,ACCOUNT=CF162000,MOVEMENTTYPE=END)
*ENDWHEN
*ENDWHEN

*XDIM_MEMBERSET ACCOUNT=1241000,1243000,1261000,1262000,1263000,1264000
*XDIM_ADDMEMBERSET ACCOUNT=1241000,1243000,1261000,1262000,1263000,1264000
*WHEN ACCOUNT
*IS 1241000,1243000,1261000,1262000,1263000,1264000
*WHEN MOVEMENTTYPE
*IS F14,F16
*REC(FACTOR=-1,ACCOUNT=CF161000,MOVEMENTTYPE=END)
*ENDWHEN
*ENDWHEN

*XDIM_MEMBERSET ACCOUNT=1281000,1282000,1283000,1284000,1285000
*XDIM_ADDMEMBERSET ACCOUNT=1281000,1282000,1283000,1284000,1285000
*WHEN ACCOUNT
*IS 1281000,1282000,1283000,1284000,1285000
*WHEN MOVEMENTTYPE
*IS F14,F16
*REC(FACTOR=-1,ACCOUNT=CF163000,MOVEMENTTYPE=END)
*ENDWHEN
*ENDWHEN
*COMMIT

*XDIM_MEMBERSET ACCOUNT=CF161000,CF162000,CF163000
*WHEN ACCOUNT
*IS CF161000,CF162000,CF163000
*WHEN MOVEMENTTYPE
*IS END
*REC(FACTOR=1,ACCOUNT=CF160000,MOVEMENTTYPE=END)
*ENDWHEN
*ENDWHEN
*COMMIT

Is here something wrong why it does not work correctly. We would like to make the calcualtion in multipe periods of a year.

Hope someone of you have a solution for this promlem.

Thanks

Daniel

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

First of all dimension member formulas and script logic are absolutely different tools, you can't use one instead of another. And if you have hana you can use nested dimension formulas.

For script logic please explain what you want to achieve in line with: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

daniel_cepok2
Participant
0 Kudos

Yes I know, but we do not have hana so we can not use nested dimension formulas.

for the logic script we write ( I put the description bevor the formula, hope it helps you for understanding):

//-1*(ACCOUNT 1242000 with Movementtype F14 or Movementtype F16) = ACCOUNT CF162000 with Movementtype END

*XDIM_MEMBERSET ACCOUNT=1242000
*XDIM_ADDMEMBERSET ACCOUNT=1242000
*WHEN ACCOUNT
*IS 1242000
*WHEN MOVEMENTTYPE
*IS F14,F16
*REC(FACTOR=-1,ACCOUNT=CF162000,MOVEMENTTYPE=END)
*ENDWHEN
*ENDWHEN

//-1* (ACCOUNT1241000,1243000,1261000,1262000,1263000,1264000 with Movementtype F14 or F16)=CF161000 with Movementtype END

*XDIM_MEMBERSET ACCOUNT=1241000,1243000,1261000,1262000,1263000,1264000
*XDIM_ADDMEMBERSET ACCOUNT=1241000,1243000,1261000,1262000,1263000,1264000
*WHEN ACCOUNT
*IS 1241000,1243000,1261000,1262000,1263000,1264000
*WHEN MOVEMENTTYPE
*IS F14,F16
*REC(FACTOR=-1,ACCOUNT=CF161000,MOVEMENTTYPE=END)
*ENDWHEN
*ENDWHEN


//-1* (ACCOUNT 1281000,1282000,1283000,1284000,1285000 with Movementtype F14, F16)=CF163000 Movementtype END

*XDIM_MEMBERSET ACCOUNT=1281000,1282000,1283000,1284000,1285000
*XDIM_ADDMEMBERSET ACCOUNT=1281000,1282000,1283000,1284000,1285000
*WHEN ACCOUNT
*IS 1281000,1282000,1283000,1284000,1285000
*WHEN MOVEMENTTYPE
*IS F14,F16
*REC(FACTOR=-1,ACCOUNT=CF163000,MOVEMENTTYPE=END)
*ENDWHEN
*ENDWHEN
*COMMIT


// the 3 calculated Accounts CF161000+CF162000+CF163000 above should now be recorded on CF160000 with Movementtype END
*XDIM_MEMBERSET ACCOUNT=CF161000,CF162000,CF163000
*WHEN ACCOUNT
*IS CF161000,CF162000,CF163000
*WHEN MOVEMENTTYPE
*IS END
*REC(FACTOR=1,ACCOUNT=CF160000,MOVEMENTTYPE=END)
*ENDWHEN
*ENDWHEN
*COMMIT

Thanks

former_member186338
Active Contributor
0 Kudos

Instead of some strange scripts please explain the calculation logic in line with the document I mentioned in my previous post. Is it clear? No scripts, please!

former_member186338
Active Contributor
0 Kudos

Generic comment about scripts:

Why do you use XDIM_ADDMEMBERSET???

Why do you need to repeat accounts in *IS ???

Why do you use useless COMMIT?

...

daniel_cepok2
Participant
0 Kudos

Ok, hope this way is better to explain our calculation in 4 Steps:

1.

-1*(ACCOUNT=1242000; MOVEMENTTYPE=F14,F16) = (ACCOUNT=CF162000;MOVEMENTTYPE=END)

2.

-1* (ACCOUNT=1241000,1243000,1261000,1262000,1263000,1264000;MOVEMENTTYPE=F14,F16) = (ACCOUNT=CF161000, MOVEMENTTYPE=END)

3.

-1* (ACCOUNT=1281000,1282000,1283000,1284000,1285000;MOVEMENTTYPE=F14,F16) = (ACCOUNT=CF163000;MOVEMENTTYPE=END)

4.

The 3 calculated Accounts:

(ACCOUNT=CF161000,CF162000,CF163000;

MOVEMENTTYPE=END) = (ACCOUNT=CF160000; MOVEMENTTYPE=END)

The problem is the point 4 because the calculate Accounts does not work for the nestet calculations.

former_member186338
Active Contributor
0 Kudos

Sorry it has to work!

You have to test the script in UJKT. But please remove useless or incorrect things from the script.