Supply Chain Management Blogs by Members
Learn about SAP SCM software from firsthand experiences of community members. Share your own post and join the conversation about supply chain management.
cancel
Showing results for 
Search instead for 
Did you mean: 
gorbenkoteh
Active Participant

Intro:



In Logistic well-known such terms as FEFO, LIFO and FIFO. In this blog-post we invent a few new logistic terms and realize a logic from it  via SAP EWM BADI implementation


FEFO:


First Expired, First Out (FEFO) is a term used in field inventory management to describe a way of dealing with the logistics of products that have a limited shelf life. These items include perishable products or consumer goods with a specified expiration date. The product with the deadline for the next intake will be the first to be served or removed from stock. FEFO is majorly used in the pharmaceutical and chemical industries where expired dates are calculated based on a batch-expired date or shelf-life time.


FIFO:


First In, First Out (FIFO) is a term means that has entered our logistics process must be the first one to comes out. It is the most widely used logistics management method. The objective is to achieve a good rotation of the parts. It is an excellent method so that the parts that are already manufactured come out quickly and do not generate unnecessary stock.


LIFO:


Last In First Out (LIFO) is a term means that the last goods to be stocked are the first goods to be removed.


For warehouses related to pharmaceutical industry a few additional terms can be invented in this blog-post.


FUFO:


First Uncovered First Out (FUFO)

Explanation:  In pharm industry working via GMP standards [1] raw material from inbound deliveries to warehouse  have a inbound quality control via special

quality control team.

For example: inbound delivery contains a 50 pcs of potassium sorbate.

Common used in pharma industry formula quantity pcs for sample selection=1.5*sqrt (total quantity in inbound delivery)

So for use case with potassium sorbate sample qnt will be    1.5*sqrt(50 pcs) = 11 pcs.

Quality control team in special room open a 11 pcs for sample selection.

In total we have a 50 pcs with the same batch, with the same shelf life and receipt date.

Obviously opened pcs should have higher priority opposed not opened pcs for transfer raw material from warehouse to production.

For this blog-post we will call this as principle of FUFO.


FRFO:


First Returned First Out  (FRFO)

Explanation:

Let's imagine a modern production.

For the production of a specific batch of products, raw materials e.g.  A, B, C, D, etc. are needed from the warehouse.

For companies with SAP Landscape  - ERP-operator (employee from production department) create in SAP ECC(or SAP S/4HANA) Outbound delivery with direction from warehouse to production with raw-materials (e.g. A,B,C,D etc) and releases it to SAP EWM

A situation is possible when, after the production of a batch, some part of the raw material remains, which must be handed over to the warehouse where the raw materials will await the production of the next batch.

ERP-operator (employee from production department) create in SAP ECC(or SAP S/4HANA) Inbound delivery with direction from production to warehouse with  remaining raw-materials (e.g. A,B,C,D etc) and releases it to SAP EWM.

Obviously returned to warehouse pcs should have higher priority opposed not returned pcs for transfer raw material from warehouse to production at the next iteration.

For this blog-post we will call this as principle of FRFO


Business problem.



For outbound deliveries with raw materials  in direction warehouse -> production a next industry-specific sorting logic must be implemented in SAP EWM:

Priority 1. Batches with minimal shelf life (FEFO)

Priority 2.  Bathes entered on warehouse first (FIFO)

Priority 3. Bathes returned from production line (FRFO)

Priority 4. Bathes stored in a uncovered handle units (FUFO)


Realization.


To solve this business problem we can implement BADI  /SCWM/EX_CORE_RMS_DETERMINE  with customer-specific code.

Let's do it step by step.



Step 1. Overview of /SCWM/EX_CORE_RMS_DETERMINE


BADI purpose:  customer specific sorting or filtering of quants, which SAP EWM has determined according to standard settings.

Input:

IS_LTAP - warehouse task structure for which the quantum is searched

IS_MAT_GLOBAL - global material data

IS_MAT_LGNUM - warehouse number specific material data

IT_MAT_UOM - material data by unit of measure

IS_T331 - storage type data for which the run is performed

IS_T333 - settings data of the warehouse process type with which the quant search is performed

IT_QMAT - table of quants that the SAP EWM found according to the standard strategy

IV_REM_RULE - material issue strategy, which was determined according to the settings

IO_LOG - log object

IV_ROW - log object  (row)


Output:

ET_QMAT_CUS - the output table of quants that the system will use if we need changes.

EV_SET - sign that you need to use ET_QMAT_CUS

CS_ORDIM_CUST - warehouse task data in a custom structure


For implementation of this BADI, we need a algorithms for determining opened and returned HU first.

Describe it in the next steps.



Step 2. Let's define an Opened HU


