Financial Management Blogs by SAP
Get financial management insights from blog posts by SAP experts. Find and share tips on how to increase efficiency, reduce risk, and optimize working capital.
Showing results for 
Search instead for 
Did you mean: 
Hello everyone,

my name is Oleksandr and for the last couple of months I had the opportunity to be part of SAP Profitability and Performance Management Solution’s Agile Plan and Forecast business content development team. As a business consultant/developer I was able to gain a lot of insights on different modern planning approaches which I would like to share with you in this blog post.

Why am I writing this blog post? Each year there is a time we all start to notice that our company’s accounting department and management gets even more stressed as usual and, they all share the same time-consuming task, which is planning the next year’s expenses and revenues. The reason for this is that this task involves a lot of manual time-consuming work and even if you take your time and put a lot of effort into it some mistakes or incorrect assumptions may slip through your well-trained eyes. To overcome these issues, automated and modern algorithms like machine learning could be the solution. Therefore, I want to use this blog post to share my insights and thoughts on this topic.

Before we start with the actual topic let’s take a quick tour through the blog post structure. We start with an introduction on the dataset which will be used for all our machine learning algorithm and builds the foundation for our planning models.
After we understand what our data is and what we want to plan can talk about our first machine learning algorithm which is a build in forecasting algorithm in SAP Profitability and Performance Management Solution. During this part we will understand how such an algorithm can be set up and what parameters need to be maintained. After understanding these preconditions, we will see the planning results obtained from the algorithm. Since one of our goals is to evaluate if these algorithms are a feasible method to manual planning, we compare the results to our manual planning results. Regarding to the previously mentioned problems with manual planning we will have two goals for the machine learning algorithms. The first goal is to help identify errors in our manual planning. The second goal is to replace the time-consuming manual work with an automated algorithm which still has a high result quality. We will analyse our results regarding to these two goals.
After understanding the pros and cons of the build in machine learning algorithm, we will see another way of planning, which involves neuronal networks and R script. This part is structured in the same way as the previous one except that for the sake of simplicity and blog post length we do not go too much into detail on the mathematical or coding parts. We end this blog post with a short conclusion and some final thoughts on how machine learning could be used in productive environments. So, without further ado let’s jump right into the topic of modern planning.


For this business content SAP’s Profitability and Performance Management Solution provides us with General Ledger Data which has the following structure:

Posting Date GL Account Amount Currency
1/31/2019 P1REV 7.265.309,91 USD
2/28/2019 P1REV 6.608.564,03 USD
1/31/2019 P2REV 4.309.305,77 USD
2/28/2019 P2REV 4.062.105,76 USD
1/31/2019 P4REV 5.595.620,00 USD

Our example Dataset consists of multiple General Ledger (GL) Accounts where P1REV stands for Product 1 Revenue, P2REV for Product 2 Revenue and P3REV for Product 3 Revenue. For each GL Account we record the booked Amounts (e.g., Revenues) on a month-to-month basis for a period of two years.

Forecasting and Planning with build in machine learning functions

We start our machine learning journey with the build in forecast function, which is provided by SAP Profitability and Performance Management Solution and is an easy entry point into ML functions, since it is an out of the box ready to use ML function.

Mathematically speaking this forecast function is the well-known Exponential smoothing algorithm, which is a time series forecasting method for univariate data. For the sake of simplicity and reading time we will not go into detail on this topic.

To use this functionality in SAP Profitability and Performance Management Solution you create a new Machine Learning Function and configure the General Ledger Table as Input Table in the Input Tab. As the next step you need to create a forecast rule in the rule tab. The last step will be to maintain the algorithm parameters presented in the newly created forecast rule. In our case the configuration looks like this

Build In forecast algorithm parameter maintenance

The following table provides an overview of the mandatory Fields.

Field Explanation
Date Field Time dimension in Data
Signal Field Amount dimension in Data
Forecast Period/Unit Time granularity of prediction
Forecast Field Results will be stored here
Excluded Fields Dimensions, which will be excluded in the forecast
Segment Segmentation for the signal field

Note that nearly all maintained fields are intuitive and easy to configure. The only field which needs some additional thinking is the segmentation Field. Here we have the possibility to provide additional information on how our data is structured. In our case we selected Cost Center, Functional Area and GL Account since our goal is to have a forecast on each Cost Center, Functional Area and GL Account on its own and without influence from other Areas. The right choice for segmentation depends heavily on your data. For example, in some business areas there may be the possibility, that some functional areas may influence each other’s performance.

