Reveal SAP EWM

Storage bin sorting during putaway (CLSP)

This blog is supposed to clear up one of the biggest misconceptions in the context of bin determination during putaway task creation in SAP EWM.
Before we jump into the system, let us quickly make sure to understand the scenario from material flow / process perspective – Imagine you want to putaway a handling unit – let us assume a pallet loaded with some cartons – into a pallet rack. You have defined a strategy to determine an empty bin (it works in the same way with strategy ‘Addition to stock / Empty bin’). All bins have the same bin type. So far so good. However, there might be lots of empty bins in the given rack. So how should EWM now decide which bin to suggest for the putaway process?
SAP EWM storage bin sorting CLSP_01

At this point, the bin sorting comes into the game!

I will explain the topic for you based on the following agenda:

  • The standard logic
  • The configuration
  • The bin sorting
  • The coding
  • Options for enhancement

As a starting point it is important to understand that whenever EWM is sorting something based on storage bins (e.g. warehouse tasks within warehouse orders, bins during putaway etc.) it is using so called ‘sort sequence numbers’. Those numbers are assigned to storage bins. EWM never uses those sequence numbers alone. It usually uses a combination of a sequence number along with an activity area and an activity type. Different combinations of activities, activity areas and sequence numbers can be attached to storage bins. Either based on the execution of a report (which is reading the sorting logic from the customizing) or based on an excel upload file.

SAP EWM storage bin sorting CLSP_02
SAP EWM storage bin sorting CLSP_03
The result with both options is saved in table /SCWM/LAGPS. I highlighted the important fields within the screenshot below:
SAP EWM storage bin sorting CLSP_04
The following activities can be used to attach a sort sequence number to a storage bin in EWM standard:
SAP EWM storage bin sorting CLSP_05
Based on this it seems to be obvious to sort bins based on the activity type ‘PTWY – Putaway’ in order to sort bins for the putaway process scenario described at the beginning of this post. Far from it! The sequence numbers assigned to the bins for activity type ‘PTWY’ is only used for the sorting of putaway warehouse tasks within warehouse orders (e.g. for travel path optimization in case you assign multiple warehouse tasks for putaway to one warehouse order). It is not used to sort bins during the actual determination of the destination bin. EWM indeed uses the sequence number for this activity type during putaway task creation but only after the destination bin has already been determined (we will come back to this point later again!). So if it is not the activity type PTWY, what else is being used in order to sort the bins during the destination bin determination for our example above? The answer to this question is the assignment of the combination of sort sequence numbers, activity area and the activity type ‘CLSP – Cross-Line Stock Putaway’ to the given bins.

The configuration

The creation of the activity area and its sorting can be done here:

  • Define an activity area via SPRO: SCWM Extended Warehouse Management -> Extended Warehouse Management -> Master Data -> Activities Areas -> Define Activity Areas
  • Then assign this Activity Area to storage type. Path in SPRO: SCWM Extended Warehouse Management -> Extended Warehouse Management -> Master Data -> Activities Areas -> Assign Storage Bins to Activity Areas
  • Then define sort sequence for CLSP Activity. Path in SPRO: SCWM Extended Warehouse Management -> Extended Warehouse Management -> Master Data -> Activities Areas -> Define Sort Sequence for Cross-Line Stock Putaway
SAP EWM storage bin sorting CLSP_06
SAP EWM storage bin sorting CLSP_07
SAP EWM storage bin sorting CLSP_08
SAP EWM storage bin sorting CLSP_09
SAP EWM storage bin sorting CLSP_10
Here you can now provide a logic for the assignment of the sequence numbers for sorting. For aisle, stack, level and subdivision you can decide whether you want to sort ascending or descending as well as whether you want to alternate or not. An example for the sort sequence between the 3 parameters is visualized in the screenshot below. Here I sorted 1st based on the stack and 2nd based on the level. You can see that EWM will first assign sequence numbers to all stacks of a given level before it proceeds with all stacks for the next level. This screenshot also shows how the ‘alternating’ approach is supposed to work. You can see that EWM counts the stack up until the max value and then decreases again from there for the next level. When you set this to ‘not alternating’ it would start again from the lowest stack value:
SAP EWM storage bin sorting CLSP_11
SAP EWM storage bin sorting CLSP_12
Here another example where I sorted 1st based on the level and 2nd based on the stack:
SAP EWM storage bin sorting CLSP_13
SAP EWM storage bin sorting CLSP_14
For all activities other than CLSP, EWM is sorting the aisles one-by-one. Only for CLSP it always sorts based on the aisle first. Another example to help you understand this approach along with the options for alternating:
SAP EWM storage bin sorting CLSP_15
Note: If you leave all other fields blank, the system simply sorts in ascending order based on the storage bin names. In addition to this, you have a parameter to fix the sorting. You can use this checkbox to ensure that the sorting is not changed during picking with radio frequency (RF). If you select this checkbox, it is not possible for the operator to change the path sequence during picking.
SAP EWM storage bin sorting CLSP_16
And that is it for this post! Pretty sure most of you are already using one or the other tool that I presented here. I hope that some of you still found something new here that helps you during your daily tasks in the future!

The bin sorting

Once the customizing is completed as shown above, the bins have to be sorted via transaction /SCWM/SBST:

SAP EWM storage bin sorting CLSP_17
SAP EWM storage bin sorting CLSP_18
Once the sorting has been executed, the sequence numbers are saved in table /SCWM/LAGPS as well as /SCWM/LAGP. This is also different compared to other activities where the sorting is only saved in the LAGPS table. Could not find the reason why we have it in two tables honestly. Maybe anyone has a good idea!?
SAP EWM storage bin sorting CLSP_19

The coding

