on 2013 Jan 30 8:01 AM
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
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
%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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 7 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.