For FUFO principle implementations we

must distinguish a opened HU from an unopened one.

From warehouse to warehouse this approach can be different.

But the method described below may be some idea, a draft just for your project.

In my case we have a storage area[2]/storage bin - SPROB1 (room for probe storage)

So opened HU - this is a HU where:

/SCWM/ORDIM_C-TOSTAT = 'C' (completed WT exists)

/SCWM/ORDIM_C-NLPLA = 'SPROB1' (Destination Storage Bin - special Room for probe storage)

/SCWM/ORDIM_C-VLENR < > /SCWM/ORDIM_C-NLENR (Source and target HU are different)

Lets Create two FM for this algorithm implementation.


GitHub:

Code snippet idea- 1


Code snippet idea - 2





Step 3. Let's define a Returned HU


For FUFO principle implementations we must distinguish a returned HU

From warehouse to warehouse this approach can be different.

But the method described below may be some idea, a draft just for your project.

Let's take a brief look at our definition of FRFO:


"ERP-operator (employee from production department) create in SAP ECC(or SAP S/4HANA) Inbound delivery with direction from production to warehouse with  remaining raw-materials (e.g. A,B,C,D etc)"


Due to performance issues, it may not be possible to analyze the summer history of instances from the extracted HU

In this case, using PPF [3] may be the best choice. Short review of this idea:


3.1. Create HU External Identification


SPRO - SAP Extendended Warehouse Managment - Cross-Process Setings - Handling Units - External Identification

New identification - R - Returned.






External identification is a flexible tool that allows you to add client-specific attributes to any HU.

At the code level, this is the IDART field in the transparent database /scwm/hu_ident-idart




3.2. Define profile 


SPRO - SAP Extendended Warehouse Managment - Good Receipt Process - Inbound Delivery - Manual Settings - Define Document Types for Inbound Delivery Process






3.3. Define action for profile 


Transaction -  SPPFCADM (PPF Administration)

Application -  /SCDL/Delivery







3.4. Implement BADI  IF_EX_EVAL_SCHEDCOND_PPF in Z-class


Filter only only delivery with "Returned" type.

Code snippet idea:





 DATA(lv_doctype) = ls_bo-bo->get_doctype( ).
IF lv_doctype NE 'ZI03'.
EXIT.
ELSE.






 

3.5. Implement logic for IDART update

It is advisable to move the execution of the event to a separate FM (functional module), which will be called according to a previously defined event (Completion of delivery) and a filter (Delivery type e.g ZI03)
From the event we get docid (id of the incoming delivery)

By delivery id, you can get a list of HUs that belong to it.

To do this, you can use the standard FM - /SCWM/DLV_GET_HUS_FOR_DELIVERY


Code snippet idea:



CALL FUNCTION '/SCWM/DLV_GET_HUS_FOR_DELIVERY'
EXPORTING
iv_doccat = lc_doccat
it_docid = lt_docid
iv_lgnum = lc_lgnum
IMPORTING
et_huhdr = lt_huhdr
EXCEPTIONS
error = 1
OTHERS = 2.

doccat, lgnum are constants in our case.

doccat (delivery type) – PDI (inbound delivery)

lgnum (warehouse number)

docid (inbound delivery id we got from the PPF event)




To enter data on External identification for the HU, you can also use the standard FM - /SCWM/HU_POST

Code snippet idea for call options:




    CALL FUNCTION '/SCWM/HU_POST'
EXPORTING
it_xid = = lt_xid.


Where = lt_xid contains the attributes of the HU for which we want to set the opened HU flag.


3.6. Implement logic for IDART update (Initiation)


In order to fill in the attribute of the returned HU for HUs already received at the warehouse, it is advisable to develop a FM with the following functionality




3.6.1.   Find all incoming deliveries, return from production, BP sender ID

Table -  /scdl/db_proch_i

3.6.2.  Find all warehouse tasks for deliveries founded

Table -  /scwm/ordim_c

3.6.3. Remove unfinished and duplicate WT

3.6.4. Define nesting through /SCWM/HU_SELECT

3.6.5.Find the top-level HU

3.6.6. Remove not returned, but simply lying on a pallet HU

3.6.7. In the loop, we will call /SCWM/HU_POST and set the ID of the returned HU for all found HUs

3.6.8. Write a log



3.7. Opened HU detection.





Step 4.  Implementation of BADI /SCWM/EX_CORE_RMS_DETERMINE



Extend  IT_QMAT - table of quants that the SAP EWM found according to the standard strategy as lt_qmat_ad BY

with two additional parameters and sort it via our custom logic.


Code snippet idea -5:




Conclusion.


SAP EWM routine task with examples was provided
7 Comments