Vehicle Compartment Management in SAP TM: Challenges and a Practical Cockpit-Driven Solution

Bulk and tank-based transport operations require a level of control that goes beyond standard “vehicle-level” planning (principle when we talk about IS-OIL segment). In these scenarios, the real planning unit is the compartment: each tank has a fixed capacity, operational constraints, and often strict traceability requirements (e.g., seals and witness envelopes) that must be recorded per compartment, not just per trip.
This article explains how we implemented vehicle compartmentation in SAP TM, combining a cockpit-driven user flow, robust resource master data, custom apps to reduce dependency on customizing transports, and an ABAP enhancement (a Z-class) to automatically split Freight Units (FUs) so quantities fit exactly into each compartment.
1) The real challenge: planning by compartment with traceability and control
In compartment-based logistics, the planner must ensure that:
- Load is distributed across tank compartments with fixed capacity.
- A single shipment/FU that exceeds a compartment must be split consistently.
- Operational traceability is maintained per compartment, including:
- Seals
- Witness envelopes (when applicable)
- Business rules can be enforced at the compartment level (e.g., only accept if full, or at least 99%), potentially varying by material/product.
The key concept is to treat the compartment as a first-class operational entity in SAP TM planning.
2) Cockpit view: assigning shipments/FUs per compartment (including seals and witness envelopes)
In the Transportation Cockpit, the process is designed to be user-driven and auditable:
- The user selects the vehicle resource.
- The cockpit displays the vehicle’s available compartments (tanks).
- For each compartment, the user:
- Selects the Freight Units / shipments to be loaded into that specific tank
- Assigns/adjusts the quantity allocated to the compartment (with split support when needed)
- Selects the seals and witness envelopes specifically for that compartment

Why seals and witness envelopes per compartment matter
Operational traceability typically happens at tank level: each compartment can have its own seal numbers and envelope references. With this cockpit approach, the user can record exactly which seals/envelopes belong to each compartment, avoiding generic “vehicle-level” control and improving compliance and audit quality.
3) Compartment-level business rules: “must be full”, 99% thresholds, and material-based logic
A major advantage of this design is that it naturally enables business validations per compartment, instead of forcing global vehicle-level checks.
Examples of rules that can be implemented:
- Only accept allocation if the compartment is 100% full
- Accept allocation only if it reaches a defined threshold, such as ≥ 99% (or 98%, etc.)
- Apply different thresholds and validations based on:
- Material/product
- Compartment type
- Vehicle profile / operational scenario
- Any other business constraints
This makes the solution future-proof: as policies evolve, rules can be added with the right granularity—at compartment level—without redesigning the whole process.
4) When the shipment is bigger than the compartment: automated splitting via a Z-class
One of the critical operational problems is when a selected shipment/FU quantity is greater than the chosen compartment capacity. Without automation, the user cannot reliably achieve a 1:1 match between the compartment and the FU quantity.
Solution
We developed a Z-class to automatically:
- Detect the capacity mismatch (FU > compartment)
- Perform the required split
- Create new Freight Units with quantities exactly matching the compartment capacity
- Enable a clean 1:1 assignment between FU and compartment
In practice, the compartment drives the quantity: the system generates “right-sized” FUs, and the cockpit becomes a precise allocation tool instead of a manual workaround.
5) Multi-plate trailers: resource combination in /SCMTMS/RES01
For trailer operations where more than one plate is involved (e.g., tractor unit + trailer), we created a resource combination in /SCMTMS/RES01:
- Assign the tractor plate
- Assign the trailer plate
- Use the combined resource for planning and execution consistency
This ensures SAP TM represents the physical execution setup accurately.

6) Compartment profile in the resource: effective compartment structure in master data
Still in /SCMTMS/RES01, under the Transportation tab, we selected a compartment profile. This profile is what effectively defines:
- The compartment structure (number of compartments)
- The way compartments are split and displayed in the cockpit
In other words, cockpit behavior is anchored in consistent master data—not scattered logic.

7) Reducing customizing dependency: user-facing apps for compartments and compartment types
Because compartment definitions are often treated as customizing that requires transports (requests), it becomes a bottleneck for operational changes.


Solution
We created dedicated apps so users can maintain:
- Compartments
- Compartment profiles
- Compartment types
This improves agility and reduces governance overhead for day-to-day operational needs.
8) Technical overview (high level): how the Freight Unit copy/split method works
The copy_freight_unit method (Z implementation) follows a robust BOPF-based pattern:
- Initialize helpers and copy assignments (
et_assign = it_assign) - Deduplicate FU keys to avoid processing the same FU multiple times
- Use the TOR Service Manager for actions and the Transaction Manager for saves
- For each original FU:
- Calculate how many additional copies are required (
lv_copy_number) - Execute the BOPF action to copy/create FUs (e.g.,
...za_tm_copy_fu) and get source→target key links - Save the transaction and validate messages (prevent partial results)
- Read new FU root/item data
- Copy/adjust item rows and quantities
- Replace original FU assignments with the newly created FU(s)
- Final recalculation step to ensure quantities/totals are consistent
- If any ERROR/ABORT occurs, clear the output assignments to avoid returning incomplete results
This is essential in compartment planning: the result must be consistent end-to-end, otherwise it becomes an operational risk.
Conclusion
Vehicle compartment planning in SAP TM becomes truly operational when the solution combines:
- A cockpit-driven compartment allocation flow
- Automated FU splitting to fit exact compartment capacity
- Seals and witness envelopes selected per compartment for traceability
- Flexible compartment-level business rules (full tank, 99% thresholds, material-based constraints)
- Strong master data modeling in /SCMTMS/RES01
- User-facing apps to reduce customizing and transport dependency
When compartments are treated as first-class entities in the planning process, SAP TM aligns with real-world execution—and the solution stays extensible as business rules evolve.