It is interesting to observe that the although activity CLSP is not given as activity type in the customizing of the warehouse process type, it is still used for the sorting in our scenario:
SAP EWM storage bin sorting CLSP_20
SAP EWM storage bin sorting CLSP_21
Seems SAP noticed at some point that the WPT parameter is required for the activity which is used for the sorting within the WO (mentioned at the beginning of this post) and thus, needed a different approach to determine the sequence for the bin selection. For non-MFS storage types the sorting is done in include /SCWM/LPUT_BIN_DETF77, subroutine SORT_EMPTY_BINS, right after a list of possible destination bins had been determined via the subroutines BIN_DETERMINATION_1 & *2 in include /SCWM/LPUT_BIN_DETF17/ /SCWM/LPUT_BIN_DETF26. This is at least true for the empty bin determination. I have to admit that I did not spend time on analyzing the exact spot for addition to stock. However, I am pretty sure the function module which is finally used for the actual sorting is the same for both cases (so if you want to debug your specific strategy, just put a breakpoint into this one): /SCWM/ACT_AREA_EVALUATE
The FM imports the table of unsorted bins, reads the bin sorting against the imported activity type from the tables listed at the beginning of this article and exports a table with the same bins sorted accordingly:
SAP EWM storage bin sorting CLSP_22
SAP EWM storage bin sorting CLSP_23
…to be honest – I do not understand why the standard is coded like this. In line 26 it uses a constant to set the activity for our context. Then it fills lt_lgpla_unsorted from imported table IT_ILAGPL just to sort lt_lgpla_unsorted within the FM /SCWM/ACT_AREA_EVALUATE based on activity CLSP. However, the internal table that was imported to our subroutine here already had the field CLSP_SORT:
SAP EWM storage bin sorting CLSP_24
SAP EWM storage bin sorting CLSP_25
So why not just sort table IT_ILAGPL based on this field in line 32 ff. and return from the subroutine instead of calling FM /SCWM/ACT_AREA_EVALUATE? A big beer on my bill for anyone who can explain to me why this would not work! The logic for MFS storage types is less complex. Method /SCWM/CL_CORE_PUTSTRA-DET_EMPTY_BIN sorts the internal table of bins. As mentioned above, the field CLSP_SORT already exists in the LAGP table and here EWM does what I suggested above. The sequence number is read along with the bin and so does not have to be re-determined with an additional FM:
SAP EWM storage bin sorting CLSP_26
SAP EWM storage bin sorting CLSP_27
Now that we understood how the sorting during bin determination works based on the CLSP sequence, let us have a quick look at the technical details about the logic to sort WTs within WOs based on the PTWY sequence. Once the destination bin for a given WT has been determined (like described above), EWM fills the field PATHSEQ in the /SCWM/ORDIM_O table.
It determines the sequence number based on the activity of the WPT (which is ‘PTWY’ for putaway processes):
SAP EWM storage bin sorting CLSP_28
SAP EWM storage bin sorting CLSP_29
The determination of the sequence number is done via FM /SCWM/LAGPS_READ_SINGLE, called from /SCWM/TO_ACT_AREA_DET –> /SCWM/ACT_AREA_EVALUATE:
The sorting in the context of warehouse order creation is done in include /SCWM/LWHO_MAINF03, subroutine who_to_sort. EWM is considering the PATHSEQ field by default in case you do not specify a sort rule. However, you can also consider this field along with a list of other sort criteria within your customized sort sequence:
SAP EWM storage bin sorting CLSP_30
SAP EWM storage bin sorting CLSP_31
SAP EWM storage bin sorting CLSP_32
This sorting is not mandatory though. You could also create such warehouse orders without having any PTWY sorting in place. The following flow-chart should visualize and summarize what we’ve learned so far:
SAP EWM storage bin sorting CLSP_33

Options for enhancements

As you know it from my previous blog posts, I use to give you some options to enhance the standard logic. This section is limited to the sorting of bins during the determination of the destination. Enhancements of the sorting within the WOs is not in scope here. You can look into this blog post in case you want to learn more about enhancing the WOCRs.

Badi /SCWM/EX_CORE_PTS_FILT_SORT is one that will work here for sure, as the name already suggests:

SAP EWM storage bin sorting CLSP_34
SAP EWM storage bin sorting CLSP_35
It is called right after EWM has determined a list of possible destination bins for a given WT and saved those in an internal table (as mentioned above, this is done in include /SCWM/LPUT_BIN_DETF77, subroutine SORT_EMPTY_BINS):
The interface allows to change the sorting within this table of possible destination tasks:
SAP EWM storage bin sorting CLSP_36

EWM delivers a sample implementation which might give you some good ideas about how to implement a custom sorting here (class /SCWM/CL_EI_CORE_PTS_FILT_SORT).

Final thoughts & remarks

  • The sort sequence number for CLSP is only relevant in case multiple bins are available with the same characteristics related to your putaway strategy. EWM first determines optimal bins e.g. based on the bin type and/or the storage section. Only if multiple valid bins exist with the optimal combination, the sequence numbers for CLSP sorting are applied
  • You might have noticed that if you do not create the activity area and the sorting for the CLSP activity at all, you will still get a destination bin during putaway task creation. In this case, EWM will simply sort the bins by their names.
  • Seems SAP also noticed that the topic is quite confusing. They released note 2992048 but you do not need to read that once you’ve read and understand this blog post 🙂

…and here we are again at the end of the article. The intention of this blog post was to shed some light and help you to avoid confusion around this topic. Hope I could provide some value for one or the other!

Please feel free to subscribe to my blog updates or my youtube channel in case you want to be notified about new posts!

Get my monthly blog-updates!

Subscribe to my Youtube channel!