Reveal SAP EWM
Warehouse Order Creation Rules DEF and UNDE
Who hasn’t faced this situation before? You create a warehouse order, and EWM tells you that it used the warehouse order creation rule ‘DEF’ (or ‘UNDE’). And you’re like, “What the hell!?”
This blog post will help you avoid this situation in the future. It will also help you understand that sometimes seeing one of these two WOCRs is a signal to fix an issue in your customizing, and other times it might be just fine.
A minimal intro for those of you starting your journey with EWM:
A ‘Warehouse Order’ bundles multiple ‘Warehouse Tasks’ into processable work packages. The rules for this bundling process are called ‘Warehouse Order Creation Rules’. In the following, I will also use the abbreviation WOCRs to replace the long term.
For those of you who are not familiar with how the WOCRs work in general, I would recommend to read this blog before reading/watching this one here.
Adding a small summary here, which you can skip in case you are familiar with the concept (source SAP HTG for WHO enhancement):
(1) Warehouse tasks are created in the system (for example, manually or by wave release).
(2) (3) The system groups the warehouse tasks by queue and activity area, and determines possible warehouse order creation rules according to the settings made in the Customizing activity Define Search Sequence of Creation Rules for Activity Areas.
(4) The system tries to apply the warehouse order creation rule according to the sequence specified in the Customizing activity Define Search Sequence of Creation Rules for Activity Areas.
(5) The system sorts all the warehouse tasks based on the inbound sorting criteria of the warehouse order creation rule.
(6) (7) At this stage, the system checks whether the sorted warehouse tasks pass the filter of the warehouse order creation rule on item level and on subtotal level.
(8) The warehouse tasks that have passed the filters are considered when applying the limits specified in the warehouse order creation rule.
(9) All the warehouse tasks that belong to one warehouse order are passed for packing proposal determination according to the packing profile of the warehouse order creation rule. As a result of the packing proposal determination, the system determines the creation of pick-HUs, the splitting of warehouse tasks (for example, to fit in a pick-HU), and the exclusion of warehouse tasks from the current warehouse order.
(10) Finally, the warehouse tasks that belong to the current warehouse order are sorted according to the sorting rule of the warehouse order creation rule.
After all the warehouse tasks have been checked against the warehouse order creation rule, the warehouse tasks that have not been bundled are checked against the next warehouse order creation rule defined in Customizing.
Anyways – back to the initial question.
What are those DEF and UNDE WOCRs and why are they sometimes applied when creating WOCRs?
First a quick look into the standard customizing help text:
We recommend that you avoid using the following abbreviations to identify warehouse order creation rules, since we have already assigned them internally for existing warehouse order creation rules. This ensures that the identification you define for a warehouse order creation rule is unique.
- DEF: Standard rule
- UNDE: Remainder rule
…ok – that does not help us at all.
Another look into the SAP Press functional EWM books:
- If no warehouse order creation rule is set up in embedded EWM, it assigns all warehouse orders to default rule DEF.
- If there are no more warehouse order creation rules left in the sequence for a warehouse order, the system assigns them to default rule UNDE.
…that goes into the right direction abut also comes with a very limited amount of details.
The most helpful content that I’ve found over the years was this extract from the HTG for developers, working with WOs: ‘How To Program Warehouse Order Processing in Extended Warehouse Management’:
If a warehouse task doesn’t fit to any warehouse order creation rule, it’s bundled with the rule Undefined (UNDE), together with all the other warehouse tasks that don’t fit to any warehouse order creation rule.
If the system can’t find a warehouse order creation rule for an activity area in Customizing, the warehouse tasks are bundled with the warehouse order creation rule Default (DEF). This means that all the warehouse tasks for one delivery are bundled together if they are in the same activity area, except for the putaway warehouse tasks where the system creates one warehouse order for each putaway-HU warehouse task (fields FLGHUTO = X and TRART = wmegc_trart_put (1)).
Why do I have to search for this information in the HTG for developers? Why is it not included in the customizing help text?
Anyways – I still had some open questions, and the same is probably true for you. So, let us look into the system to see if we can find more details about this logic. As usual, I found some useful details that are not included in any of the SAP documents mentioned above!
While trying to structure this post, I decided to start by looking at the application area of the WOCR ‘DEF’, first in the context of putaway and internal tasks, and then in the context of stock removal. In the second part of this post, we will concentrate on the WOCR ‘UNDE’ and again separate it by process category (putaway vs. removal).
Throughout the whole article, I am working with test cases and examples to help you understand my findings. In addition to this, you will also find all repository objects that are responsible for controlling the logic.
ANALYSING the WOCR ‘DEF’
At first we want to understand the purpose of the WOCR DEF in detail. Remember, the HTG gave us the following information:
If the system can’t find a warehouse order creation rule for an activity area in Customizing, the warehouse tasks are bundled with the warehouse order creation rule Default (DEF). […] except for the putaway warehouse tasks where the system creates one warehouse order for each putaway-HU warehouse task (fields FLGHUTO = X and TRART = wmegc_trart_put (1)).
So, we start to analyze the behavior of the EWM standard in a situation where it cannot find any WOCR based on the given combination of activity area and activity. Let’s look at putaway and internal movements first, before we explore stock removal.
PUTAWAY/INTERNAL MOVEMENTS
I start using a warehouse process type of category ‘1’ (putaway) and removed the WOCR determination customizing for my given combination of AA and Activity. The only ones left for my AA were relevant for a different activity:
The coding which is responsible to apply WOCRs is called from FM /SCWM/WHO_PARALLEL_CREATE. Based on my customizing, it cannot find a WOCR for the given AA/activity and proceeds with the ‘special logic’ (trying to apply rule MFS or DEF). As our tasks are not relevant for a subsystem (rule ‘MFS’), the only option left is to hand over the constant for the rule DEF to the subroutine who_wcr_apply.
If we are talking about HU WTs of the type ‘putaway’ (WPT TRART = ‘1’ > see WPT customizing screenshot above), this subroutine will make sure to always create a separate WO for each WT.
For our putaway example that means one WO for each HU WT which is created with a WPT of category ‘1’:
Main takeaway? or What does that mean for you?
If you are
- working with handling units as part of the inbound process
- and you have a simple putaway step/process
- where you want to create one warehouse order for each HU to be putaway
…it is totally fine not to create any custom WOCR at all. You can keep the customizing lean at this point and work with the standard default (DEF) rule.
But again – this is only true if you are working with HU WTs and if your WPT is of type ‘putaway’. Once you switch to product WTs or WPTs of type internal movements (e.g. for replenishment) EWM still applies the DEF rule if it does not find a WOCR but it does not apply the logic to split the WTs into a 1-1 relationship within the WOs. As the screenshot below shows, we have now a 1-n relationship between WO and WT:
Putaway done! When and how does the DEF rule behave in the context of stock removal?
STOCK REMOVAL
Remember what the HTG told us
[…]This means that all the warehouse tasks for one delivery are bundled together if they are in the same activity area
Let’s try to find the logic behind!
Without any WOCR for the given combination of activity area and activity we are ending up with the same FM calling the same subroutine with the same constant as we saw it in our example for the putaway task creation. Subroutine wcr_default is the one that makes sure that warehouse orders do only receive tasks from one combination of activity area, queue and delivery / reference document / warehouse request:
Main takeaway? or What does that mean for you?
If you are working with warehouse requests (e.g. deliveries) and you do not have any specific requirement apart from
- creating one single warehouse order for all warehouse tasks of a single warehouse request
- which are removing stock from the same activity area
- and are assigned to the same queue
…you do not have to configure a custom warehouse order creation rule for that but can keep it lean and work with the EWM standard default (DEF) rule.
First part done. I think that was straightforward and easy to understand! Let us now have a look at the WOCR UNDE!
ANALYSING the WOCR ‘UNDE’
The HTG gave us the following information for this scenario:
If a warehouse task doesn’t fit to any warehouse order creation rule, it’s bundled with the rule Undefined (UNDE), together with all the other warehouse tasks that don’t fit to any warehouse order creation rule.
That is not a lot of details and as you can see further below, this is not 100% true. Anyways – we now want to analyse the behavior of the EWM standard in a situation where it indeed finds a WOCR for the given combination of activity area and activity but it cannot apply this rule (e.g. because the WTs did not pass the item filter).
Same as before, we first have a look at putaway and internal movements, before we explore the stock removal.
PUTAWAY
For this example I created a WOCR for the given activity area / activity but set the item filter in a way that our WTs would not pass it:
The relevant spot in the coding is the same as before where we ended up with rule ‘DEF’. Again, FM /SCWM/WHO_PARALLEL_CREATE tries to apply the WOCRs. In the scenario we are looking at now, it actually finds one WOCR for the given AA/activity (see internal table lt_twcrsseq):
Subroutine who_wcr_apply first tries to apply one of the WOCRs to the given WTs. As this fails, the FM proceeds with the ‘special logic’, trying to apply MFS or UNDE). As our tasks are not relevant for a subsystem/MFS, the only option left is to hand over the constant for the rule ‘UNDE’ to the subroutine who_wcr_apply, which then calls subroutine wcr_undefined:
The comment in subroutine wcr_undefined gives us a better understanding about what to expect:
* So-called “undefined” warehouse order creation rule that will be
* processed if all rules of a the activity area have been processed
* and there are still TOs, which were not bundled.
* This rule creates one bundle per dstgrp (in an activity area and
* queue).
@SAP Why can’t we have such details in the help text for the WOCR customizing? 🙂
Based on this we expect to end up with one WO for each combination of activity area, queue and distribution group. Note that in the context of putaway the term ‘distribution group’ refers to the deconsolidation group which can be assigned to the bins based on the activity area (sitting in table /SCWM/LAGPS):
…this is the 1st point that I had in mind when I said the text in the how-to-guide is not 100% correct. As in fact, this is not happening: “it’s bundled with the rule Undefined (UNDE), together with all the other warehouse tasks that don’t fit to any warehouse order creation rule”.
Note that EWM does not make a difference here between putaway or internal movements. No special rules apply based on the WPT category (like we saw before with the ‘DEF’ rule).
STOCK REMOVAL
In a similar situation during stock removal, the call stack looks exactly the same. Subroutine who_wcr_apply fails to successfully apply one of the WOCRs to each of the given WTs and FM /SCWM/WHO_PARALLEL_CREATE proceeds with the ‘special logic’ (trying to apply WOCR MFS or UNDE).
As our tasks are not relevant for a subsystem (rule ‘MFS’), the only option left is to hand over the constant for the rule ‘UNDE’ to the subroutine who_wcr_apply, which then calls subroutine wcr_undefined. For stock removal we can find a split logic similar to the one that we saw for the putaway scenario above. Independent from the WOCR logic discussed here, EWM fills the distribution group field in the WT with the consolidation group of the warehouse request item. For us this also means that the WOCR ‘UNDE’ will split by default based on this consolidation group for removal tasks (in the same way as it split based on the distribution group during putaway). In the context of stock removal the term ‘distribution group’ refers to the consolidation group which can be assigned the warehouse request items.
Example with a single consolidation group:
…this is the example that I had in mind when I wrote that the statement from the how-to-guide is not 100% true:
If a warehouse task doesn’t fit to any warehouse order creation rule, it’s bundled with the rule Undefined (UNDE), together with (!!) all the other (!!) warehouse tasks that don’t fit to any warehouse order creation rule.
Summary
Unfortunately the help text included in the customizing does not help much here and also the functional books from the SAP press do only provide an absolute minimum of technical details. The HTG for WO enhancements gave us a good picture but again, a comprehensive understanding of how and why EWM applies the WOCRs DEF and UNDE could only be gathered based on a code-review.
Key points that you should take away from this blog post:
In case you do not define any WOCR at all for the given combination of activity area and activity, EWM applies the special rule ‘DEF’
- For HU WTs created with a WPT of category ‘1’ (putaway), EWM creates a dedicated WO for each WT
- For product WTs or any other kind of WPT category, EWM creates one single WO for all such WTs in the given warehouse order creation run
- For stock removal WTs, EWM creates one WO per AA & queue for each delivery
In case you have defined WOCR(s) for the given combination of activity area and activity but the WTs cannot be processed by those WOCR(s) (e.g. do not pass the filters), EWM applies the special rule ‘UNDE’
- In the context of putaway, separate WOs are created based on activity area, queue and the distribution group of the destination bin
- In the context of stock removal, separate WOs are created based on activity area, queue and the consolidation group of the corresponding warehouse request items
For those of you who want to explore further details about the standard coding, the subroutine who_wcr_apply might be the most straightforward entry point:
This summary marks the end of this post. As usual, I hope I could add some value for some or the other.
In any case, thanks for spending your time to read this stuff! Enjoy learning and visit my blog again from time to time!