SAP Advanced Planning and Optimization (APO) offers the technology required to streamline complicated planning processes. The system supports hierarchical data structures, giving planners the possibility of focusing on information that has been consolidated into families rather than juggling lots data for individual SKUs, plant, warehouses, etc.
Key Concept
Hierarchies consolidate master data objects into groups. They form top-down and bottom-up relationships that aggregate information for various purposes such as reporting that can be used for planning.
Aggregated
Planning Eliminates Aggravated Planners Planners demand flexibility so they can implement solutions designed for their unique business practices.
SNP technology is customizable so users can focus on those areas that require their attention. While the system can
monitor individual products, it can also be configured to offer views large enough to accommodate an entire supply network
or family of brands. In addition to providing a planning tool that is completely scalable, SNP components such as the user
interface and data management tools can also be maintained to fit each distinct implementation.
Covering topics such as the SNP planning area and planning book, I will provide you with an overview of
how the system displays and aggregates data via the SNP interactive screen. I'll show you a couple instances of how
planners use aggregated information in real-life scenarios. Throughout, I will detail how the system can be customized to
meet the user's demands and explain the functionalities and configuration steps required, including setting up hierarchy
and hierarchy structures, macros via the Macro Builder, and more.
SNP Planning Components
I'll begin by drilling into the interactive screen and showing you some of its components such as planning
books, data views, and planning areas before I take you through two planning scenarios. The screen can be customized to
meet your particular needs and, as I pointed out in my last article, it is supported by hierarchies to provide aggregated
planning functions. This builds on the foundation laid in my first article, which explains the basic concepts behind
aggregated planning and offers a high-level picture of how it's supported by the system via the interactive SNP screen.
Planning books are used to define the content and layout of the SNP interactive planning screen. They
allow you to define various elements found in the screen such as key figures (and other rows) as well as characteristics.
Planning books let you designate the functions and other applications that can be accessed directly by the book. You can
also set user-specific planning horizons and views in the planning book, including the initial column, number of grids,
and accessibility of the view for other users.
The system offers other methods to customize the interactive screen. Elements such as the colors and
indicators displayed and whether rows are hidden or shown can all be maintained for the interactive screen. (See "7
Customizing Tips to Make a Good Interactive Planning Table Great!" below for more tips on customizing the SNP interactive
screen.)
Several standard planning books are available in SNP, including 9ASNP94 for traditional
supply network planning and 9ASOP to plan sales and operations. SAP has added new standard planning books
since the launch of APO 3.x such as one to accommodate subcontracting scenarios added to the technology in SCM 4.0.
Standard planning books can be used as templates for creating your own customized planning books. I'll show you how to
modify the SNP interactive page with the planning books later.
Planning books are based on a planning area. While end users are aware of the planning book, they are not
necessarily aware of the planning area. Like planning books, the SNP module ships with predefined planning areas and you
can also define your own.
The planning area establishes how your planning processes will be executed by the system. It is the
central data structure in SNP and is created as part of the system setup. There is no limit on the number of planning
books you can have for a planning area.
Objects in SNP are saved and maintained based on parameters defined in the planning area, not the planning
book. The planning area specifies the shared unit of measure (UoM) that data will use when planning in SNP as well as the
currency and conversion rates if required. Note that all products must share a common UoM. Storage bucket profiles are
also specified in the planning area as well as the aggregate level, including the lowest level of detail supported by the
SNP interactive screen. In addition, key figures are identified along with the settings that determine how each is
disaggregated, aggregated, and saved, and how key figures are assigned to aggregates.
I recommend copying one of the preconfigured planning areas and defining your own settings, planning
areas, planning book, etc. so you can refer to originally delivered SAP settings later, if required. Over the course of a
project, you may find it helpful to compare your modified settings to those delivered in the SAP standard planning area.
For that reason, it is recommended that you only work with a copied planning area and do not modify the settings in the
original. For the scenarios presented in this article, I copied the SAP-delivered planning book 9ASNP02
for order-oriented planning and created ZAMF_SNP02 for performing hierarchical planning.
Maintain Hierarchies
The planning area settings support aggregated planning. Follow menu path APO>SNP>
Environment>Current settings>Administration of Demand Planning and SNP or use transaction code
/n/SAPAPO/MSDP_ADMIN to access these settings. I suggest always using menu paths in APO.
Let's look at the two tabs relevant for hierarchical planning (Key figs and
Hierarchical Planning) in the scenarios I'll present later. Other scenarios or business requirements may
require you to use the other tabs in this screen.
The Key Figs tab in Figure 1 allows you change settings and adapt key
figures so they will meet your requirements. The default settings for key figure 9AFPROD, which contains
data for production orders, can be changed to provide the aggregated information for your specific planning process.
Change the default value from blank (No Aggregation), to 1 (Aggregate at group
level) and the system will aggregate production orders.

