Explaining Heuristics

Objectives

After completing this lesson, you will be able to:
  • Explain how heuristics are used in PP/DS.
  • Explain heuristic planning of standard lots.

Heuristics in PP/DS

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.

The figure defines heuristics: A heuristic is an algorithm, which can perform a planning function for selected objects. Heuristics are defined in customizing and customer-specific heuristics are possible. Heuristics consist of an algorithm and control parameters. They offer a great bandwidth of planning functionality, which can be used interactively or in background.

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 figure lists various information related to heuristics: Planning objects of heuristics are resources, orders, operations, and products. heuristics are used in the production planning run, product view, detailed scheduling planning board, product planning table and others. Production planning heuristics are mostly lot size procedures with focus on products. Detailed scheduling heuristics are used for scheduling and focus typically on resources and operations.

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

The figure lists the most important heuristics for procurement planning, process control, and service heuristics. These are for procurement planning: SAP_PP_002 (planning of standard lots), SAP_PP_004 (planning of standard lots in three horizons), SAP_PP_007 (reorder point planning), SAP_PP_C001 (planning of standard lots for conti-IO), SAP_PP_005 (part period balancing), SAP_PP_006 (least unit cost procedure for external procurement), and SAP_PP_013 (Groff procedure). For process control these are: SAP_MRP_001 (product planning run for product levels), SAP_PP_I001 (heuristic for supersession chains), and SAP_PP_022 (multilevel planning of individual orders). The following service heuristics are listed: SAP_PP_008 (rescheduling bottom-up for conti IO), SAP_PP_009 (rescheduling bottom-up), SAP_PP_010 (rescheduling top-down), SAP_PP_011 (delete fixed pegging edges), SAP_PP_012 (change order priorities), SAP_PP_LLC (stage numbering algorithm), and SAP_PP_018 (create safety stock).

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 figure groups the heuristics for procurement planning into two groups. Those that are static/periodic and those that are optimizing procedures. To the first group, the following heuristics belong: SAP_PP_002 (planning of standard lots), SAP_PP_004 (planning of standard lots in three horizons), SAP_PP_007 (reorder point planning), and SAP_PP_C001 (planning of standard lots for conti-IO). To the optimizing procedure, the following heuristics belong: SAP_PP_005 (part period balancing), SAP_PP_006 (least unit cost procedure for external procurement), and SAP_PP_013 (Groff procedure).

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.

The figure illustrates the effect described in the following paragraph: 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.

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.

The figure lists service heuristics: SAP_PP_008 (rescheduling bottom-up for conti IO), SAP_PP_009 (rescheduling bottom-up), SAP_PP_010 (rescheduling top-down), SAP_PP_019 (fix pegging relationships) SAP_PP_011 (delete fixed pegging relationships), SAP_PP_012 (change order priorities), and SAP_PP_LLC (stage numbering algorithm).

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 figure lists detailed scheduling heuristics: SAP001 (schedule sequence), SAP002 (dissolve backlog), SAP003 (schedule sequence manually), SAP004 (minimize leadtime) SAP005 (schedule deallocated operations), and SAP_DS_01 (stable forward scheduling).

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 figure illustrates in a Gantt chart situations for which the stable forward scheduling heuristic is suitable to be used. One problem is a capacity overload, the second problem is the existence of backlog and the third problem is the violation of internal or 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.

The figure illustrates in a Gantt chart the result of executing the stable forward scheduling heuristic based on the example from the previous figure. Now, there is no capacity overload any more and internal relationship as well as 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.

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.

Heuristic SAP_PP_002 - Planning of Standard Lots

Planning of Standard Lots (SAP_PP_002)

The heuristic SAP_PP_002 (function module /SAPAPO/HEU_PLAN_STANDARDLOTS) is an algorithm that executes planning to cover product requirements, and can create new receipts at the same time. During the planning, the algorithm uses the lot size procedure and settings from the product master or from the heuristic settings.

