cancel
Showing results for 
Search instead for 
Did you mean: 

How to make the year dynamic

Former Member
0 Kudos

Hi

I have a simple allocation script which works fine.

*SELECT(%GI_RU%,"[ID]",RU,"[PRIM_SEG] = 'GI'")

*XDIM_MEMBERSET RU=%GI_RU%

*XDIM_MEMBERSET ACCOUNT=GAK

*RUNALLOCATION

*FACTOR=1

*DIM TIME   WHAT=2013.INP;   WHERE= BAS(2013.TOTAL);

*ENDALLOCATION

Now I want to make the year dynamic. I tried different things with the %YEAR% option but nothing seems to work.We are on BPC10.

Can anybody help ?

Rgds

Accepted Solutions (1)

Accepted Solutions (1)

former_member200327
Active Contributor
0 Kudos

Can you please be more specific: what means dynamic? Do you want to get Year from user input or based on some property changed annually or something else?

Former Member
0 Kudos

Here we would have 2 possibilities:

- YEAR is a property from Category. Here there is an Entry 2013 for Category called P01. That would be the prefered solution

- %YEAR% should give back the actual system year 2012. We would need to add one and bring that value into xxxx.INP

former_member210696
Active Contributor
0 Kudos

Hello Tho,

- If you want to build your time memberset based on year property of category dimension, you can write a SELECT statement , something like -

*SELECT(%TIME_YEAR%,YEAR, "Category", "[ID] = '<Category Dimension Member'"

This will fetch the year from year property for the defined category dimension member and store it in TIME_YEAR. You can then refer to this variable for your calculations.

- %YEAR% will give you current year and you can use this in your *DIM instruction.

So, your *DIM instruction can look like -

*DIM TIME   WHAT=%YEAR.INP;   WHERE= BAS(%TIME_YEAR%.TOTAL);

Hope it helps!!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Tho,

If you change your DIM statement to:

*DIM TIME   WHAT=%YEAR%.INP;   WHERE= BAS(%YEAR%.TOTAL);

Then, it will consider the system year. If you want the value to be populated from the year property of the time dimension, then you should use a SELECT statement to capture that property value.

Hope this helps.

Former Member
0 Kudos

Hello together,

Thanks for your response.

@Ashis: That code worked ! Great

@Nilanjan: The problem is that I need the currenct year plus 1

Rgds,
Thomas

former_member210696
Active Contributor
0 Kudos

Hi Tho,

You can also make use of TMVL parameter which is used to get a time period based on a reference time dimension member and an offset value.

say, if I write TMVL(-12,2010.JAN), it will return 2009.JAN. You can get more help here -

http://help.sap.com/saphelp_bpc75_nw/helpdata/en/c8/d961d0dbfd4745af4b667279573702/content.htm

Hope it helps!!