Skip to Content
0

SAP BPC 10MS - PROBLEM WITH SCRIPT LOGIC CALCULATION

Jul 12, 2017 at 08:00 AM

59

avatar image

Hello SAP Expert,

I’m trying (SAP BPC 10 MS) to perform the following calculation with SCRIPT Logic and I’m having some problems.

Basically what I want to achieve is to have YYYY.Q1 + YYYY.Q2 + YYYY.Q3 (ACTUALS) = YYYY.Q4 (FORECAST). I need to peform this for all years.

In my TIME dimension I have the properties PERIODS (with indicates for each ID Q1, Q2, Q3, Q4, JAN, FEB, MAR, etc) and the property YEAR as well.

In the script logic I have:

*SELECT (%Q1%,[ID],TIME, “PERIODS = Q1")

*SELECT (%Q2%,[ID],TIME," PERIODS = Q2")

*SELECT (%Q3%,[ID],TIME," PERIODS = Q3")

*SELECT (%Q4%,[ID],TIME," PERIODS = Q4")

*XDIM_MEMBERSET CATEGORY = ACTUALS

*WHEN CATEGORY

*IS ACTUALS

*WHEN TIME

*IS %Q1%,%Q2%,%Q3%

*REC(FACTOR = 1, CATEGORY = FORECAST, TIME = %Q4%)

*ENDWHEN

*ENDWHEN

*COMMIT

The problem that I’m having is that the system does not understand where the value must be stored. In NW version a similar procedure use to work for me.

Do you have any suggestion?

Thanks you!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Cecilia Petersson Jul 12, 2017 at 09:51 AM
0

Hi Luis,

Try something like this, i.e. add the SELECT statement and replace your REC statement with the FOR-NEXT loop below.

*SELECT(%ALL_YEARS%,"[YEAR]","TIME")

*WHEN TIME
*IS %Q1%,%Q2%,%Q3%
*FOR %MY_YEAR% = %ALL_YEARS%
*WHEN TIME.YEAR
*IS %MY_YEAR%
*REC(FACTOR = 1/3, TIME = %MY_YEAR%.OCT, CATEGORY = FORECAST, NOADD)
*REC(FACTOR = 1/3, TIME = %MY_YEAR%.NOV, CATEGORY = FORECAST, NOADD)
*REC(FACTOR = 1/3, TIME = %MY_YEAR%.DEC, CATEGORY = FORECAST, NOADD)
*ENDWHEN
*NEXT
*ENDWHEN

/Cecilia

Share
10 |10000 characters needed characters left characters exceeded