The heuristic settings include the following:

  • Sort Procedure: Determines the sequence in which the system processes requirements with shortages, when planning shortages.
  • Reuse Mode: Regulation that defines if the system has to check if it can reuse old not fixed orders or/and has to reexplode orders during planning of a product.
  • Plan with Shelf Life: If this indicator is set, the heuristic considers maturity and shelf life for product receipts and requirements for shelf life.
  • Group Past Requirements: If this indicator is set, the system combines noncovered requirements that lie in the past and in the planning time fence to one total requirement after net requirements calculation.
  • Consider Shortages Outside the PP/DS horizon: If this indicator is set, the system temporarily sets the uncovered requirements at the end of the PP/DS horizon and plans these.

  • Lot Sizes Dialog Box: If this indicator is set, the system provides the possibility to change product master settings interactively in the planning run.
  • Generate evaluation: If this indicator is set, the system writes a report for the heuristic run in interactive planning.

The program flow is illustrated in the following figure:

The figure illustrates the program flow of the heuristic SAP_PP_002 as explained in the subsequent paragraph.

First, the heuristic executes a net requirement calculation. The existing PP-firmed receipts are consumed by the requirements taking the fixed pegging relationships, as well as maturation and shelf life constraints (if defined in the heuristic settings) into consideration. Second, the heuristic executes a procurement quantity calculation for the uncovered requirements identified by the net requirement calculation. The heuristic processes the uncovered requirements in the sequence that you defined in the Sorting Procedure field. To be able to calculate the procurement quantities for a requirement, the heuristic uses the lot sizing procedure that you have defined in the location product master. The heuristic executes source determination based on the procurement quantities and the desired availability dates/times. The heuristic plans each newly created order on the resources, starting from the desired availability date/time of the order. The algorithm has to schedule an order so that the availability date/time lies after the PP/DS planning time fence. If you have chosen the reuse mode Use Suitable Receipts in the heuristic settings, the heuristic compares the newly created orders with the existing PP/DS orders in the reuse interval that are not PP-firmed. Finally, if an old order corresponds to a new order, that is, if the old order matches a new order regarding quantity, source of supply, characteristics and - in the case of discrete receipts - order priority, the heuristic retains the old order and deletes the new one. Old orders that do not correspond to a new order are deleted by the heuristic.

Three procedures exist for the net requirements calculation:

  • First-in, First-out
  • Avoid Surpluses
  • Avoid Delays

Note that pegging is not the basis of the net requirements calculation!

The figure illustrates the concept of FIFO net requirements calculation. Receipts are indicated by a blue line and requirements are indicated by a red line. The length of the line should represent the size of the receipt/requirement.

In this procedure, the system assigns the fixed receipts and stocks to the requirements in a chronological order. The stock or the earliest fixed receipt element is assigned to the earliest requirement, regardless of whether the requirements date lies before or after the availability date. The next receipt element is then assigned, and so on.

Net requirements calculation to avoid surpluses includes three steps to determine uncovered requirement quantities.

The figure illustrates the concept of net requirements calculation to avoid surpluses. Receipts are indicated by a blue line and requirements are indicated by a red line. The length of the line should represent the size of the receipt/requirement.
  1. Receipts that lie within the planning time fence are assigned to requirements that also lie within the planning time fence, using FIFO logic.
  2. Receipts that lie after the planning time fence are only assigned to the requirements if they can cover these requirements on time.
  3. Delayed receipts are assigned to the requirements despite being delayed in order to avoid surpluses caused by the creation of new receipt elements.

Net requirements calculation to avoid delays operates with a similar logic to net requirement calculation to avoid surpluses. The only difference between the two is that in step 3, delayed receipts are not assigned.

Lot size procedures are taken from the product master and can be changed in an interactive planning in the lot size pop-up.

The following lot size procedures exist:

  • Lot-for-lot
  • Fixed lot size
  • Periodic lot size
  • Reorder point procedures (1 and 2)
  • Periodic lot size with period factor
  • Reorder days’ supply

Also, the following parameters are considered:

  • Minimum lot size
  • Maximum lot size
  • Assembly scrap
  • Rounding value
  • Rounding profile
  • Target days’ supply
  • Period factor
The figure illustrates the concept of lot size procedures: lot-for-lot, minimum lot size, fixed lot size, and periodic lot size.

Log in to track your progress & complete quizzes