CL_DEF_IM_WRBAX_OUT_OF_STOCK - Default Implementation for BAdI Definition WRBAX_OUT_OF_STO

General Data in Customer Master   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Class CL_DEF_IM_WRBAX_OUT_OF_STOCK

Functionality

Overview

Class CL_DEF_IM_WRBAX_OUT_OF_STOCK is the standard implementation of the BAdIWRBAX_OUT_OF_STOCK. This implementation shows how requested methods can be implemented using the BAdI interfaceIF_WRBAX_OUT_OF_STOCK.

You can also use the standard implementation as the starting point for your own developments. The standardbehavior is determined by this standard implementation. You can implement different requirements byoverwriting hook methods (method signature "DO_...") (a hook method is a method whose behavior can be overwritten in a subclass and can be redefined).

Classes used

To implement the functions specified by the interface, the following classes are used in the object instances class:

  • Class CL_WRBA_SITE_LIST:
Determines plant master data and assortment data for the plant and storage locations for the plant.
  • Class CL_WRBA_VENDOR_MAT_LIST:
Determines lists for all vendors and materials and how these are combined in cases where a material can be procured from several vendors.
The purchasing info records determine the relationship between vendors and materials.
It is possible to obtain the results lists from the selection options for vendors and materials. Thereis a reference here MR_BADI to the class calling program (class CL_DEF_IM_WRBAX_OUT_OF_STOCK).This reference is used to call the hook methods DO_READ_MATERIAL_FROM_RANGES, DO_READ_PURCHASE_INFORECORDS,DO_READ_VENDOR_FROM_RANGES, DO_RESOLVE_GEN_AND_CHECK_MAT from the class CL_DEF_IM_WRBAX_OUT_OF_STOCK. By overwriting the hook methods in subclasses you can influence the reading result.
  • Class CL_WRBA_OOS_MAT_LIST:
Determines the stock and calculates the stock status (normal stock, overstock, out-of-stock) for all defined combinations of plants, storage locations and materials.
For this the determination of plants and storage locations is passed on to the class CL_WRBA_SITE_LIST and the determination of materials and vendors is passed on to the class CL_WRBA_VENDOR_MAT_LIST.
It is possible to calculate the stock status, check the listing and influence the results list. Forthis there is a reference MR_BADI that refers to the class calling program (class CL_DEF_IM_WRBAX_OUT_OF_STOCK).This reference is used to call the hook methods DO_ADD_LINES_FOR_DISPLAY, DO_CALC_STOCK_SITUATION,DO_CHECK_LISTING, DO_READ_STOCK_DATA from class CL_DEF_IM_WRBAX_OUT_OF_STOCK. You can influence the reading result by overwriting hook methods in subclasses.

Interface methods

This section describes how the methods for the interface IF_WRBAX_OUT_OF_STOCK were implemented:

  • GET_ALV_FIELDCAT: Reads the ABAP List Viewer catalog without additional changes.
  • CHECK_AUTHORITY: Performs a general authorization check with the help of the authorization object "F_LFA1_APP" (display vendor data) using:
  • GET_SITES: Reads the plant list (table T001W)
  • INIT_OUT_OF_STOCKS: Instances objects for the plant list, vendor material list and stock list (further details are provided below)
  • GET_MATERIAL_LIST: Reads the vendor material list. Corresponding purchasing info records(table EINA) are determined on the basis of the transferred selection options for material, materialgroup and/or vendor. After the purchasing info records have been read, master data for the material (tables MARA, MARM, MAKT), material groups (table T023T) and vendor (table LFA1) are read.
  • GET_STOCKS_AND_CALC_OOS: Reads the stock data for the plant list for all storage locations and all materials in the material list from table MARD.
  • ADD_DATA_FOR_LIST_DISPLAY: Is implemented empty

Hook methods

You can implement the standard behavior of the class differently in subclasses using the following hook methods. The following is a description of the function of the standard implementation:

  • DO_READ_MATERIAL_FROM_RANGES: Reads material master data from the database tables MARA, MARM,MAKT for the specified selection options. If an implementation is performed in the customer projectyou must ensure that the selection is implemented for normal materials and generic materials (access MARA using field SATNR).
  • DO_READ_VENDOR_FROM_RANGES: Reads vendor master data from table LFA1
  • DO_READ_PURCHASE_INFORECORDS: Reads purchasing info records (table EINA) for the specified vendor/material combination.
  • DO_RESOLVE_GEN_AND_CHECK_MAT: Expands generic materials into their variants and checks the material master data.
  • DO_READ_STRUC_ART_COMPONENTS: Expands structured materials (for example, prepack and set) into their components.
  • DO_READ_STOCK_DATA: Reads stock data (table MARD) and returns stock at plant and storage location level to the transferred combination of materials and plants.
  • DO_CHECK_LISTING: Checks listing with the help of the function module WLK1_CHECK.
  • DO_CALC_STOCK_SITUATION: Calculates the out-of-stock status (normal stock situation, overstock,out-of-stock) for each material storage location and plant. In the example implementation it is assumed that the determination of the out-of-stock situation is defined by material requirements planning.
The free warehouse stock (table MARD, field LABST) and some master data is read for each material, storagelocation and plant from the table MARC. The safety stock is used as the reference stock (table MARC, field EISBE), which provides a degree of flexibility for the material requirements planning rating.
The starting point of the standard implementation is that an out-of-stock situation occurs, if the stockis within the precise area of the material forecast. For the standard implementation to function it is therefore a prerequisite that the corresponding data is maintained in the material master.
You enter the degree implemented in this class for checking for an out-of-stock situation for each material combination using the following formula:
stock situation = warehouse stock/safety stock* 100%
If the stock situation is below the thresholds defined in PI_THRESHOLD_DC for the distribution center or stores, then an out-of-stock situation exists for the material in question.
If the stock situation is above the threshold defined in PI_THRESHOLD_DC for the distribution center or for stores, then an overstock situation exists for the material in question.
In all other cases the stock situation is rated as normal.
  • DO_ADD_LINES_FOR_DISPLAY:
Mixes the stock data and master data for materials, vendors and plants together for the output table (export parameter TC_STOCK_DISPLAY_DATA).
The list is structured so that a line with stock data and without vendor data and then separate lines with vendor details and with no stock data are created for each material, for several vendors.
Lines with vendor details and no stock data can be viewed in the stock list in transaction WRBDL usingan inactive LED icon. If only one vendor is defined, the vendor data and the stock data are displayed in a table row in the stock list (transaction WRBDL).
Additional notes for method DO_ADD_LINES_FOR_DISPLAY for the case that the method is to be overwritten in a subclass
  • The overwriting implementation should call method DO_CALC_STOCK_SITUATION, as in the standard implementation.

  • The import parameter TI_MATERIAL_RANGE contains a list of materials (each row in the import table therefore contains a range of value parameters, with field OPTION with value EQ).

  • SAP recommends that you read the data to be copied into the output structure, as in the standard implementation, using corresponding method calling programs.

Relationships

Example

Notes

Further information

See also:

The example implementation demonstrates how alternative program behavior can be implemented. To do this, classCL_DEF_IM_WRBAX_OOS_SUBCLASS is used. This is a subclass of the standard implementation classCL_DEF_IM_WRBAX_OUT_OF_STOCK.





CPI1466 during Backup   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.


Length: 10240 Date: 20120526 Time: 134951     triton ( 276 ms )