Enhance SAP EWM

Quant determination for stock removal strategy

The stock removal rule is the main topic of this article. Therefore, we disregard any additional functions (such as storage type search sequence and warehousing process type) that affect the source SAP EWM quant determination.
Simply picture yourself sitting in front of a rack that has numerous bins holding the same product, each with varying quantities, GR dates, Best-before dates, Units of Measure, HU type, number of open jobs, and so on, to get a better understanding.

What is possible via standard customizing?

There is no one best practice for all EWM consultants; always look at standard settings before modifying the code. The slightest of developments—the latest individual who needs to endorse your Z-ideas—will kick you in the ass with little surprises.
The query of which source bin or quant to choose when creating a warehouse job against a warehouse request item is addressed by this customization node:

Enhance SAP EWM

As was already noted, EWM provides us with a lengthy set of stock features that we may use to categorize potential source quants. Just pick the qualities you wish to take into account, arrange them in a sensible order, and, if necessary, set the flag to sort descending (if you leave the flag unset, EWM will sort ascending by default). This customization is kept in tabular form in SCWM/T334RR.

Enhance SAP EWM

The most prevalent instances involve sorting according to WDATU to achieve FIFO/LIFO or sorting according to VFDAT to achieve FEFO/LEFO. To limit the number of picks required for each warehouse request item or to clear up partially filled bins, this is typically paired with a QUAN-based sorting process.

Where can I find the standard coding?

You should look at include /SCWM/LREM_BIN_DETF12 if you need to debug a standard behavior issue or if you simply want to know how the standard coding handles the aforementioned customization.
The customization is stored in table /SCWM/T334RR, which is retrieved by EWM in subroutine rem_rule_get (1). Subroutine qmat_sort sorts the internal table of potential source quants (ct_qmat) after it is finished.

 

Enhance SAP EWM
Enhance SAP EWM
How can I enhance here in a ‘clean’ way?

While not the only way to build a custom stock removal rule, Badi /SCWM/EX_CORE_RMS_DETERMINE is one of the more effective and popular ones:

Enhance SAP EWM

Numerous data points are imported by the interface method, which can serve as the foundation for unique logic. For example, product master data, stock data (> ct_qmat imports stock details based on the AQUA table), or customization information regarding source storage type and warehouse process type:

 

 

Enhance SAP EWM
Enhance SAP EWM

This data is used as an input by the Badi to modify the internal table ct_qmat’s content and/or sorting. The modified data is written to table et_qmat_cus, which is then exported to the calling program. Additionally, in order for the standard to take your changes into account, you need to specify the flag lv_set:

 

Enhance SAP EWM
Bonus (to get inspired)

SAP provides several example implementations. These can be used to investigate the possibilities available to you with this Badi and discover how to apply an improvement here in a technically sound manner:

 

 

 

Enhance SAP EWM

Class /SCWM/CL_EI_CORE_RMS_DET_MFS serves as an illustration of how this logic is implemented. It assesses the condition of the MFS resources, such as cranes in an automated high-bay warehouse. The bins/quants from the corresponding aisles are removed from the list of potential source bins/quants if the resources are not available (for example, because they encountered an error and have not yet been recovered).

 

 

Enhance SAP EWM
In summary,

the EWM standard already has a rather robust customization feature that may be used to rank potential source quants according to one or more stock qualities. Before you even think about putting the Badi into use, weigh all of your alternatives for normal customization!

– The place to go if you want to apply your own reasoning to choose a source quant for choosing or stock elimination is Badi /SCWM/EX_CORE_RMS_DETERMINE. Take a look at the standard example classes to obtain ideas and motivation before implementing your own logic!