Figure 1
Use the Key Figs tab to define aggregation level
The Hierarchical Planning tab maintains the link between hierarchies and the planning
area information and determines how the system aggregates transactional data and stock information. Data is collected and
structured according to the aggregation rules defined in the hierarchies.
Hierarchy structures, also known as "hierarchy skeletons," are delivered with SCM. Follow menu
path IMG>APO> Master Data>Hierarchy>Define Hierarchy Structure to review these structures
(Figure 2). After the structure has been defined, adding master data objects to the nodes creates
hierarchies.

Figure 2
The IMG provides/supports customization for aggregating data at various levels
Planning Book Setup
After configuring the internal hierarchical functionality delivered by SAP and employed in the planning
area, you need to perform some maintenance to the planning book itself. As I noted earlier, the planning book allows you
to customize the user interface and access data management tools. In addition to defining the relevant content with key
figures, the layout of the interactive planning screen can be changed using data views to define different views or grids
to display data.
SCM 4.0 ships with preconfigured planning books and data views for hierarchical planning. They are linked
to planning area 9ASNP02, planning book 9ASNPHRPL, and data views
SNPHRPL for product planning and SNPHRPL(2) for capacity checks.
The biggest difference between the standard planning book 9ASNPHRPL delivered with SCM
4.0 and 9ASNP94 delivered with earlier APO releases is the inclusion of new key figures to define the
layout and support aggregation and disaggregation, along with some new macros to perform different calculations. Macros in
SNP are similar to those found in spreadsheets. They perform a set of tasks that are executed automatically by the system.
I'll discuss them in more detail later.
In order to create a planning book and data views for planning, follow menu path APO>SNP>
Environment>Current Settings>Define Planning Book or use transaction code /n/SAPAPO/SDP8B.
Copy the SAP-delivered planning book and data view and customize them as required. In this case, I copied the planning
book 9ASNPHRPL and data view SNPHRPL. Then I created ZAMF_9ASNPHRPL and
ZAMF_SNPHRPL so I can change the layout by adding new key figures, maintain them for display only, and so
on.
After it's copied, the planning book must be assigned to the appropriate
planning area because it will remain linked to 9ASNP02. Save it and remain in the maintenance
transaction /n/SAPAPO/SDP8B. Select the Assign planning area option in the
Edit menu and choose the appropriate planning area for the new planning book. In my examples, I assigned
it to planning area ZAMF_SNP02.
Note that after copying the planning book, the warning message Macros were copied and are
inactive is displayed. The macro is activated in the Macro Workbench, which is accessed via transaction
/n/SAPAPO/ADVM or by following the menu path APO>SNP>Environment> Current
Settings>Macro Builder. You can also search your planning book, select all the macros, and click on the
Activate icon. The red light indicator, which means the macros are inactive, turns to a green light when
the macros are properly activated. As I will show you later, macros can be a critical element for the proper functioning
of your planning area.
Interactive Planning
Now that the planning area and planning book are customized, let's use the interactive planning screen in
a couple of real- life scenarios. I noted both of these planning projects in my first aggregated planning article. One
involves a company that produces a number of products under the same brand but in different sizes and labels. Aggregating
the various SKUs into product families makes the planners' job much easier. The second scenario highlights how you can
plan for replenishing a central warehouse that must supply several smaller distribution centers, which have been
outsourced to a third party. Aggregated planning allows all of the facilities to be grouped together to streamline the
effort.
Let's start with planning for the various products in a branded family. First, access the interactive SNP
screen via menu path APO>SNP>Planning>Interactive SNP (All Books) or use transaction code
/n/SAPAPO/SDP94. Planning objects are loaded via the shuffler. The shuffler is the window in which you
select objects for products, locations, resources, etc. that you need for your plan, including the planning version,
location, and product. Selections can be saved and loaded for future use with this transaction.
The basic SNP planning process involves a heuristic function run followed by a capacity-leveling run.
Clicking on the Heuristic icon initiates the planning process, which takes the relevant aggregated key
figures into account as the heuristic is run including netting, lot sizing, etc. In the branded product scenario, orders
are accumulated from products existing at lower levels of the planning hierarchy. When the capacity-leveling function
runs, it focuses on a product family instead of an individual item, which results in new lead times or processing times
based on an average of all the individual product lead times in the family.
After generating planning results for a product family, SNP then allows for "disaggregation." This is the
opposite of the aggregation step and supports specific materials requirements planning such as generating labels for
various SKUs under a particular brand. Disaggregation allows the remaining activities to be linked back to the second
level of the hierarchy and provides access to specific data about objects in the second hierarchy. While aggregation runs
automatically when we load data based on a hierarchy, the disaggregation function must be executed.
After planning is complete at the product group level, the data must be distributed from the top level to
all the items in the second level. Clicking on
launches this process and the
system searches for children based on the hierarchy assigned to the planning area. It retrieves the basic unit of measure
(UoM) for the group product, reads the demand key figure and supply at the product group, and it converts to the proper
UoM. Next it checks the sources of supply and then disaggregates replenishment data bucket by bucket with a logic similar
to that used by the system for distribution resource planning (DRP).
The Net requirements (Disaggregation) key figure, technically called
NETDM, is used to perform this last task. I suggest displaying the key figure NETDM. It
allows you to check the accumulated values for each item in your custom
ized data view, which is named ZAMF_SNPHRPL in my example. Right-click key figure
NETDM and change its properties in the Data View Maintenance screen so it is not
hidden.
As information accumulates, a macro fills key figure NETDM with the relevant data
regarding how much each product contributes to the total demand. The macro can be adapted using this key figure to
accommodate your specific business requirements.
When a quantity is disaggregated, its value is displayed in the interactive screen via key figures
labeled Aggregated to indicate that the planned information at the aggregated level has been
disaggregated to the lower levels. In Figure 3, the key figure Production (Planned) is
transferred to Aggregated production (plnd). To ensure the appropriate values are being use at the second
level of the hierarchy, you can check item level information via data views such as ZAMF_PROD1KG in this
example, which shows the disaggregated production values are present (Figure 4).

