CL_DEF_IM_WRBX_OUT_OF_STOCK - Default Implementation for BAdI Definition WRBX_OUT_OF_STOC
Vendor Master (General Section) General Data in Customer MasterThis documentation is copyright by SAP AG.
Class CL_DEF_IM_WRBX_OUT_OF_STOCK
Functionality
Overview
Class CL_DEF_IM_WRBX_OUT_OF_STOCK implements the interface IF_WRBX_OUT_OF_STOCK and provides the standard implementation of the BAdI WRBX_OUT_OF_STOCK.
The default implementation is intended to be a suggested implementation. If the majority of the defaultimplementation is to be used (reading the master data for materials and material plant data as wellas stock), a subclass can be derived from the class and the required changes to the functionality can be reimplemented by overwriting the corresponding DO_ methods.
For technical reasons, a class derived from CL_DEF_IM_WRBX_OUT_OF_STOCK cannot be used directly as the implementing class for the BAdI WRBX_OUT_OF_STOCK.
Therfore, for the alternative calculation of the out-of-stock situation for each material, the only option is an alternative implementation of method DO_CALC_OUT_OF_STOCK_BY_MAT.
Here is a description of the components for class CL_DEF_IM_WRBX_OUT_OF_STOCK:
Class Attributes
The following list provides an overview of the class attributes. All attributes are private so that the data of the object remains constant. Read access is only possible using the accessor methods(GET_...) in a subclass.
- MT_DB_FIELDS_SITE_MAT_GROUP, MT_DB_FIELDS_SITE_MAT
- Tables with field names for access to tables MARC, MARD.
- MT_DB_FIELDS_MATERIAL Table of field names for access to tables MARA, MAKT, MARD.
- Tables with field names
- The tables contain field names of tables and are used for a SELECTcommand. The tables are createdin the method FILL_DB_FIELD_TABLES, which is called in the initialization method IF_WRBX_OUT_OF_STOCK~INIT_VENDOR_OUT_OF_STOCKS.
- M_VENDOR_NUMBER: Vendor number
- M_THRESHOLD_DCS, M_THRESHOLD_STORES: Thresholds for out-of-stock situations in distribution centers and stores
- M_MERCHANDISE_CATEGORY: Material group that serves as a filter value for materials
- M_REGULAR_VENDOR: Indicates that only materials for which the vendor is entered as the regular vendor in the purchasing info record are read.
- M_MAX_COMBINATIONS: Maximum number of material plant combinations for which an out-of-stock situation is to be checked.
- MR_MATERIAL_LIST: Local object that manages the material data used.
- MR_OUT_OF_STOCK_LIST: Local object that manages the stock data and the material master data used.
- MT_SITE: Master data for the plants
- M_CHECK_LISTING: If the indicator is set (value IF_WRB_CONSTANTS=>C_TRUE), a listing check is performed for all material plant combinations (table WLK1).
- M_LFA1: Master data record for vendor (table LFA1)
Object References
The class references the following objects:
- MR_MATERIAL_LIST(class CL_WRB_VENDOR_MAT_LIST):Manages the material master data and provides an iterator with which you can calculate the out-of-stock situation by package.
- MR_OUT_OF_STOCK_LIST(class CL_WRB_OOS_MAT_LIST):Reads the stock data and calculates the out-of-stock situation by package using an iterator.
Description of the Methods
Implementation of the Interface Methods
The general meaning of interface methods is already explained in the documentation for interface IF_WRBX_OUT_OF_STOCK.
This section describes the concrete implementation of the interface methods.
- IF_WRBX_OUT_OF_STOCK~CHECK_AUTHORITY: Authorization check is carried out using function module WRB_VENDOR_CHECK_AUTH_DISPLAY.
- IF_WRBX_OUT_OF_STOCK~GET_VENDOR_NAME:Reads vendor master data from table LFA1 and returns field LFA1 as the vendor name.
- IF_WRBX_OUT_OF_STOCK~GET_SITES_BY_TYPE:Reads plant master data from table T001Wand an authorization check is carried out at plant level (authorization object 'M_MATE_WRK').
- IF_WRBX_OUT_OF_STOCK~INIT_VENDOR_OUT_OF_STOCKS:Initialization routine in which some attributes are initialized. If this method is overwritten in a subclass, the implementation of the superclass has to be called(CALL METHOD SUPER->INIT_VENDOR_OUT_OF_STOCKS...) to ensure object consistency.
- IF_WRBX_OUT_OF_STOCK~GET_MATERIALS: Reads the master data for the material from tables MARA(material master), MAKT(material short texts) and MARM (units of measure).
- IF_WRBX_OUT_OF_STOCK~CALC_VENDOR_OOS_DETAIL:Calculates the out-of-stock overview for the vendor at material level. In the sample implementation, it is assumed that the determination of the out-of-stock situation is motivated by Material Requirements Planning.
- To do this, the free warehouse stock aggregated across all storage locations is read for each material(table MARD, field LABST); master data from table MARC is also read. The safetystock (table MARC, field EISBE) is used as a reference stock that represents a measure of fluctuation for the quality of the material forecast.
- The idea of the standard implementation is that an out-of-stock situation occurs if stock levels fallwithin the area of the accuracy of the material forecast. A prerequisite for the standard implementation to work is that the relevant data is maintained in the material master.
- The measure implemented in this class for checking for an out-of-stock situation per material plant combination is given by the following formula:
- Stock situation = warehouse stock / safety stock * 100%
- If the stock situation falls below the thresholds for distribution centers or stores defined by M_THRESHOLD_DCS, M_THRESHOLD_STORES, there is an out-of-stock for this material plant combination.
- The calculation per material is carried out in method DO_CALC_OUT_OF_STOCK_BY_MAT.
- Example: If the threshold of 100% is given, there is an out-of-stock for a material plant combination as soon as the the stock level goes below the safety stock.
- IF_WRBX_OUT_OF_STOCK~CALC_VENDOR_OOS_OVERVIEW:Aggregates the out-of-stock situation calculated by module WRB_RFC_VENDOR_GET_OUTOFSTOCKS fora vendor by the materials for an out-of-stock situation at vendor level. In the implementation, the maximum out-of-stock values of the materials are taken as global out-of-stock values at vendor level.
- Example:
- The following out-of-stock statistics are calculated for three materials from a vendor:
- Material A: Out-of-stock for stores 20%, for distribution centers 16%
- Material B: Out-of-stock for stores 10%, for distribution centers 8%
- Material C: Out-of-stock for stores 33%, for distribution centers 13%
- As an overview value for the vendor, an out-of-stock of 33% for stores and 16% for distribution centers is returned.
- IF_WRBX_OUT_OF_STOCK~MERCH_CAT_IS_NOT_VALID:The standard implementation checks that a database entry for the material group exists in table T023.
Hook Methods
A hook method is a function whose standard behavior can be extended in a subclass. Hook methods in class CL_DEF_IM_WRBX_OUT_OF_STOCKhave the prefix "DO_".
To implement your own logic, you can derive class CL_DEF_IM_WRBX_OUT_OF_STOCK and overwrite the relevant hook methods for the required changes to the functionality.
For technical reasons, it is not currently possible to specify a subclass of CL_DEF_IM_WRBX_OUT_OF_STOCKdirectly as implementing class for the BAdI . For this reason, classCL_EX_WRBX_OOS_TEMPLATEcan be used as a template for the implementation class of the BAdI. This class only delegates the method calls of the BAdI interface to the class in which the functionality is implemented.
Here is a list of the hook methods:
- DO_CALC_OUT_OF_STOCK_BY_MAT:Calculates the out-of-stock overview for a material and all sites transferred.
- DO_READ_STOCK_DATA: A SELECTcommand for reading the material plant master data and stocks is encapsulatedin the method (tables MARCand MARD). All combinations of materials and plants are read from this method.
- DO_CHECK_LISTING: Performs the listing check using the module WLK1_CHECK.
- DO_READ_MATER IAL_DATA: A SELECT command for reading the material master data is encapsulated in the method (tables MARA, MAKT, MARM).
- DO_READ_EINA_INFORECORDS: Reads purchasing info records (table EINA).
Accessor Methods and Mutator Methods
Accessor (prefix "GET_..." or "IS_.." for indicator-type fields) and mutator methods (prefix"SET_...") are used for read and write access to object attributes in a class. In this environment,accessor methods in overwriting classes can be used to read the object attributes of class CL_DEF_IM_WRBX_OUT_OF_STOCK and used for your own implementation purposes.
- GET_DB_FIELD_NAME_TABLES: Accessor method for the names of database fields to be read. The lists of field names are used in a SELECT command
- GET_MATERIAL_DATA:Accessor method for material data from the material list. A precondition is that the material list is read in the class.
- GET_SITE_DATA: Accessor method for plant data
- SET_CHECK_LISTING: Mutator method of the indicator for "Perform listing check"
- IS_CHECK_LISTING: Accessor method of the indicator for "Perform listing check"
- GET_MAX_COMBINATIONS:Acessor method for the maximum number of material plant combinations for which an out-of-stock situation is to be checked.
- GET_VENDOR_DATA: Accessor method for vendor data Other Service Methods
- FILL_DB_FIELD_TABLES:Method with which tables TE_DB_FIELDS_SITE_MAT_GROUP, TE_DB_FIELDS_SITE_MAT and TE_DB_FIELDS_MATERIAL are filled.
Relationships
Example
Further information
For more information, see the documentation for the following program objects:
- Function module WRB_RFC_VENDOR_GET_OUTOFSTOCK
- Function module WRB_RFC_GET_OOS_OVERVIEW
- BAdI WRBX_OUT_OF_STOCK
- BAdI interface IF_WRBX_OUT_OF_STOCK
- Template class CL_EX_WRBX_OOS_TEMPLATE
BAL Application Log Documentation General Data in Customer Master
This documentation is copyright by SAP AG.
Length: 15105 Date: 20120526 Time: 135005 triton ( 308 ms )






