SAP ABAP IMG Activity S2P_PSEG_CTR_FACTORY (BAdI: Defining Planning Control for Supply Segments)
Hierarchy
ECC-DIMP (Software Component) DIMP
   IS-A-S2L (Application Component) Production Supply
     DI_S2L (Package) Production Supply
IMG Activity
ID S2P_PSEG_CTR_FACTORY BAdI: Defining Planning Control for Supply Segments  
Transaction Code S_KA5_12001169   IMG Activity: S2P_PSEG_CTR_FACTORY 
Created on 20020607    
Customizing Attributes S2P_PSEG_CTR_FACTORY   BAdI: Defining Planning Control for Supply Segments 
Customizing Activity S2P_PSEG_CTR_FACTORY   BAdI: Defining Planning Control for Supply Segments 
Document
Document Class SIMG   Hypertext: Object Class - Class to which a document belongs.
Document Name S2L_PSEG_CTR_FACTORY    

Use

You can use this Business Add-In (BAdI) to influence planning control for a supply segment. For example, you can determine the earliest possible procurement date, a rounding quantity or you can define which type of planning elements are to be used in a supply segment (for example, requirements from an external system instead of APO requirements).

Requirements

Before you implement the Business Add-In, you have to create a class which replaces the standard logic for planning control. The class must be derived from class CL_CCY_PSEG_CONTROL_S2L (that is, the class inherits the components of class CL_CCY_PSEG_CONTROL_S2L. This class replaces the standard planning control used for supply segments based on control cycles.

Standard settings

If the BAdI method CREATE_CCY_PSEG_CONTROL does not return any instance, the system uses the standard logic of class CL_CCY_PSEG_CONTROL_S2L.

Activities

First, create a global class in the customer namespace which is derived from class CL_CCY_PSEG_CONTROL_S2L. Create a forward declaration for the type pool S2L to enable access to the fixed values listed below.

The following methods can only be redefined in your class:

  • DETERMINE_EARLIEST_REPL_TIME
  • DETERMINE_ROUNDING_QTY
  • CALC_TIME
  • CALC_TIME_DAILY
  • ROUND_PROPOSAL_QUANTITY
  • CHECK_AUTHORIZATION
    The redefinition of this method especially makes sense if you do not use the summarized JIT call as replenishment element.
  • CHECK_APO_RELEVANCE
    Redefine this method if have to take APO requirements and R/3 requirements into account for a supply segement.
  • EXTRA_SETUP_BY_CCY
  • SETUP_ENTITY_MANAGERS
    To decide which planning element types are to be taken into account for a particular supply segment, the reference to the supply segment (import parameter: SEGMENT) as well as a refresh mode (import parameter: REFRESH_MODE) are available. The import parameter REFRESH_MODE is a bit string. If the Bit S2L_REFRESH_RPROPS_BIT is set, the replenishment proposals must be updated. If the bit S2L_REFRESH_EXTERNAL_BIT is set, all "external" planning element types (requirements, replenishment elements, stocks) must be updated.
    In method, SETUP_ENTITY_MANAGERS you can take new planning element types into account by adding a manager implemented for this purpose (for more information on this procedure, see below).
    Warning: The redefinition of this method does not only influence transaction S2L but also transaction PK37 (supply area stock correction). If the Bit S2L_PSEG_MODE_STCORR_BIT of attribute SEGMENT->MODE is set you are in the supply area stock correction. You can regard the implementation of class CL_CCY_PSEG_CONTROL_S2L as an example implementation.

Implementation of the Business Add-Ins

Create an implementation of the Business Add-In. Implement method IF_EX_S2L_PSEG_CTR_FACTORY~CREATE_CCY_PSEG_CONTROL. Create an instance of your derived class and transfer it to the export parameter PSEG_CONTROL.

Taking Customer-specific Planning Elements Types into Account

As previously mentioned, by redefining the method SETUP_ENTITY_MANAGERS you have the option of taking your own planning element types into account. To include a new planning element type, you have to create and implement a manager for it. This manager is reponsible for procuring the approptiate data and making it available in the appropriate form. Moreover, you must create and implement a planning record. One instance of the planning record later represents an individual planning element.

To create a new manager, you have to implement a sub-class for class CL_ENTITY_MANAGER_S2L (you can view the class CL_RESB_MANAGER_S2L as an example implementation). The class inherits both methods REFRESH_PREPARE and REFRESH_PROCESS.

The method REFRESH_PREPARE is accessed by the actual refresh. Here, you can execute preparatory measures. The actual refresh during which the data is read and formatted is split into five phases which are accessed in sequence (see include IS2L_TYPES_PLNG_MODEL - "Refresh in 5 phases"). You use the PHASES attribute to define the phase in which a manager is accessed (in special cases, a manager can also be accessed in several phases). You define the sequence in which the managers are accessed in a phase in the attribute PRIORITY.

Once you have read your data, you have to create corresponding planning records. For these planning records, you first have to create and implement a sub-class of the class CL_PLNG_RECORD_S2L (you can view class CL_RESB_RECORD_S2L or every other sub-class of class CL_PLNG_RECORD_S2L as an example implementation). You create a planning record and provide the inherited attributes with the corresponding data (compare CL_RESB_RECORD_S2L->CONSTRUCTOR).

To populate attribute TYPE, you first have to create a new record type (instance of class CL_PLNG_RECORD_TYPE_S2L). Once you have created your planning record, you have to create a corresponding element (instance of the class CL_PLNG_ELEMENT_S2L). You have to create an element type (instance of class CL_PLNG_ELEMENT_TYPE_S2L) for this element and assign it to the element. Populate the other attributes of the element (compare CL_RESB_RECORD_S2L->CONSTRUCTOR) in the same way.

Once you have created a planning record, you have to register it for planning. To do this, access method SUPPLY_SITUATION->ADD_RECORD and transfer the previously created planning record.

Replacing the Replenishment Element

You can replace the summarized JIT call as replenishment element by implementing a new manager for the replenishment proposals. The manager for the replenishment proposals is an exception as it is derived from a more specific class than the other managers.

The manager is created and implemented as a sub-class of the class CL_ENTITY_MANAGER_RPROP_S2L. The manager also contains a method for creating replenishment proposals and a method for saving the created replenishment proposals as replenishment elements.

When implementing, you can use class CL_REPLPROP_MANAGER_S2L as an example implementation. By implementing the method SAVE, you determine which object you use as replenishment element. If you use a different object than the summarized JIT call as replenishment element then you also have to provide an appropriate manager which reads the open replenishment elements for which the goods receipt has not yet been posted.

Like the manager, the planning record is an exception for the replenishment proposals. The planning record for the replenishment proposals is derived from a more specific class than the other planning records. The planning record for the replenishment proposals must be implemented as a sub-class of class CL_REPL_PROPOSAL_S2L. Here, you can use class CL_REPLPROP_RECORD_S2L as an example implementation. This class also contains a method for setting the quantity and a method for setting the time.

As the inclusion of new planning elements requires a detailed knowledge of the underlying model, we recommend that you do not proceed with the implementation without the support of SAP.

Example

Business Attributes
ASAP Roadmap ID 257   Create User Exits 
Mandatory / Optional 3   Nonrequired activity 
Critical / Non-Critical 1   Critical 
Country-Dependency A   Valid for all countries 
Maintenance Objects
Maintenance object type E   Business Add-In - Definition 
History
Last changed by/on SAP  20030120 
SAP Release Created in 471