Note that during setting up this function we never needed to make any data preparation or cracking our heads over some complicated mathematical parameters. This is exactly where the beauty of this approach lies: it’s simplicity. Within mere minutes we were able to construct our first advanced forecasting function. This is a big advantage of SAP’s Profitability and Performance Management Solution because otherwise you would have need to put more time in planning how to use this algorithm.

In the following figure we see a comparison between Traditional Planning results and our forecast function results for the year 2021.

Comparison between forecast algorithm planning (green) and manual planning (purple) results

As previously mentioned, we have two goals for machine learning. The first one is to help us find errors in our manual planning. In the previous figure we notice that there are some months in with our manual planning is far away from what the machine learning algorithm computed. After a more detailed look at some of these suspicious months we noticed that for example in case of our May planning we made some manual mistake, to be precise our planning assumptions had a mistake. After fixing this mistake we get the following updated figure.

Comparison between forecast algorithm planning (green) and updated manual planning (purple) results

This time our manual results in May are quite like the machine learning results.

Our second goal was to evaluate if we could remove the time-consuming manual planning and instead rely sole on machine learning algorithms. If we take a look at the upper figure, we notice that there are still months when the results differ by quite a lot and further investigations did not provide any clear manual mistakes and since this is a build in algorithm without much influence on the algorithms parameters, we are not able to improve the machine learning algorithm results by a lot. This is the trade of we take between an easy-to-use algorithm and precise results.

Plan Revenues with R Script Neuronal Networks

I will try to keep this part short to keep this blog post simple and since I already know that you cannot wait to implement your first advanced planning model.

Again, we are using the same dataset as in the previous part but instead a build in machine learning rule, we are now using the remote function adapter with HANA R Script adapter type. At this point you may ask yourself “why should I program something if I can just use prebuild algorithms like the previous one?”. The answer is simple, with R Script you have far more control over the algorithms you use. Also, if you or your company already use R Script for a certain calculation, then it is only needed to copy the already used statement and include it in Profitability and Performance Management Solution instead of having multiple places where you do calculations.

In our case we use the well-known NNET (Neuronal Networking package) and construct a deep learning model with one hidden layer and ten neurons. For the sake of simplicity and to keep this blog post “short” we do not go into details on the exact implementation or the choice of our parameters. The only noteworthy thing is, that the downside of using advanced R script capabilities is, that we need to invest more time into choosing our parameters for the algorithm but don’t forget we only do this once while implementing the algorithm.

The R Script results in comparison to the manual planning are visualized in the following figure.

Comparison between planning with neuronal network (green) and manual planning (purple) results

It is easy to see that the result precision improved dramatically and only differs by a small amount in comparison to our manual planning. If we also consider the fact, that we only need to set up the neuronal network algorithm once, this advanced planning method is not only able to help us identify errors due to manual work but even provide a precise prediction which could be used as a standalone planning and forecasting method.

Conclusion and final thoughts

The biggest advantage of using machine learning for planning and forecasting is, that after an initial system setup you don’t have to do any manual work and therefore, you not only safe a lot of time but also minimize mistakes due to human errors. On the other hand, if you only act based on some algorithm’s results, you may lose confidence in the results. So, if you decide to implement some advanced analytics models you may consider using them not as a standalone solution but as an additional way of generating complex data insights or identify discrepancies to your manual planning results.

If you ask me “What is the future of machine learning in productive environments?” I would say the first step is to use these advanced models in parallel to the manual planning and forecast methods. After some time, when you have enough experience with different machine learning algorithms and also enough confidence and trust in the results, you may consider using only your advanced models and not only get better predictions but also save a lot of manual works. Luckily this is exactly what SAP Profitability and Performance Management Solution does with the Agile Plan and Forecast business content. You only need to connect your data sources and adjust your manual planning assumptions and as a result you get a fully functional traditional and advanced planning model which you can use in order to improve your future planning. This model includes the manual planning and both algorithms shown above. Furthermore, a planning model based on a clustering machine learning algorithm as well as a stochastic planning model, which is implemented in R Script, are included.

I hope this blog post helps you to get a better view on how to use modern approaches for planning and forecasting and maybe even sparked new ideas for your future development.

I wish you good luck with your next planning project and happy coding, let’s meet up in another blog post.
1 Comment