Figure 3
Data at the Product Group level is disaggregated

Figure 4
Child product (ZAMF_PROD1KG) after disaggregation
Scenario Number 2
Let's take a look at another scenario to see how aggregation supports planning when data is accumulated
from several locations. In this scenario, a company has outsourced some its distribution centers to a third party, which
is supplied from a central warehouse. The planning solution must accommodate all stock levels in the geographical area for
the distribution centers and the central warehouse.
For this scenario, the product data related to stock for all locations must be aggregated. This is
accomplished using hierarchies based on the structure displayed in Figure 5. The data from the two
distribution center locations (Santander and Coruña) is accumulated into a top-
level location (Oviedo), which represents the central warehouse.

Figure 5
Planning hierarchy for data aggregation at several locations
Because these hierarchies are not delivered with APO settings, they must be maintained via SAP APO
Customizing. Start by creating a hierarchy structure (or skeleton) following menu path IMG>APO>Master
Data>Hierarchy>Define Hierarchy Structure. Create the individual hierarchy ZAMF_PRODUCT to
handle products. Its node types will represent product data. Note in Figure 5 that hierarchy ZAMF_PRODUCT
contains only one level (101) but it's used to generate two levels within the next hierarchy.
Tip!
When new hierarchy structures are created, you must save the data before you define the corresponding hierarchical levels.
Hierarchy ZAMF_LOCPROD is generated from REL_LOKATION and
ZAMF_PRODUCT. Assign individual hierarchies to the generated hierarchies. Create aggregated levels such
that the generated hierarchy has two levels: Location Group – Product and Location Product. In the
final step, define the level assignment of the generated hierarchy structure as summarized in Figure 6.
Note that the two new hierarchy structures created to support this scenario include ZAMF_PRODUCT and
ZAMF_LOCPROD.

Figure 6
Summary of the hierarchy structure for Location Group- Product
Once the structures are built, the final hierarchies are created via IMG>APO>Master
Data>Hierarchy>Define Hierarchy.
The location hierarchy contains the main warehouse information, which represents the parent node for
location planning. The third-party distribution centers are assigned as children (Figure 7). The product
hierarchy is flat with only one level. Products are assigned to the root to inform the system which products to consider
during the aggregation of stock calculations. The generated hierarchy ZAMF_H_LOCPROD is automatically
updated from individual hierarchies.

