SAP EWM Blog

In this article I describe the algorithm for selecting stock in goods issue processes (batches aside), starting from the moment the outbound delivery order (referred to below as the ODO) is created, so as to identify every field that influences the stock selection. 

So, when an outbound delivery is distributed from SAP ERP, all the data needed to create the ODO is transferred to SAP EWM (it is passed into the structure /SCWM/OUTB_DLV_SAVEREPLICA). The fields we are interested in are:TECHN_CONTROL-RECV_SYS – the system

  • HEADER_DATA-DLV_TYPE – the document type
  • HEADER_DATA-SHIPCOND – the shipping condition
  • HEADER_ORG-WHSE_NO – the source warehouse number (ERP)
  • HEADER_DATA_SPL-INITIATOR-PROCESS - the code for the initiator of the communication chain
  • ITEM_DATA-MATERIAL – the product code
  • ITEM_DATA-ITEM_CATEG – the item type
  • ITEM_DATA-STOCK_CAT – the stock type
  • ITEM_DATA-spec_stock – the special stock indicator
  • ITEM_DATA-SP_STCK_NO – the special stock number
  • ITEM_ORG-PLANT – the source plant in ERP
  • ITEM_ORG-STGE_LOC – the source storage location in ERP
  • ITEM_DATA_SPL-MOVE_POSTING CHANGE – the HU goods movement indicator.
  • ITEM_REFERENCE_WMD–MD_PROCESS – the process method for material distribution

1. Determining the document type

When an ODO is created in SAP EWM, the first thing determined is its document type, according to the following setting:
Extended Warehouse Management – Interfaces - ERP Integration - Delivery Processing - Map Document Types from ERP System to EWM:

Pick strategy is SAP EWM

• The business system is essentially the address of the sending system the outbound delivery was distributed from. It is used when a single EWM system is connected to several ERP systems. The business system is defined in the setting:

Extended Warehouse Management – Interfaces - ERP Integration - General Settings - Define Business System:
Pick strategy is SAP EWM

• The ERP document type is taken from HEADER_DATA-DLV_TYPE
• The code for the initiator of the communication chain is taken from HEADER_DATA_SPL-INITIATOR-PROCESS

So, the document type for the ODO being created in SAP EWM has been determined.

2. Determining the item type

The document item type is determined in the same way, through a similar setting:

Extended Warehouse Management – Interfaces - ERP Integration - Delivery Processing - Map Item Types from ERP System to EWM:
Pick strategy is SAP EWM

• The ERP document type - taken from HEADER_DATA-DLV_TYPE
• The ERP item type - taken from ITEM_DATA-ITEM_CATEG
• The EWM document type - determined through the configuration table described in the previous point
• The differentiating attribute for item type mapping - taken from ITEM_DATA_SPL-MOVE_POSTING CHANGE
• Catch weight product – taken from the master data of the product passed in ITEM_DATA-MATERIAL (transaction /N/SCWM/MAT1, the «Storage» tab)

So, we have determined the type of the ODO items being created

3. Determining the key fields in the ODO item

Next, the following key fields are determined for each ODO item; they are stored in the stock quant and influence its selection when the source storage bin is searched for:
• Product – taken from ITEM_DATA-MATERIAL
• Stock usage - taken from the field ITEM_DATA-spec_stock with the following mapping:
K --> wmegc_usage_consignment (C)
M --> wmegc_usage_return_pack (E)
E or Q wmegc_usage_own (_)
• Owner - determined by the following logic:
Pick strategy is SAP EWM

• Party entitled to dispose - determined from the plant passed in ITEM_ORG-PLANT, according to the setting:

Extended Warehouse Management – Interfaces - ERP Integration - Goods Movement - Map Storage Locations from ERP System to EWM:
Pick strategy is SAP EWM

• Stock document category: sales order stock or project stock – taken from the field ITEM_DATA-spec_stock with the following mapping:
E --> wmegc_stock_doccat_sos (SOS)
Q --> wmegc_stock_doccat_pjs (PJS)
• The sales order or project number for special stock - passed from ITEM_DATA-SP_STCK_NO, the first 10 characters.
• The sales order item for sales order stock - passed from ITEM_DATA-SP_STCK_NO, the last 6 characters.
PS: the conversion happens in the interface method /SCWM/IF_STOCKID_MAPPING~ERP_TO_WME
• Stock type
The stock type in SAP EWM and in ERP are not mapped directly one to one. In SAP EWM the availability group is used instead of the storage location. Instead of the ERP stock type, SAP EWM uses a location-independent stock type. The EWM stock type itself is a combination of these two concepts, for example:
(Plant 1000 + storage location 0001) + stock F = availability group 001 + location-independent stock type FF = stock type F1
(Plant 1000 + storage location 0002) + stock B = availability group 002 + location-independent stock type BB = stock type B2

Let us look at where this data comes from.
The location-independent EWM stock type is mapped from ITEM_DATA-STOCK_CAT by hard-coded logic as follows:
« » --> FF
«Q» --> QQ
«R» --> RR
«S» --> BB
The source plant and storage location from ERP, in ITEM_ORG-PLANT and ITEM_ORG-STGE_LOC, are mapped to the EWM availability group (AG) according to the setting in IMG SPRO:

Extended Warehouse Management – Interfaces - ERP Integration - Goods Movement - Map Storage Locations from ERP System to EWM:
6

The EWM stock type itself is determined from the location-independent stock type and the availability group according to the setting in IMG SPRO:

Extended Warehouse Management - Master Data – Product - Define Stock Type:
Pick strategy is SAP EWM

That is how we determine the key stock characteristics that will be used when searching for the source storage bin.

4. Determining the warehouse process type in the ODO item

In the next step SAP EWM determines the warehouse process type (WPT) for each ODO item according to the setting:

Extended Warehouse Management - Cross-Process Settings - Warehouse Task - Determine Warehouse Process Type:
Pick strategy is SAP EWM

• Warehouse number – determined from ITEM_ORG-PLANT and ITEM_ORG-STGE_LOC through the mapping setting under «Extended Warehouse Management – Interfaces - ERP Integration - Goods Movement - Map Storage Locations from ERP System to EWM». It is written into the ODO header.
• Document type – determined through the setting described in point 1
• Item type – determined through the setting described in point 2
• Delivery priority – used for inbound deliveries.
• Control indicator for determining the process type – an indicator in the product master data
• Process indicator – taken from the field ITEM_REFERENCE_WMD–MD_PROCESS
wpa, wcd, wcv, wcp, wcr, wcm --> 001
wfm --> 002
wfr --> 003
So, for each ODO item we have determined the warehouse process type, which plays one of the key roles in selecting the source bin.

5. Determining the storage type search sequence

When the picking warehouse task is actually created, the system first looks for the storage type search sequence that determines which storage types the goods will be issued from. This sequence is defined in SPRO IMG:

Extended Warehouse Management - Goods Issue Process – Strategies - Define Storage Type Search Sequence for Stock Removal:

Pick strategy is SAP EWM

• Warehouse number – the source EWM warehouse number, taken from the ODO header.
• Two-step picking – the two-step picking indicator. Taken from the product master data or from the wave:
Pick strategy is SAP EWM

Accordingly, when the wave is released this indicator is passed into the warehouse task in the field /SCWM/ORDIM_O-L2SKR and influences the choice of the storage type search sequence.
• Stock removal control indicator – a special indicator that is set for the product in its master record at EWM warehouse number level.
• WPT (warehouse process type) – taken from the ODO item; how it is determined is described in the previous point.
• Quantity classification – determined from the unit of measure the warehouse task will be created in. The setting looks like this:

Pick strategy is SAP EWM

The alternative units of measure (AUoM) used in the warehouse for a particular product are maintained in the product master record at global level:
Pick strategy is SAP EWM

Which AUoM the warehouse task is created in is determined by the rounding rules in the WPT settings, whose determination is described above:
Pick strategy is SAP EWM

• Stock type, the stock document category (sales order stock or project stock) and the stock usage – are taken from the ODO item; how they are determined we went through above.
• Hazard level gradation 1 – taken from the hazardous product master record, field HSMT_MD-STOKEY1 (maintenance transaction /SEHS/HMD)
• Hazard level gradation 2 – taken from the hazardous product master record, field HSMT_MD-STOKEY2 (maintenance transaction /SEHS/HMD)

So we have determined the storage type search sequence and the stock removal rule (if specified, the stock removal rule applies to all storage types with a higher priority than the stock removal rule specified in the storage type settings).

6. Determining the sequence of storage types

The sequence of storage types in which the system will look for the source storage bin one after another is defined in the following SPRO IMG setting:

Extended Warehouse Management - Goods Issue Process – Strategies - Define Storage Type Search Sequence:
Pick strategy is SAP EWM


Stock is searched for in the storage types one after another according to the sequence number. If a «storage type group» is specified, stock is searched for in all the storage types assigned to that group at once, according to the stock removal rule.
Storage types are assigned to a group in SPRO IMG:

Extended Warehouse Management - Master Data - Assign Storage Types to Storage Type Groups:
Pick strategy is SAP EWM

So we have determined which storage types stock will be searched for in and in which order they will be gone through, or whether stock will be searched for in several storage types at once if a storage type group is used.

7. Determining the source storage bin

The next step is the search for the source storage bin within the storage type.

In the storage types determined in the previous step, the system looks for available stock (in the table /SCWM/AQUA) by the following key fields, which it takes from the ODO item:
1. Product code
2. Stock type
3. Owner
4. Party entitled to dispose
5. Stock usage
6. Stock document category: sales order stock or project stock
7. The sales order or project number for special stock
8. The sales order item for sales order stock

The stock that was found is sorted according to the stock removal rule. The rule can be specified either when defining the storage type search sequence (point 5) or in the storage type itself:
Pick strategy is SAP EWM

The rule itself is configured in SPRO IMG:

Extended Warehouse Management - Goods Issue Process – Strategies - Define Stock Removal Rule:
Pick strategy is SAP EWM

The idea is as follows: every stock quant has certain characteristics. The stock removal rule specifies in which sequence to sort the stock, by which characteristics (fields) and in which direction (descending or ascending). The standard list of available sort fields looks like this:

Pick strategy is SAP EWM

So SAP EWM sorts the stock it found according to the stock removal rule, and it is in that sequence that it proposes source storage bins when creating the picking warehouse task.