An Introduction to AMDPs for Integrated Planning

  • by Charles "Tim" Soper, Senior Education Consultant, SAP
  • April 6, 2016
Learn how to use standard planning functions that come with SAP BW Integrated Planning (SAP BW IP) to implement your own custom planning functions and program them to call SAP HANA-stored procedures. Learn how to set up an ABAP Managed Database Procedure and why this approach provides the best performance boost.
Learning Objectives

By reading this article, you will learn how to:

  • Position ABAP Managed Database Procedures (AMDPs)
  • Create a table in SAP HANA along with a SQL script for testing
  • Create an ABAP class that calls an SAP HANA-stored procedure
  • Create a custom function type and planning function
  • Test the planning function in SAP BusinessObjects Analysis, edition for Microsoft Office
Key Concept
SAP BW Integrated Planning (SAP BW IP) runs on SAP Business Warehouse (SAP BW), which can either sit on a traditional database, such as Oracle or Microsoft SQL, or on SAP HANA. When SAP BW uses the SAP HANA database, SAP BW IP planning functions can be created with ABAP Managed Database Procedures (AMDPs) that result in the most efficient solution for complex scenarios.

SAP BW Integrated Planning (SAP BW IP) comes delivered with a variety of standard planning functions such as copy, delete, and distribution, for example, which are used in straightforward scenarios. However, when a company needs to perform a more complex planning calculation, it can implement its own custom planning functions and program them to call SAP HANA-stored procedures for the best performance. For example, a company may want to perform an allocation or a rolling forecast, both of which involve high data volumes and complex algorithms. Learn why this approach provides the best performance boost for these kinds of calculations and how to set it up.

In this article, I show how to set up the test table in SAP HANA and test your SQL script in the SAP HANA studio SQL console. In addition, I show how to use program RSPLS_SQL_SCRIPT_TOOL to help develop the ABAP code in the custom ABAP class. Finally, I show you how to link the class to a function type, create a corresponding planning function, and test it in SAP BusinessObjects Analysis, edition for Microsoft Office.

ABAP Managed Database Procedures (AMDPs) are used to execute calculations in the SAP HANA calculation engine. AMDPs are created as ABAP classes that execute SAP HANA-stored procedures. On traditional databases, companies would use function modules to do this, but in the SAP HANA database function modules are processed by the application server, not the SAP HANA database; therefore, AMPDs are now the most efficient solution in most cases.

Before I go into the details of how to develop an AMDP, let’s first discuss the business scenario and positioning of AMDPs.

Business Scenario and Positioning

Although quite a few planning calculations can be executed via standard planning functions, frequently companies have calculations that are complex in nature that either involve mass quantities of data or that cannot be performed by standard functions. They therefore require a customized solution. For example, to perform a planning calculation it may be necessary to use a subroutine, use a temporary table to solve a rounding issue, or read data that has not yet been committed to the database. When SAP Business Warehouse (SAP BW) is on a traditional database you would use function modules (an ABAP solution for complex logic), but with SAP BW on SAP HANA, AMDPs are the best solution since they are faster than function modules.

Note
Even with SAP BW on SAP HANA it is still possible to use function modules; however, the processing would occur on the application layer, not the database layer. This is fine when the calculation is not run frequently or has lower data volumes, but in most scenarios, AMDPs are a better solution.

Charles "Tim" Soper

Charles “Tim” Soper is a senior education consultant at SAP. For the last 17 years, he has been teaching SAP classes on a variety of topics in financial and managerial accounting, business warehouse, business consolidations, and planning. He is the planning and consolidation curriculum architect and has written SAP course manuals. He also works as an SAP Senior Educational Consultant. Early in his career, he worked for Eastman Kodak Company in Rochester, NY, as a senior financial analyst. He has an undergraduate degree in economics and an MBA in finance from the University of Rochester.

See more by this author


Comments

No comments have been submitted on this article. 


Please log in to post a comment.

To learn more about subscription access to premium content, click here.