Figure 7
SAP-delivered location hierarchy SNP_LOC_HIER with the customized hierarchies
Disaggregation Not Required
Planning activities for multiple sites do not differ from the tasks described in the first scenario. The
planning data is loaded into the SNP interactive planning page and the heuristic is executed. For this multiple site
scenario, however, disaggregation is not required. The stock levels at the third-party warehouses have been aggregated
into the main warehouse and do not need to be calculated for each individual site.
Tip!
If modeling certain rules with macros is not enough, you can use the Business Add- In (BAdI) /SAPAPO/SDP_DISAGG to develop an algorithm that better supports your user-defined disaggregation. BAdIs allow you to incorporate custom ABAP code to buttress your disaggregation method and make it fit your business requirements.
Because aggregated information for demand and replenishment elements are not required, a simpler planning
book can be used and the aggregated key figures do not need to be managed. You only need to copy planning book
9ASNP94 and data view SNP94 (1) and link it to your planning area.
While a simpler planning book can be employed, this scenario requires a modified macro. In the first
scenario, I only needed to activate the delivered macros, which were enough to handle the required tasks. In this case,
however, to fill the key figures Stock Main DC and Stock Secondary DC (Figure
8), new steps must be added to the original macro delivered with planning book 9ASNP94. See the
sidebar "Create Custom Macros with Macro Builder" on page 6 to understand how this is done.

Figure 8
SNP interactive planning screen indicating stock levels at warehouses
This planning scenario focuses on all the products on hand in the main warehouse, which is represented by
ZAMF_OVIEDO. I have introduced the transactional data in Table 1 to demonstrate how the
functionality works.
Stock at All Warehouses |
Demand on Oviedo DC |
Coruña = 10 |
19.7.2004 = 500 |
Santander = 50 |
20.7.2004 = 1000 |
Oviedo = 100 |
21.7.2004 = 2000 |
|
Table 1 |
How it works |
Initial Stock Main DC value in Figure 8 corresponds to the stock at
Oviedo in Table 1 (100). The initial Stock Secondary DC value in Figure
8, which is 60, is the sum of initial stock at Coruña (10) plus the initial stock
at Santander (50). The Stock on Hand key figure value
(160) in Figure 8 aggregates all the stock levels at the warehouses in Oviedo,
Coruña, and Santander in Table 1.
During the planning process, the first replenishment element is created at 19.7.2004 to
cover any shortage generated by demands. This replenishment element considers the amount of accumulated stock instead of
individual levels at the main warehouse and two distribution centers during the netting calculations. To cover any
shortage and establish a replenishment plan, run the SNP heuristics for the various locations.
Create Custom Macros with Macro Builder
The Macro Builder allows you to create your own macros in SNP and in the Demand Planning (DP) module. Macros perform calculations quickly and easily, and can be executed in interactive planning or automatically when an event happens.
Using the Macro Builder, you do not need to possess much programming knowledge. In this environment, macros are created by dragging all the required elements into the work area and manipulating them via context menus (Figure 1). Functions are available for a variety of different purposes including mathematical, statistical, logical, planning calculations, and so on.

Figure 1
Macro Builder screen
In the warehouse scenario described in the main article, the delivered macro in planning book 9ASNP94 must be modified to fill key figures Stock Main DC and Stock Secondary DCs.
Start with the original macro and modify it with the new steps indicated in Figure 2. New steps must be added where stock values for the secondary distribution centers and main warehouse are accumulated in the auxiliary key figures created for the SNP interactive screen. These steps are based on the INITIAL_STOCK function. Note that the last parameter (AGGR) controls whether or not a hierarchy is used to calculate stocks.

Figure 2
Modified macro after changes for new stock calculations
In addition, modify the calculation for the aggregated stock on hand as shown in Figure 2.
After checking the macros and ensuring they are working properly, activate them. If you get an error, check that they have been keyed in correctly.

Adolfo Menéndez Fernández
Adolfo Menéndez Fernández is the application architecture manager at Repsol in Madrid. Previously, he worked at SAP Consulting Spain as the logistics consulting manager. He studied at the University of Oviedo, where he earned an electronic engineering degree. He is a certified SAP consultant in supply and demand planning (SNP and DP), order fulfillment (Global Available-to-Promise), production planning and detailed scheduling (PP/DS), as well as procurement and materials management (MM). Adolfo has more than 10 years of SAP implementation experience in the consumer product goods, pharmaceutical, automotive, furniture, textile, chemical, oil & gas, and steel industries using SAP ERP logistic modules (including PP, MM, and sales and distribution [SD]) as well as SAP SCM (DP, SNP, and PP/DS). He is APICS certified in Production and Inventory Management (CPIM).
You may contact the author at asturiasadolfo@yahoo.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.