Show TOC

 BAdI: Change Data for PP Heuristics

Use

You use the /SAPAPO/RRP_HEUR_DO BAdI in order to include the possibility of deleting and creating fixed pegging relationships in the MRP run. The BAdI is called up before or after a PP heuristic is carried out.

Features

BAdI Methods

The following methods are available:

  • BEFORE

    You can use this BAdI to change data before a PP heuristic is called up.

  • AFTER

    You can use this BAdI to change data after a PP heuristic has been called up.

Heuristics of Fixed Pegging in the MRP Run

You use this BAdI in order to include the possibility of deleting and creating fixed pegging relationships in the MRP run. If you insert, for example, the heuristics SAP_PP_019 (Creation of fixed pegging relationships) and/or SAP_PP_011 (Deletion of fixed pegging relationships) in the BEFORE method, the heuristics are carried out before the net requirements calculation in the MRP run. The net requirements calculation then considers all pegging relationships in the MRP run. This procedure makes sense if you want to create fixed pegging relationships for a customer requirement on all production levels.

Include Fixed Pegging in the Net Requirements Calculation

You can include fixed pegging in the net requirements calculation by setting the parameters for deleting and creating pegging relationships in the BAdI method:

  • DELETE_FIXPEG together with the parameter DEL_PEGGING_TYPE (pegging type)

    You use this indicator to define that the system should delete fixed pegging relationships (pegging relationships that were created manually, pegging relationships that were created automatically, or all of them) during the MRP run according to the results of the net requirements and the lot-size calculation. The system deletes the fixed pegging relationships between the following receipt elements and requirements:

    • Fixed receipt elements and requirements that were assigned to each other in the net requirements calculation

    • Receipt elements and requirements that are not fixed and that were assigned to each other using the lot-size calculation

      Deletion of fixed pegging relationships is integrated in the SAP_PP_002 heuristic ( Planning of Standard Lots ), that is, if the indicator is set, the fixed pegging relationships are automatically deleted when this heuristic is carried out. The pegging horizon is not considered.

  • CREATE_FIXPEG

    You use this indicator to define that the system should create fixed pegging relationships during the MRP run according to the results of the net requirements and the lot-size calculation. The system creates the fixed pegging relationships between the following receipt elements and requirements:

    • Fixed receipt elements and requirements that were assigned to each other in the net requirements calculation

    • Receipt elements and requirements that are not fixed and that were assigned to each other using the lot-size calculation

      Creating fixed pegging relationships is already integrated in the SAP_PP_002 heuristic ( Planning of Standard Lots ). If the indicator is set, the fixed pegging relationships are automatically created when this heuristic is carried out The system creates the pegging relationships according to the assignment logic of the net requirements calculation. It does not consider the priorities of the requirements and the pegging horizon.

The advantage of this procedure is that you can create/delete fixed pegging relationships directly during the net requirements/lot-size calculation. The system creates the fixed pegging relationships according to the assignment logic of the net requirements calculation.

Example

Example 1

SAP provides example code for the BEFORE method. In order to display the example code in the BAdI, choose Start of the navigation path Goto Next navigation step Sample Code Next navigation step Display End of the navigation path in the BAdI. The example code includes calling the SAP_PP_011 heuristic ( Deleting Fixed Pegging Relationships ) and setting the CREATE_FIXPEG parameter, with which you can trigger the creation of fixed pegging relationships with net requirements/lot-size calculation.

In this way, the system creates the fixed pegging relationships directly in the MRP run. The system creates fixed pegging relationships directly in the MRP run for all assignments between receipt and requirements elements that were created during the MRP run. This ensures that all material flow relationships of the MRP run are fixed entirely and correctly.

Example 2

In the ATP process, you want the system to create fixed pegging relationships directly in the MRP run on a multi-level basis. For example code, see Preparing the Production Planning Run and the BAdI Implementation .