In an SAP S/4HANA Embedded EWM implementation for a pharmaceutical client, we are handling products with strict shelf life (SLED) requirements.
Business requirement:
During outbound picking, the system should propose only those batches or HUs which have a minimum remaining shelf life (for example, at least 90 days).
If no stock meets the shelf life criteria, the system should stop Warehouse Task (WT) creation and show an error message.
During inbound putaway, products with shorter shelf life should be directed to fast-picking or high-priority storage types.
What is already checked:
Shelf life data maintained in product master
Batch management is active
FEFO strategy maintained
Search sequence and sort rule configured
However, the system behavior is still not fully controlled as per business expectation.
Questions:
What is the best design approach in SAP EWM to control WT creation based on remaining shelf life?
Should this be handled using configuration (search sequence and sort rule), or does it require enhancement using BAdI?
Which enhancement spot or BAdI is commonly used in real projects for this type of validation?
Controlling Warehouse Task Creation Based on Product Shelf Life (SLED) in SAP EWM
In pharmaceutical and regulated industries, controlling remaining shelf life during WT creation is critical for compliance. While FEFO and sort rules help, they are not sufficient to fully enforce minimum SLED validation.
A robust design requires a combination of:
Standard configuration
Batch determination strategy
Stock removal control
Enhancement (if strict blocking is required)
Below is the recommended real-project approach.
🔹 1️⃣ Understand Standard System Behavior First
Standard SAP EWM supports:
✔ FEFO (First Expired First Out)
✔ Batch determination
✔ Shelf life relevance in product master
✔ Sort rules based on SLED
However:
❌ Standard FEFO does not block WT creation if minimum remaining shelf life is not met.
❌ It only sorts stock — it does not enforce business rule validation.
That is why configuration alone is often insufficient.
🔹 2️⃣ Outbound Picking – Best Practice Design
✔ Step 1: Maintain SLED & Minimum Remaining Shelf Life
In product master:
Maintain shelf life expiration data
Maintain minimum remaining shelf life
Ensure batch classification is correct.
✔ Step 2: Use FEFO + Sort Rule (First Level Control)
Configure:
Stock removal strategy = FEFO
Sort rule based on expiration date
Batch determination active
This ensures:
👉 System proposes oldest valid stock first.
But this alone does not enforce 90-day rule strictly.
✔ Step 3: Enforce Hard Stop Using BAdI (Recommended for Pharma)
If business requires:
Then enhancement is required.
Commonly Used BAdI in Real Projects:
/SCWM/EX_CORE_STOCK_REMOVAL
or
/SCWM/EX_WHO_CREATE
These BAdIs allow you to:
Validate remaining shelf life dynamically
Compare SLED against current date
Throw error message
Prevent WT creation
This is the most reliable approach in regulated environments.
🔹 3️⃣ Inbound Putaway – Directing Short SLED to Fast-Pick Areas
For inbound control:
✔ Option 1: Storage Type Search Sequence
Define:
Storage type determination based on:
Shelf life remaining
Stock type
Putaway control indicator
But this requires enhancement if dynamic logic is complex.
✔ Option 2 (More Flexible): BAdI for Storage Type Determination
Common BAdI used:
/SCWM/EX_CORE_PTS_DET
This allows:
Reading SLED at GR
Determining remaining days
Assigning storage type dynamically
Short SLED → Fast picking area
Long SLED → Bulk storage
This is widely used in pharma implementations.
🔹 4️⃣ Recommended Overall Architecture
For strict pharma compliance:
✔ Configuration Layer
FEFO strategy
Sort rule
Batch determination
Minimum remaining shelf life in material master
✔ Validation Layer (Enhancement)
BAdI to enforce minimum remaining SLED
Hard error if criteria not met
✔ Putaway Optimization Layer
Dynamic storage type determination via BAdI
This ensures:
Compliance
Audit readiness
Controlled WT creation
🔹 5️⃣ Common Design Mistakes
❌ Relying only on FEFO
❌ Not validating remaining days dynamically
❌ Ignoring time zone/date calculation
❌ Allowing manual override without audit log
❌ Not testing edge cases (partial batch, mixed HU)
🔹 6️⃣ Real Project Recommendation
In pharmaceutical projects:
✔ Always implement enhancement for SLED validation
✔ Log validation messages for audit
✔ Prevent manual bypass
✔ Test year-end date transitions
✔ Document SLED logic in functional specification
Because in regulated industries:
🔑 Final Answer to Your Question
✔ Is configuration alone enough?
No — configuration handles sorting but not strict blocking.
✔ Is BAdI required?
Yes, if business requires minimum remaining shelf life enforcement.
✔ Which BAdIs are commonly used?
/SCWM/EX_CORE_STOCK_REMOVAL/SCWM/EX_WHO_CREATE/SCWM/EX_CORE_PTS_DET(for putaway logic)