cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Script Logic

former_member244687
Participant
0 Kudos

Hello Experts,

I have a doubt regarding script logic, the code is executed

*FOR %VAR%=1,2,3,4,5,6,7,8,9,10

*WHEN CATEGORY

*IS ACTUAL

*REC(FACTOR=1,CATEGORY=FORECAST,TIME=TMVL(%VAR%,%TIME_SET%))

*REC(FACTOR=1,CATEGORY=PLAN,TIME=TMVL(%VAR%,%TIME_SET%))

*ENDWHEN

*NEXT

1. In the above statement what does %var% mean or how is the value populated (is it from the input schedule ) , and does the %TIME_SET%

2.Second in the TMVL structure suppose the %var% is 3 will the record be created for 3 , 2 and 1.

thanks

Raj

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

If you select some period in the DM prompt - like 2016.02 then it will be passed to %TIME_SET% variable.

This code will copy ACTUAL 2016.02 to the next 10 months FORECAST and PLAN using TMVL shift:

%VAR% will be assigned values in the loop:

TMVL(%VAR%,%TIME_SET%)

will be:

TMVL(1,2016.02) = 2016.03

TMVL(2,2016.02) = 2016.04

TMVL(3,2016.02) = 2016.05

...

Use UJKT to see the result!

Vadim

P.S. It's better to use single loop like:

*WHEN CATEGORY

*IS ACTUAL

*FOR %VAR%=1,2,3,4,5,6,7,8,9,10

*REC(FACTOR=1,CATEGORY=FORECAST,TIME=TMVL(%VAR%,%TIME_SET%))

*REC(FACTOR=1,CATEGORY=PLAN,TIME=TMVL(%VAR%,%TIME_SET%))

*NEXT

*ENDWHEN

former_member244687
Participant
0 Kudos

thanks Vadim, as you said "If you select some period in the DM prompt - like 2016.02 then it will be passed to %TIME_SET% variable." so is this for DM package only or ..suppose I want to pass from input schedule will this work..in short my question is what happens when you declare something inside %..% .thanks a bunch again

former_member186338
Active Contributor
0 Kudos

"I want to pass from input schedule will this work.." - not clear what do you mean by "pass from input schedule"???

If you are talking about default.lgf then scope of changed members will be passed:

"when you declare something inside %..%" what do you mean by "declare"?

You can use automatically available variables like %SOMEDIMNAME_SET% - containing initial script scope. Special Keywords - SAP Business Planning and Consolidation, version for SAP NetWeaver - SAP Library


Or you can define your own variables:


*SELECT(%VARNAME%,...)


Or:


*XDIM_MEMBERSET SOMEDIMNAME AS %VARNAME% = SOMEMEMBER

Or:

*FOR %VARNAME% = ...,...


Vadim

former_member244687
Participant
0 Kudos

Thanks a lot Vadim now am clear. I have seen you were the one person consistently helping , kindly accept my thanks and from the entire user community

Answers (0)