In ePP/DS, the Material Requirements Planning and Detailed Scheduling is performed by heuristics.
In SAP Terminology, a heuristic is a method of problem solving in Production Planning and Detailed Scheduling which uses rules that have been determined by experience or intuition rather than by optimization. In contrast to optimization, a heuristic does not aim to find an optimum solution by minimizing an objective function, but rather deals with specific planning problems by using a rule-based approach. A heuristic is a planning function that executes planning for selected objects (in this way, the focus of planning can be products, orders, operations, resources, or line networks) using a particular algorithm.
In the standard version of PP/DS for SAP S/4HANA, a range of heuristics are available for various tasks in Production Planning and Detailed Scheduling.
You can choose between standard algorithms to solve specific planning tasks. You can vary particular settings of each algorithm and in this way use the same algorithm for different heuristics. It is possible to use SAP algorithms to define your own heuristics. You can even develop your own heuristic in custom code.

Heuristics are defined in Customizing. To define a heuristic, you must select an algorithm and define the settings (control parameters) for the heuristic.
SAP standard heuristics are available for a multitude of areas: Procurement Planning, Detailed Scheduling, Process Control, Block Planning, Campaign Planning, Service Heuristics for Particular Planning Tasks, and more. In this lesson, only a subset of heuristics is introduced that has some relevance in the context of optimization. These heuristics can be grouped into the following areas:
Procurement Planning for Production Planning
These heuristics are mainly for lot sizing procedures with planning focus on the products. Heuristics for the production planning process are particularly important here.
Process Control
These heuristics, which you use in the production planning run, consider any particular heuristic that can be specified in the product master for the individual products.
Service Heuristics
These heuristics provide supporting functions like stage-numbering or reexplosion of orders. The service heuristics are primarily used in the context of capacity planning and optimization.
Detailed Scheduling
These heuristics are for scheduling; their planning focus is on resources and operations. Examples of such heuristics are reduced lead-time and dissolve backlog.

The heuristics most relevant for Production Planning are highlighted in the following figure.

Heuristics are used in interactive planning, the SAP S/4HANA Digital Core MRP Live or in the Advanced Planning (PP/DS) production planning run. In the Advanced Planning (PP/DS) production planning run, you can execute several heuristics, which belong to both production planning and detailed scheduling, for the same products in one planning run. The service heuristics are primarily used in the context of capacity planning and optimization, that is, in the step after material requirements planning.
The product heuristics can be entered in the product master and affect the planning of this product in the planning run. The SAP_PP_002 Planning of Standard Lots heuristic is used to set "normal" planning for a product. On the Advanced Planning tab page in the SAP S/4HANA material master, you can specify a heuristic for product planning in PP/DS for SAP S/4HANA, if the product is not to be planned using the standard heuristic defined in Customizing. In the planning procedure in Customizing, you can enter the standard product heuristic that you want to use to plan the products for which no heuristic has been defined in the product master.
The product heuristic entered in the material master controls the planning of this product in the material requirement planning run. Lot sizing procedures can be implemented using these heuristics.

