Ansicht
Dokumentation

/SAPAPO/RRP_ATPNODE_CONVERT - Convert a Node from ATP Tree

/SAPAPO/RRP_ATPNODE_CONVERT - Convert a Node from ATP Tree

RFUMSV00 - Advance Return for Tax on Sales/Purchases   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

The transferred import parameter (structure IS_SCHEDLINE) contains the requirements confirmed by ATP per requirements group. Multilevel ATP (MATP) was able to confirm these requirements, on the assumption that a suitable receipt for the requirement can be created for the confirmed date. MATP checks this assumption by checking the ATP-relevant components. This function module creates a suitable receipt element for the confirmed requirement.

Lot-size calculation

No lot-size calculation takes place. This calculation would result in larger dependent requirements than checked by ATP and the ATP results would no longer be valid. All that takes place is a calculation of scrap and rounding in accordance with the unit of measure.

Explosion

The explosion takes place either using the PP/DS tube or using a new explosion. Using the import parameter IV_READ_TUBE, a decision is made as to whether the order should be created based on the information from the PP/DS tube. In an immediate conversion the import parameter IV_READ_TUBE is set to .X.. If the ATP tree structures are converted at a later time, a reexplosion is triggered by setting the import parameter IV_READ_TUBE to .SPACE., using a report (TR /SAPAPO/ATP2PPDS) or in dialog processing (TR /SAPAPO/RRP_ATP2PPDS). If there is an immediate conversion, the information that is relevant for order creation is temporarily stored after the sales order is saved and the order conversion is executed in the BACKGROUND TASK.

Component substitution

After the explosion is determined (either PP/DS tube or reexplosion), a component substitution is executed if this has been proposed by the ATP check. There is an external call of the form routine REPLACE_COMPONENTS from the program /SAPAPO/SAPLRRP_ORDER_CHANGE. The components are read from the ATP tree structure using the successor requirements group. According to the requirements group type, a distinction is made between a normal planned order creation and a planned order creation with component substitution.

In the component substitution, a distinction is made between location and product substitution. If the destination and source locations are the same, but the component different, this is a product substitution. If the reverse is the case (same component, different locations), the location substitution component is flagged for later processing (recursive call for the flagged entries from LT_SCHEDLINE).

In the case of product substitution, the entries for the substitution (pegging areas for both products, item number, BOM Guid, and the requirements quantity are stored in an internal table LT_REPLACE and the relevant information is deleted from the table of schedule lines (CT_SCHEDLINE, LT_SCHEDLINE). The remaining entries from this schedule line table (for location substitutions and conventional planned orders) are processed later in the recursive call.

In the next step, a check is made to see if the product substitution is executed in a bill of material / component list. In this case, the bill of material (BOM) item of the substituted component must be determined so that the substitution is made for the correct component at the correct position/item in the BOM, if a BOM uses a component on several items.

Otherwise, if no BOM is available, the first suitable component (with the same pegging ID) is substituted. If the input component that is to be substituted occurs several times, it is only substituted once by the substitute component.

If, in both cases, (with and without BOM), a suitable component is not found, there is no dependent requirement and consequently no product substitution.

The product substitution takes place through the actual addition of a substitute component. The logic here is like the logic for manually adding a component to a planned order.

First, there is a quantity calculation for the original component. The requirement of the original component is either reduced in the component table CT_INPUT (if the substitute component quantity is smaller than the original component quantity) or set to zero.

The pegging ID of the substitute component and the substitute component quantity are temporarily stored in a local table LT_INPUT_ADD.

The largest item number in the component table CT_INPUTS is calculated. This table contains all remaining input components (for example, of a BOM). Using the last (maximum) item number, the temporarily stored entry of the substitute component is added to this component table.

After the product substitution, a master output is determined. In the case of a recursive PPM, the IS_MASTER indicator is not set for this primary product, because the primary product is used as input. At this point, the first entry is read from the output table and the pegging ID for calendar determination is determined.

Scheduling

Lead time scheduling is determined using the production calendar. The start of the scheduling period in the planning horizon is moved back by an hour so that the delays in the lead time scheduling can be taken into consideration. The time determined (today line) is then set and fixed for the subsequent order creation.

Writing in SAP liveCache

After the order has been successfully updated in SAP liveCache, the order details are deleted from the PP/DS tube.

The PP/DS order is created in the flush mode. A product substitution or location substitution is executed or taken into consideration in the called function module /SAPAPO/RRP_ORDER_CREATE. The changing parameter CT_SCHEDLINE is passed on to the function module /SAPAPO/RRP_PLORD_CREATE and contains all information for product/location substitutions and for the conventional planned order creation. In the function module (form routine REPLACE_COMPONENTS), only the component substitution and the conventional order creation are executed. The location substitutions are processed using the recursive call in the form routine CONVERT_REQGRP_TO_SUBST.

Recursion

The remaining schedule lines for the requirements groups are sorted according to requirements dates/times. Planned orders, location or planned orders with component substitution are created through the recursive call of this function module for these receipt elements.

Example

Notes

The function module has a recursive call.

Further information





Parameters

CT_PEG_SUBTREE
ET_SUPPLY
IS_CONTROLPARAMS
IS_SCHEDLINE
IV_READ_TUBE

Exceptions

ERROR
NO_SOURCE

Function Group

APO/SAPLRRP_ATP2PPDS

rdisp/max_wprun_time - Maximum work process run time   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 7240 Date: 20240424 Time: 071339     sap01-206 ( 206 ms )