on 2016 Jul 25 4:35 PM
Dear Experts;
I am new to SAP APO. I am current interning and my boss ask me to see if I can figure out how to write a code or use workbench to come up with a moving average macrons. The objectives is to have a 3 months average calculate itself and move over to the next by using macron and that run in the background. After searching for the answers for days, I cannot come up with anything. So please help.
Visal Lay,
SAP APO Intern
Penn State University
Information Sciences & Technology
Request clarification before answering.
Dear Visal,
To calculate the moving average using macro, use the below logic.
Let's suppose you are using two different keyfigures for Sales & Forecast respectively.
Considering an example of generating the forecast for 12 months.
step1: one iteration
Forecast(Jan 2016) = avg (sales(oct2015); sales(dec2015))
step2: one iteration
Forecast(Feb 2016) = ( sales(nov2015) + sales(dec2015) + forecast(jan2016) ) / 3
step1: one iteration
Forecast(Mar 2016) = ( sales(dec2015) + forecast(jan2016) + forecast(feb2016) ) / 3
step4: nine iterations
Forecast(Apr2016) = avg (forecast(Jan2016); Mar(2016))
Use respective keyfigures and iterations as per your requirement.
Feel free to ask if you still have any queries.
Kindly close the discussion if resolved.
http://scn.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why
Regards,
Hussain
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you just want to practice ABAP, this does not look like a good exercise ...
Moving average is already provided in APO system and you can use it directly. But normally we do not use macro to calculate forecast ... You can define different background activities in /sapapo.mc8t, and as you can see, macro and forecast are different ones ...
Macros in APO are also provided in APO, you can just create them easily in /sapapo/advm.
So not sure about what you want to do exactly ... Do you want to learn how to configure DP functionalities or you want to practice ABAP coding purely?
BR,
Ada
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for replying Ada, I am currently interning at my company. I understand that APO already have a moving average option but its only provide constant average. I want it to be able to take the average of last month and use it part of the calculation for the next month and have automatically moving it forward through a job and a process chain. I do apologized for not being clear as I am very new to SAP and SAP APO. Thank you.
Hi,
Then I suppose the best way would be using forecast strategy 99 (external forecast).
You can set your univariate forecast profile in /sapapo/mc96b to use strategy 99.
Then you create a badi implementation of badi /SAPAPO/SDP_FCST_EXT, and put your coding in method EXTERN1 or/and EXTERN2.
If you assign this profile during forecast run, your coding in the BADI will be called.
BR,
Ada
| User | Count |
|---|---|
| 17 | |
| 16 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.