The static, periodic heuristics are more simple procedures:
Heuristic SAP_PP_002 (planning of standard lots) is able to create new receipts. To determine the procurement quantities, the heuristic uses the standard lot sizing procedure and the lot size settings from the location product master or from the heuristic settings. This depends on whether you have set the Use Lot Size from Heuristic indicator on the Lot Size tab page.
Heuristic SAP_PP_004 (planning of standard lots in three horizons) is used to plan in up to three different horizons with different lot sizing procedures. The horizons - generally a short-term horizon, a medium-term horizon, and a long-term horizon - follow on from each other seamlessly, and the short-term horizon begins at the start date of the heuristic. You define the duration of the short-term horizon and the medium-term horizon in the heuristic settings by entering a period type and various periods. The number of periods includes the current period in which you start the heuristic.
Heuristic SAP_PP_007 (reorder point planning) executes reorder point planning for location products. It creates procurement proposals if the available stock for a location product falls below the reorder point for the location product. The available stock is the sum of the location stock and the receipts for the location product. The reorder point is specified in the location product master.
Heuristic SAP_PP_C001 (planning of standard lots for continuous IO) allows you to plan products for which continuous requirements or receipts can occur. A continuous requirement is a requirement that does not occur at a specific time. But that continuously increases over the duration of the activity until it reaches the total requirements quantity. The same applies for continuous receipts. Continuous requirements and receipts occur frequently in repetitive manufacturing or in the process industries. For the schedule, the algorithm uses the lot size settings from the product master. This heuristic can be compared with the heuristic SAP_PP_002 for planning standards lots, that you use for planning discrete requirements and receipts.
The heuristics with optimizing procedures follow more sophisticated algorithms:
The Groff reorder procedure (SAP_PP_013) uses the fact that when costs are minimized according to the classic lot sizing formula, the additional storage costs are the same as the saving in the order costs. Thus, the extra costs created by increasing the lot size are compared with the resulting savings made in the order costs. During this procedure, the algorithm - starting from a particular period - groups together the requirement quantities to form a lot until the average storage costs per period are greater than the reduction of the order costs per period.
Part period balancing (SAP_PP005) is a procedure in requirements planning for calculating the lot size that strives to optimize the ordering costs and storage costs. Starting from the material shortage date, consecutive requirement quantities continue to be collected in a lot, until the total storage costs exceed the setup costs. Ordering costs (or setup costs) are mostly presumed to be fixed; this can be represented in the cost function (Procurement tab page in the product master).
Both heuristics subsequently create receipt elements to cover these requirement quantities. The requirements could be sales orders, planned independent requirements, transport requirements, or dependent requirements. Depending on the existence of transportation lanes or production data structures as well as on the procurement type in the product master, receipt elements for in-house production or for external procurement are generated. During the calculation of receipt quantities, the parameters from the Lot Size tab page in the product master are considered. The ordering costs are calculated based on the cost function or the procurement costs from the Procurement tab page in the product master. The higher priority lies on the cost function, meaning that if both fields are maintained, the system uses the cost function. If no data is maintained, an error occurs.
Heuristic SAP_PP_006 plans the purchase order quantities for a product, taking requirements (sales orders, planned independent requirements, transportation requirements, or dependent requirements), storage costs, and suppliers into consideration. In particular, different delivery periods and different discount scales, dependent on the purchase order quantity, are considered for the supplier. The algorithm determines the unit costs for each supplier. You must specify in the heuristic settings if the algorithm should consider storage costs. The algorithm groups requirements together until the best discount class is reached or the unit costs start to rise again. By grouping together the requirements, the discount scales can be skipped. If this happens, the algorithm also determines the unit costs for the discount scales in between. The algorithm selects the purchase order quantity that has the lowest unit costs of all the alternatives investigated. The algorithm then creates new receipt elements to cover these requirement quantities.
Heuristics for the production planning run are only used for process control. When the individual product is planned, the heuristic that has possibly been entered in the product master is executed. If you have not specified a heuristic in the material master, the SAP S/4HANA PP/DS system uses the default heuristic in the planning procedure.

