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

SAP BPC 10 NETWEAVER Logic Script

Former Member
0 Kudos
215

Hello Gurus,

We have come across a requirments where we need to use script logic to spread the year total values in months.

In the package selection, they select Version and Time.

Now what they want is that according to selected Version and Time (eg 2010.INPUT) the data will be spread out in the eleven months such as

January to November only, now for December, they wanted to Subtract the 2010.INPUT values to the Sum of January to November values.

2010.INPUT = 100

2010.JAN = 100/12

2010.FEB = 100/12

...

...

2010.NOV = 100/12

now for December

2010.DEC = 2010.INPUT - (sum(2010.JAN to 2010.NOV)

I used the Allocation logic script  but it spread the 2010.INPUT values to 12 months

How can I exclude 2010.DEC in the selection and how can I based the time according to the year that is selected on the datamanager package?

When I use %TIME_SET% and %YEAR%, Time set is ok, but in %YEAR% it always default to 2013 and not base from the YEAR property of the selected %Time_SET%.

Is it best to do it in logic script or BADI?

Pardon for my explanation and I hope you guys got the requirements right.

Thanks as always,

yajepe

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Yajepe,

The standard run allocation script will suffice your purpose. However, I am a bit confused with your requirement.

Lets say, 2010.input = 1200

This should be allocated to Jan to Nov as 1200 / 12 = 100.

Now to calculate Dec, you are doing 2010.input - sum(jan to Nov) = 1200 - 1100 = 100.

This result is same as 1200 / 12.

So, what I am trying to say is that you can allocate the 2010.input value to all the 12 months equally. This result will be the same as your requirement. You can verify this by taking any other example also.

Hope this helps.

Former Member
0 Kudos

Hi Nilanjan,

Thank you for prompt reply. I do understand that the calculation is somewhat similar when allocating the Year value equally in 12 months, but the problem occurs when the year total value is not the whole number and comes with the decimals. and by doing that calculation, they said that it answers the problem of rounding off when displayed using 2 decimal.

Is there any way to calculate using their formula? in logic script?

Thanks as always,

yajepe

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Yajepe,

the reason why %YEAR% 's value is always 2013 is because it is a system variable :

http://help.sap.com/saphelp_bpc10_nw/helpdata/en/bpc_nw_index.htm

then : Administration / Rules / Logic Keyword Reference / Special Keywords -> bottom of the page

Script Logic System Variables

%USER% - Returns the current Planning and Consolidation user

%APPSET% - Returns the current Planning and Consolidation environment

%APPLICATION% - Returns the current Planning and Consolidation model

%YEAR% - Returns the current calendar year

Roberto's select will perform what you need.

Regards.

G.

Former Member
0 Kudos

Hello,

If i use select and put the %time_set% in the variable called %MY_YEAR%, How can i use this inside the allocation script for the script only accepts the variable %YEAR%. for instance WHERE=BAS(%YEAR%.TOTAL).

Thanks as always,

yajepe

Former Member
0 Kudos

Hi YAJEPE,

"When I use %TIME_SET% and %YEAR%, Time set is ok, but in %YEAR% it always default to 2013 and not base from the YEAR property of the selected %Time_SET%."

YEAR it's a property of category, see please

http://help.sap.com/saphelp_bpc75_nw/helpdata/en/93/82360cfc714380bc96a0f034c95540/content.htm

if you want to obtain the year from %TIME_SET% try

*SELECT (%MY_YEAR%, "YEAR", TIME, "ID=%TIME_SET%")

As Nilanjan wrote your calculation is the same result of 2010.DEC = 100/12

Kind regards

     Roberto

Former Member
0 Kudos

Hi Roberto,

Thank you for prompt reply, will try to use the seleclt you have mentioned.

BTW, please read my reply to Nilanjan why we wanted to use that formula.

I'll ask the client to provide me some sample having discrepancy using the allocation engine.

Thanks as always,

yajepe