Skip to Content
0

Script Logic - Copy

May 18, 2017 at 12:57 AM

127

avatar image

HELLO,

BPC 10.1NW

iam trying to copy data from 1 period to next 2 periods.Below is my script. I want to copy

2017.09 to 2017.10,2017.11 & 2017.12 to 2018.01,2018.02. When i run below script - 2018.01,2018.02 -data is getting copied from both 2017.09 & 2017.12. script works when i have only one member for time selection. with multiple members it gives incorrect results.

Time = 2017.09,2017.12

version - FORECAST

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

*XDIM_MEMBERSET ACCOUNT = BAS(INVENTORY_FIFO)

*XDIM_MEMBERSET AUDIT_ID = IC_ALLOC_CALC

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET VERSION = %VERSION_SET%

*WHEN ACCOUNT

*IS *

*FOR %TIM%=%TIME_SET%

*REC(FACTOR=1,TIME=TMVL(1,%TIM%))

*REC(FACTOR=1,TIME=TMVL(2,%TIM%))

*NEXT

*ENDWHEN

Thanks.

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

3 Answers

Ashish Gupta May 18, 2017 at 03:25 AM
0

Correct script would be -

*XDIM_MEMBERSET ACCOUNT = BAS(INVENTORY_FIFO)
*XDIM_MEMBERSET AUDIT_ID = IC_ALLOC_CALC
*XDIM_MEMBERSET TIME = %TIME_SET%
*XDIM_MEMBERSET VERSION = %VERSION_SET%

*FOR %TIM%=%TIME_SET%
*WHEN TIME
*IS %TIM%
*REC(FACTOR=1,TIME=TMVL(1,%TIM%))
*REC(FACTOR=1,TIME=TMVL(2,%TIM%))
*ENDWHEN
*NEXT

Share
10 |10000 characters needed characters left characters exceeded
Vadim Kalinin May 18, 2017 at 06:29 AM
0

Ashish provided a correct script, but I have some extra questions:

if you select 2 months:

2017.09

2017.10

overwrite will happen. What values do you want to have as a result?

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

Thanks Ashish.

Vadim, we run allocations only on quarter end(period 3,6,9 & 12) & want to copy the quarter end values to next 2 periods.

2017.03 to 2017.04,2017.05

2017.06 to 2017.07,2017.08

2017.09 to 2017.10,2017.11

Thanks

0

Then it's better to add at the beginning of script:

*SELECT(%TS%,[ID],TIME,[ID]=%TIME_SET% AND MONTHNUM=3,6,9,12)

and use %TS% instead of %TIME_SET% later

It will reject incorrect user selection.

0

Thanks Vadim.

*SELECT(%TS%,[ID],TIME,[ID]=%TIME_SET% AND MONTHNUM=3,6,9,12)

above statement throws an error "invalid attribute name (06,09,12) in dimension TIME.

It works only when i have 1 value for monthnum. is there a way to filter with multiple values?

*SELECT(%TS%,[ID],TIME,[ID]=%TIME_SET% AND MONTHNUM=3) ->this works.

0

Standard question - BPC and BW version and SP!!!! I am unable to remember versions for each person on the forum.

Please, read again https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

And screenshot of your TIME dimension, please!

0

BPC 10.1 NW SP 10 ON HANA

BW 7.4 SP 15

time.png (33.0 kB)
0

Nothing wrong with your version.

I have tested in UJKT with environmenshell and the result is correct

TIME=2017.03,2017.04,2017.05,2017.06

Script:

*SELECT(%TS%,[ID],TIME,[ID]=%TIME_SET% AND MONTHNUM=3,6,9,12)
*XDIM_MEMBERSET TIME=%TS%

Result after Execute:

LGX:

*XDIM_MEMBERSET TIME=2017.03,2017.06

0
I can also confirm that the Select statement works with multiple month num with SAP BW 7.5 SP2, SAP BPC 10.1 NW on HANA.

However, if this doesn't work for you, you can use below as a workaround.

*FOR %TIM%=%TIME_SET%

*WHEN TIME

*IS %TIM%

*WHEN TIME.MONTHNUM

*IS 3,6,9,12

*REC(FACTOR=1,TIME=TMVL(1,%TIM%))

*REC(FACTOR=1,TIME=TMVL(2,%TIM%))

*ENDWHEN

*ENDWHEN

*NEXT

The initial scope is large so it would take more time to execute this script. If the data volume in question is not huge, this should serve the purpose.
0

To my mind it's better to investigate what's wrong with

*SELECT(%TS%,[ID],TIME,[ID]=%TIME_SET% AND MONTHNUM=3,6,9,12)

it has to work!

And it's better to provide screenshot of the web administration page of the TIME dimension, not Excel download...

0

TIME SCREENSHOT ATTACHED

time-webadmin.png

time-webadmin.png (87.1 kB)
time-webadmin.png (87.1 kB)
0

UJKT ERROR SCREENSHOT

ujkt-error.png (23.9 kB)
ujkt-error.png (23.9 kB)
0

found below snote-

2445350 - Error "Invalid attribute name (dynamic variable) in dimension (XXXX)" occurs when validating a Script logic

0

The note looks like relevant!

But traditionally MONTHNUM has values 1,2,3... (not 01,02,03... ) Look on the environmentshell sample.

P.S. MONTHNUM is a string property.

0

i tried changing monthnum to 1,2,3,4,...12.

It still didnt work. we'll apply the note to see if it fixes the error. Thanks vadim for your help

0

My successful test was on BW 7.50 SP06.

0
GANAPATHI . May 24, 2017 at 06:51 AM
0

MEGHANA,

Can you use this code if it helps

GANAPATHI


ls.jpg (43.0 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

What is the difference between your script and Ashish script????

No difference!

0