When you use the Product Planning (Components According To Low-Level Code) process heuristic (SAP_MRP_001), the products are always planned in the sequence of the low-level codes. If the planned order for a component cannot be created until after the dependent requirement, it is assigned an alert and this delay is not propagated upward: the planned order for finished product A remains on time. Therefore, date / time alerts usually arise at component level.
Functionally, the process with the SAP_MRP_001 heuristic corresponds to the MRP run in SAP S/4HANA. In particular, this process is very fast and is therefore especially suitable for mass applications.
Heuristic SAP_PP_022 (demand propagation heuristic) is used in external procurement scenarios to derive the dependent demands for a product in a source location, by propagating the demands for the product in all target locations in the supply chain network. The heuristic can be executed for one level or across all levels in the supply chain network. The heuristic is executed at a location-product level. It determines all target locations that source from the chosen location and executes the MRP for the product in the target location. The MRP is executed according to the low-level codes for the location-products.
In product interchangeability, PP/DS planning must ensure that requirements for a discontinued product are covered by a valid successor product and that surplus stock of a discontinued product (if allowed) is used to the requirements of a successor product. It requires that products, which belong to a supersession chain, are always planned together and in the sequence defined through the supersession chain. This is the only way to prevent surplus stock arising for a discontinued product or requirements remaining uncovered. The task of heuristic SAP_PP_I001 is to call up the relevant product heuristic for products in a supersession chain consecutively and in the correct order. Therefore, the algorithm is used as a dispatcher. The product heuristic decides which requirements and stocks of a discontinued product must be forwarded to the successor product, depending on the relationship type between the product and successor product and the use-up strategy.
The algorithm identifies the products in a supersession chain based on the fact that they belong to a planning package of type 001. The system automatically groups the products in a supersession chain when you assign an interchangeability group for a supersession chain to a location. The heuristic is automatically executed, if you plan a product from a supersession chain in interactive planning or in the production planning run using an MRP heuristic (therefore, also when the product heuristic is called in interactive planning). Since the MRP heuristic executes the preparations for processing the planning packages, you can only call up the heuristic SAP_PP_I001 using the MRP heuristic and not directly.
The service heuristics are primarily used in Detailed Scheduling in the context of capacity planning and optimization following to the material requirements planning. MRP Live will not perform service heuristics. So, it is necessary to coordinate the production planning with MRP in MRP Live and detailed scheduling in Advanced Planning.

Heuristic SAP_PP_009 (rescheduling bottom up) is used to create a planning situation in which dependent and stock transfer requirements for a location product have no shortages or as few as possible. During the planning process, requirements dates/times and availability dates/times can change for a location product. These changes can lead to shortages arising for dependent and stock transfer requirements that have to be made up for. The heuristic determines if their dependent and stock transfer requirements can be covered by the existing receipts. In an initial step, the heuristic assigns the existing receipts to the requirements. In the case of orders for which dependent and stock transfer requirements can be covered by the existing receipts, the heuristic tries to shift the requirements dates/times in a second step such that the receipts cover these requirements as punctually as possible. The heuristic reschedules the order activities to which the components are assigned. Depending on the detailed scheduling strategy used, the heuristic considers order-internal relationships here and also adjusts the availability dates/times of the orders accordingly. The heuristic carries out forward scheduling starting from the receipt element of the component.
This heuristic SAP_PP_008 (rescheduling bottom up for continuous IO) can be used for continuous or discrete requirements and receipts. Before using the heuristic, the situation is such that planning has caused receipts to be shifted from requirements, and some requirements are therefore no longer covered in time. The heuristic tries to reschedule all requirements so that they are covered. Only dependent requirements from stock transfer and in-house production are considered. Planned independent requirements and sales orders are not affected by the heuristic. The procedure considers components on the same level. The aim is therefore always to achieve an optimum that is sufficient for all components. After the heuristic is executed, all requirements should be covered in time, provided there is a large enough quantity of receipts. The heuristic also considers lead times, only fully scheduled orders, if required, and a scheduling horizon that you can specify.
You can use the top-down heuristic (SAP_PP_010) in the following situation: Before using the top-down heuristic, the situation is such that planning has caused receipts to be shifted from requirements, and some requirements are therefore no longer covered. The heuristic tries to reschedule all receipts so that they cover all the relevant requirements (including safety stock requirements). Stocks and safety stock receipts are not shifted by this heuristic. The heuristic carries out backward scheduling and schedules the orders infinitely.
You can use the SAP_PP_019 or SAP_PP_011 heuristics to create or delete pegging relationships collectively.
If you enter priorities in the sales order, these are inherited in the assigned planned order. This can cause problems if you have a planned order with a priority that later, in a new situation, is linked to another sales order (with a different priority) because the priority in the planned order cannot be changed when the pegging relationships are formed again. For such a situation, you can use the service heuristic SAP_PP_012, to adjust the priorities in the planned order to the priorities of the linked sales orders.
Heuristic SAP_PP_LLC determines the low-level codes for the selected location products. The low-level codes are calculated from the items of the location products in the relevant BOMs (production structures). A finished product usually has low-level code 0, components have low-level codes 1, 2, 3, and so on, depending on the BOM levels in which they occur. Low-level codes define the sequence in which products are planned according to low-level codes (first products with low-level code 0, then products with the low-level code 1, and so on). In Production Planning and Detailed Scheduling (PP/DS), you can execute planning according to low-level codes using the standard heuristic SAP_MRP_001, for example. To define a planning run for planning products according to low-level codes, you define a production planning run that executes the calculation of the low-level codes (for example, using the standard heuristic SAP_PP_LLC) in the first processing step and calls the MRP heuristic in the second step.
Heuristics for detailed scheduling are used to schedule selected operations on resources and dates. In the production planning run and the planning board the DS heuristics schedule operations in a particular sequence, resolve backlog or adjust capacity overload. The following detailed scheduling heuristics are used to determine dates/times and resources for operations.

