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

Script logic to aggregate values using properties

Former Member
0 Kudos
451

logic.txtHi,

We need to sum few business units actual value and post it to forecast. The script which we have works fine but when the company buys a new line of business then we need to copy the code and add new members to it. Please find the attached script.

Below table shows the members which are aggregated.

If you have any ideas, Please let me know.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

This is exactly my proposal #1

...BUSINESSUNIT=BUSINESSUNIT.SUMTARGET...

Strange idea that somebody downvoted my correct answer.

Former Member
0 Kudos

So I could remove the allocation logic and replace it with the above logic to achieve it and wont have any issue by removing the allocation logic?

former_member186338
Active Contributor
0 Kudos

There is no magic with allocation logic - in this case it's doing the same as WHEN/ENDWHEN.

With allocation it's not possible to use property for target member, with WHEN/ENDWHEN - possible. No issues.

Please accept the correct answer.

Former Member
0 Kudos

Hi Vadim,

Thanks for your help but I have a problem. When I run the data manager package twice its doubling the amount but where as the allocation logic is working fine.

Do you have any suggestions so that it wont double up.

Thank you

former_member186338
Active Contributor
0 Kudos

You have to be accurate:

In you new script you have:

*XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%

But in the original allocation:

*DIM CATEGORY WHAT=ACTUAL; WHERE=%CATEGORY_SET%

Has to be

*XDIM_MEMBERSET CATEGORY =ACTUAL

-----------------------------------------------------------------------------------------------------------

Also

*DIM DATASRC WHAT=[COPYACT]="BUSUB"; WHERE=BUSUB

Target is BUSUB!

Has to be:

*REC(EXPRESSION=%VALUE%,BUSINESSUNIT=BUSINESSUNIT.SUMTARGET,CATEGORY = %CATEGORY_SET%,DATASRC=BUSUB)

Former Member
0 Kudos

Hi Vadim,

I have a problem in changing the code to copy reserves movement to forecast months based on property in time dimension.

Code which is working but the business unit needs to be changed when

company buys a new line of business then we need to copy the code and add new members to it :

*XDIM_MEMBERSET ACCOUNT = B1102000

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET DATASRC = <ALL>

*XDIM_FILTER DATASRC = [DATASRC].PROPERTIES ("COPYACT")="BUSUB"

*XDIM_ADDMEMBERSET BUSINESSUNIT=WLAUS,FLTWK,CCWG,JWA,UNW

*XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%

*XDIM_ADDMEMBERSET CATEGORY = ACTUAL

*XDIM_MEMBERSET DIVISION = <ALL>

*XDIM_MEMBERSET FLOW = <ALL>

*XDIM_MEMBERSET RPTCURRENCY = <ALL>

*RUNALLOCATION

*NAME CCWGRPMOVT

*FACTOR=

*DIM ACCOUNT WHAT=B1102000; WHERE=<<<

*DIM BUSINESSUNIT WHAT=CCWG,FLTWK,JWA,UNW,WLAUS; WHERE=CCWG

*DIM CATEGORY WHAT=ACTUAL; WHERE=%CATEGORY_SET%

*DIM DATASRC WHAT=[COPYACT]="BUSUB"; WHERE=BUSUB

*DIM TIME WHAT=%TIME_SET%; WHERE=[MOVESALES]="Y"

*DIM RPTCURRENCY WHAT=LC,USD; WHERE=<<<

*DIM FLOW WHAT=RESMVT; WHERE=<<<

*ENDALLOCATION

*COMMIT

I have changed it to below code but the problem is it's not identifying the time dimension members based on property:

*XDIM_MEMBERSET ACCOUNT = B1102000

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET DATASRC = <ALL>

*XDIM_FILTER DATASRC = [DATASRC].PROPERTIES ("COPYACT")="BUSUB"

*XDIM_MEMBERSET CATEGORY = ACTUAL

*XDIM_MEMBERSET DIVISION = <ALL>

*XDIM_MEMBERSET FLOW = RESMVT

*XDIM_MEMBERSET RPTCURRENCY = <ALL>

*SELECT(%MEMSUM%,"[ID]",BUSINESSUNIT,"[SUMTARGET]<>' '")

*XDIM_MEMBERSET BUSINESSUNIT=%MEMSUM%

*WHEN BUSINESSUNIT

*IS *

*REC(EXPRESSION=%VALUE%,BUSINESSUNIT=BUSINESSUNIT.SUMTARGET,CATEGORY = %CATEGORY_SET%,DATASRC=BUSUB,FLOW =RESMVT, TIME=TIME.MOVESALES)

*ENDWHEN

*COMMIT

Could you please help me with it?

Thank you

former_member186338
Active Contributor
0 Kudos

priya.chitneni

Please create a new question and describe requirements in line with: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

Answers (1)

Answers (1)

former_member186338
Active Contributor

There are 2 options:

1. Copy using when endwhen loop with destination by property

2. Use for next loop for RUNALLOCATION. Loop by property value.

Former Member
0 Kudos

Hi Vadim,

Thanks for your reply.

We are on BPC MS 10.1 and SP 28

I have replaced the allocation logic with the below logic and it works as expected.

*XDIM_MEMBERSET ACCOUNT = <ALL>
*XDIM_FILTER ACCOUNT = [ACCOUNT].PROPERTIES ("COPYACT")="Y"
*XDIM_MEMBERSET TIME = %TIME_SET%
*XDIM_MEMBERSET DATASRC = <ALL>
*XDIM_FILTER DATASRC = [DATASRC].PROPERTIES ("COPYACT")="BUSUB"

*XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%
*XDIM_ADDMEMBERSET CATEGORY = ACTUAL
*XDIM_MEMBERSET DIVISION = <ALL>
*XDIM_MEMBERSET FLOW = <ALL>
*XDIM_MEMBERSET RPTCURRENCY = <ALL>

*SELECT(%MEMSUM%,"[ID]",BUSINESSUNIT,"[SUMTARGET]<>''")

*XDIM_MEMBERSET BUSINESSUNIT=%MEMSUM%

*WHEN BUSINESSUNIT
*IS *
*REC(EXPRESSION=%VALUE%,BUSINESSUNIT=BUSINESSUNIT.SUMTARGET,CATEGORY = %CATEGORY_SET%)
*ENDWHEN
*COMMIT

But I am not sure of the consequences by removing the allocation logic.

Could you please have a look at it and let me know if it is ok to replace it.

Thanks in advance