cancel
Showing results for 
Search instead for 
Did you mean: 

Custom copy script

Former Member
0 Kudos

Dear All,

Can someone please explain to me why this is happening.

I have created a script based on several scripts i found on SDN.

I have some knowhow from SAP BPC MS and according to me this should just work.

This is the script.

*XDIM_MEMBERSET C_DATASRC=Upl

*XDIM_MEMBERSET GROUPS=LC

*XDIM_MEMBERSET IN_WASTETYPE=BAS(IWT_ALL)

*XDIM_MEMBERSET MEASURES=PERIODIC

*XDIM_MEMBERSET LINEMAINITEM=<ALL>

*XDIM_MEMBERSET PACKAGETYPE=BAS(PT_ALL)

*XDIM_MEMBERSET PROFITCENTER=BAS(N)

*XDIM_MEMBERSET P_PROFITCENTER=BAS(P_N)

*XDIM_MEMBERSET TIME=%TIME_SET%

*XDIM_MEMBERSET VALUETYPE=ACTUAL,FORECAST,PLANNED

*LOOKUP EBIT

*DIM MEASURES=PERIODIC

*DIM LMITEM: LINEMAINITEM=SCP

*DIM PACKAGETYPE=PT_NONE

*ENDLOOKUP

*WHEN P_PROFITCENTER

*IS <> P_NONE

*WHEN LINEMAINITEM

*IS WTODT

*REC(EXPRESSION=0, LINEMAINITEM=LINEMAINITEM.ZACC1)

*REC(FACTOR=LOOKUP(LMITEM), LINEMAINITEM=LINEMAINITEM.ZACC1)

*ENDWHEN

*WHEN LINEMAINITEM

*IS DT

*REC(EXPRESSION=0, LINEMAINITEM=LINEMAINITEM.ZACC1)

*REC(FACTOR=LOOKUP(LMITEM),LINEMAINITEM=LINEMAINITEM.ZACC1)

*ENDWHEN

*ENDWHEN

*COMMIT

I would say that it is possible to post data from a calculation on a other linemainitem.

In the linemainitem dimension i created a propperty ZACC1, which is a reference to a other linemainitem.

The only thing is, when i run this logic it posts zero's on itself, in this case WTODT and DT and not %VALUE%*LOOKUP on LINEMAINITEM.ZACC1.

Can someone point me in the right direction to make this script work?

Thanks in advantage

Harmen

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Sorry, my mistake. I was not 100% clear on this. Please modify your rec statement like below:

*REC(FACTOR=LOOKUP(LMITEM), LINEMAINITEM=[LINEMAINITEM].[ZACC1])

I hope its clear this time.

Former Member
0 Kudos

The problem is solved.

Somehow BPC has the tendency to post a counter booking on itself when a logic fetches a figure.

I don't know why or how, but it's what I saw it doing.

The initial script was correct, the only thing I had to add to the script was


REC(FACTOR=1)

The finalized script now is this:


*XDIM_MEMBERSET C_DATASRC=Upl
*XDIM_MEMBERSET GROUPS=LC
*XDIM_MEMBERSET IN_WASTETYPE=IWT_NONE
*XDIM_MEMBERSET MEASURES=PERIODIC
*XDIM_MEMBERSET LINEMAINITEM=WTODT,DT
*XDIM_MEMBERSET PACKAGETYPE=PT_NONE
*XDIM_MEMBERSET PROFITCENTER=BAS(N)
*XDIM_MEMBERSET P_PROFITCENTER=BAS(P_N)
*XDIM_MEMBERSET TIME=%TIME_SET%
*XDIM_MEMBERSET VALUETYPE=PLANNED

*LOOKUP EBIT
*DIM LMITEM: MEASURES=PERIODIC
*DIM LMITEM: LINEMAINITEM=SCP
*DIM LMITEM: PACKAGETYPE=PT_NONE
*DIM LMITEM: PROFITCENTER=PC_NONE
*DIM LMITEM: VALUETYPE=PLANNED
*ENDLOOKUP

*WHEN P_PROFITCENTER
*IS  <> P_NONE
*WHEN LINEMAINITEM
*IS WTODT
*REC(FACTOR=LOOKUP(LMITEM), LINEMAINITEM=LINEMAINITEM.ZACC1)
*REC(FACTOR=1)
*NEXT
*ELSE
*WHEN LINEMAINITEM
*IS DT
*REC(FACTOR=LOOKUP(LMITEM), LINEMAINITEM=LINEMAINITEM.ZACC1)
*REC(FACTOR=1)
*NEXT
*ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT  

NOTE: there are point brackets in the line *IS P_NONE but the BB code probably recognized this as a command.

Thanks for the help, I can't give you the points since the solutions was different than suggested

Harmen

Edited by: HarmenKlapwijk on Apr 8, 2011 4:44 PM

Former Member
0 Kudos

Hi,

Since, you want %value% * lookup, try using only the second rec statement in each when statement. remove the rec statements in which you are posting 0. That will work. And make sure that you have data in the lookup region. The result will be 0 if the lookup region doesnt have data.

Hope this helps.

Former Member
0 Kudos

Hi Nilanjan,

The first REC statement is used to clear the destination account.

This to make sure that when the logic is run twice there are no doubles in BW.

The problem still remains, why does the logic post the data on itself and not on the LINEMAINITEM that is enterd as a property of the LINEMAINITEM?

Former Member
0 Kudos

Hi,

Script logic will always post the delta values. The values will not be duplicated. But if you still want to avoid this. Then first write 0 to the destination. Save it with commit. And then do the calculation.

Do you mean that the value is stored in WTODT instead of writing it to the ZACC1 property of it?

Can you please try using

[LINEMAINITEM].[ZACC1]

in the rec statement.

Hope this helps.

Former Member
0 Kudos

Hi Nilanjan

Can you please explain further.

Because i tried the script with your addition.

in this case the rec statement would be


REC(FACTOR=LOOKUP(LMITEM),[LINEMAINITEM].[ZACC1])

Besides if i try to run this the log tells me that the rec statement is:


REC(FACTOR=LOOKUP(LMITEM))

Nowhere in the log i can find that the rec statement writes back on the LINEMAINITEM.ZACC1

I'm starting to wonder if it is even possible to write back figures from a rec statement on other accounts.

Some more info on this would be nice.

Harmen