The detailed scheduling heuristics allow you to do the following:
- SAP001 (schedule sequence) - You use this heuristic to schedule selected scheduled operations in a particular sequence in the production planning run and the DS planning board. You specify the scheduling sequence in the heuristic settings. When you start the heuristic for the selected operations, the system deallocates these operations and then schedules them again one after another in the set sequence.
- SAP002 (remove backlog) - You can use this heuristic to remove the backlog in the production planning run and the DS planning board for selected resources; that is, you can automatically reschedule the operations that lie in the past in the planning period to the current date or in the future. The current date and current time is the default for the earliest possible start date for the operations to be rescheduled. You can use the offset time in the heuristic settings to shift the earliest possible start date into the past or into the future.
- SAP003 (schedule sequence manually) - You can use this heuristic in the DS planning board to create a scheduling sequence of your choice for a group of selected scheduled operations and then reschedule the operations in this sequence. You create the sequence of operations manually on a graphical list interface when calling up the heuristic.
- SAP004 (minimize runtime) - You can use this heuristic to reduce the lead time for orders in the production planning run and the DS planning board that carry out operations using selected resources. The system fixes the selected resources and thereby all the operations that are scheduled at these resources. Starting from each fixed operation, the system schedules the other operations of the affected order in such a way that the time intervals between the operations of that order are as small as possible.
- SAP005 (schedule operations) - You can use this heuristic to reschedule selected deallocated operations in the production planning run and the DS planning board.
The stable forward scheduling heuristic (SAP_DS_01) is suitable for exploding backlogs, for adjusting capacity overloads or for adjusting the plan to a changed level of available resource capacity, for example, due to resource stoppages in the short term. If, for example, a weekly detailed scheduling is carried out for the medium term, for example using the PP/DS optimizer, stable forward scheduling can be used to adjust the plan daily for the short term.
The stable forward scheduling heuristic adjusts a given production plan to the new conditions across multiple production levels and on multiple finite resources by rescheduling the orders. When doing so, it attempts to retain the original sequence of the operations on the resources. Furthermore, the resource assignment of the processes is not changed, that is, alternative resources are not used.
The heuristic can be used both interactively in the detailed scheduling planning board and in the background in the production planning run. In the production planning run, this heuristic is also suitable for large volumes of data.
The following figure illustrates an example. Several problems are illustrated. The first problem is a capacity overload. The second problem is the existence of backlog and the third problem is the violation of internal and pegging relationships.

The following constraints are considered by the stable forward scheduling heuristic:
- Resource capacity
- Availability dates
- Planned delivery times
Fixed operations are not changed by the heuristic. Backlogged operations are moved into the future. Capacity overloads are resolved. The order sequence is not changed. Operations on resources can be moved into the future. Resource assignment is not changed. Relationships between operations and pegging are considered. Customer dates can be violated.

Once the stable forward heuristic is executed for the example, the problems are gone. Now, there is no capacity overload anymore and internal relationship and pegging relationship links are considered. The backlog has been resolved and all operations are scheduled in the future. However, the requirement dates of the orders are now getting violated.



