SAP TM Hub · Specialist Voice perspective

AI-powered rail wagon planning in SAP TM: moving beyond average assessed weights

Predicting what a wagon will really carry — a practitioner's design proposal.

During my time working in Australia on an SAP S/4HANA implementation for the grain supply chain, I had the opportunity to work closely with transportation and logistics processes for a bulk agricultural commodity client. One area that sparked an interesting idea was rail wagon planning for commodities such as wheat and canola.

At the time, the client was using Average Assessed Weight (AAW), a planning assumption that represents the estimated grain weight expected to be loaded into a rail wagon. This planning weight was used to determine wagon requirements and capacity utilisation during rail transportation planning. The challenge was that the AAW did not always match the actual grain weight loaded into each wagon. If the AAW underestimated the actual loading weight, planners could allocate more wagons than necessary. If it overestimated the actual loading weight, the planned quantity might not fit within the wagon's allowable payload. As a result, differences identified during loading could lead to last-minute adjustments to wagon allocation and rail schedules. In extreme cases, there was also a risk of exceeding the wagon's permitted loading limits. Furthermore, grain characteristics and loading conditions can vary significantly due to factors such as moisture content, grain grade, origin, seasonal conditions and storage conditions.

In this proposed concept, SAP TM would provide the transportation and commodity information available during planning, while additional data such as grain moisture, density, origin, season and historical loading results would be collected from relevant operational and external data sources. An AI/ML model could then use these inputs to predict the expected loading weight for a rail wagon.

The prediction would be returned to SAP TM as an additional planning input, rather than changing the wagon's actual capacity. SAP TM would continue to apply the wagon's physical and regulatory limits when performing the planning and optimisation.

How the proposed solution would work

1. Freight Unit and transportation data

During the planning process, SAP TM would have the relevant transportation requirement, such as commodity, quantity, origin and destination. Additional grain-related information required by the AI model could be collected from appropriate operational or external data sources.

2. AI/ML prediction

Before the final wagon allocation is determined, the proposed AI/ML service on SAP BTP would use available information such as:

  • Commodity and grade
  • Moisture and bulk density
  • Origin and season
  • Storage/environmental conditions
  • Wagon type and capacity
  • Historical loading and weighbridge data

The model would then predict the expected loading weight for the wagon.

For example:

Predicted loading weight = 58.5 T

3. Prediction provided to SAP TM

The predicted weight would be returned to SAP TM as an additional planning input. It would not replace or change the wagon's master-data capacity.

For example:

Wagon maximum capacity = 60 T
AI predicted loading weight = 58.5 T

The 60 T remains the hard physical/regulatory limit, while 58.5 T represents the expected loading weight used for planning.

4. Rail wagon planning and optimisation

SAP TM could use the predicted loading weight when determining:

  • Number of wagons required
  • Quantity allocated to each wagon
  • Expected wagon utilisation

The SAP TM optimiser uses this prediction together with the existing transportation constraints to determine an efficient and feasible wagon allocation. The optimiser can consider factors such as wagon capacity, wagon availability, commodity compatibility, origin and destination, route, quantity and other operational constraints.

SAP Agricultural Contract Management (SAP ACM) manages commodity contracts, deliveries, and quality characteristics. In this scenario, contract quality attributes such as commodity type, grain grade, moisture content, and grain temperature are transferred to the Freight Unit and used as inputs to the AI prediction model.

Why use AI instead of a simple calculation?

A straightforward Volume × Density calculation provides a transparent, physics-based estimate of grain weight and serves as a useful planning baseline. However, actual wagon loading can vary due to factors such as moisture content, grain quality, origin, season, storage conditions, and historical loading patterns.

The proposed AI/ML model aims to learn these real-world variations from historical loading and weighbridge data to improve payload predictions. However, more data and more variables do not automatically result in better predictions. The model should therefore be validated against two established benchmarks:

  • Average Assessed Weight (AAW), the current planning method.
  • Rules-based calculations, such as wagon volume combined with measured or assumed grain density.

AI should only be adopted if it consistently delivers a meaningful and repeatable improvement in prediction accuracy over both approaches during historical back-testing or a controlled pilot.

Importantly, AI does not replace operational or regulatory limits. Wagon payload limits, volume constraints, axle-load restrictions, and route requirements remain fixed. The role of AI in SAP TM is simply to predict the most realistic usable payload within those existing constraints, helping planners make more accurate wagon allocation decisions.

Flow diagram of the proposed prediction loop: SAP ACM passes contract quality attributes to the SAP TM Freight Unit; SAP TM sends planning attributes to an AI/ML prediction service on SAP BTP, which returns the predicted loading weight to SAP TM for wagon planning and VSR optimisation.
Figure 1: Proposed prediction flow between SAP ACM, SAP TM and the SAP BTP prediction model

How the prediction could be integrated

Prediction: A BTP AI/ML service predicts the usable loading weight per wagon, considering relevant safety and transportation limits.

Trigger and fallback: The prediction could be triggered when the relevant Freight Unit planning attributes become available or through a planner-initiated action before optimisation. If no prediction is returned, SAP TM would fall back to the existing AAW or rules-based planning value.

Storage: The predicted weight could be written to a custom Freight Unit field, for example ZZ_PRED_WT.

Planning: ZZ_PRED_WT alone would not influence the optimiser. An enhancement would be required to translate the stored value into the planning-relevant weight or capacity demand consumed during FU-to-wagon assignment, rather than creating a new equipment-demand object.

Optimisation: The SAP TM VSR optimiser would use the predicted weight when allocating quantities to wagons, while the wagon's physical/regulatory capacity remains a hard constraint. A planner override would take precedence over the AI value.

Replanning: A changed prediction would not automatically trigger replanning. The planner can review, override or re-trigger the prediction and run the optimiser again if required.

Conclusion

The model can run in parallel with the current Average Assessed Weight (AAW) planning approach for a defined set of rail shipments without changing existing loading operations. Predicted weights and wagon requirements from the AI model can then be compared against both current planning results and actual shipment outcomes. To justify adoption, the model should demonstrate at least a 10% reduction in mean absolute prediction error compared with both AAW and the rules-based baseline over a representative planning period, ideally a full season, with no increase in overload or capacity exceptions. Improvements in wagon utilisation, replanning frequency and planning lead time would further strengthen the business case while maintaining operational safety and compliance.

Sources

  1. SAP SE: Rail Freight Order. SAP Help Portal, Transportation Management (TM) in SAP S/4HANA, version 2025 FPS01 (February 2026). help.sap.com (accessed 5 October 2026). Documents the rail freight order as the model of a train with locomotives and railcars.
  2. SAP SE: Capacities and Utilization in Rail Freight Orders. SAP Help Portal, SAP Transportation Management 9.6 FPS02; an equivalent chapter exists in Transportation Management for SAP S/4HANA 2025 FPS01. help.sap.com (accessed 5 October 2026). Reference for payload and utilisation handling on railcars.
  3. SAP SE: VSR Optimization, including the subchapter Constraints for VSR Optimization. SAP Help Portal, SAP Transportation Management 9.6 FPS02. help.sap.com (accessed 5 October 2026). States the optimiser's goal as a cost-effective assignment of freight units to capacities under constraints.
  4. SAP SE: Freight Unit Building Rule. SAP Help Portal, Transportation Management (TM) in SAP S/4HANA, version 2025 FPS01 (February 2026). help.sap.com (accessed 5 October 2026). Planning quantities such as gross weight form the basis for checking resource capacity.
  5. SAP SE: Freight Unit (A2X), API CE_FREIGHTUNIT_0001. SAP Business Accelerator Hub. api.sap.com (accessed 5 October 2026). Official definition of the freight unit as a set of goods transported together across the transportation chain.
  6. SAP SE: Integrations between ACM and TM. SAP Help Portal, SAP S/4HANA, bulk transportation extension for SAP Agricultural Contract Management, version 2203. help.sap.com (accessed 5 October 2026). Documents the standard integration of ACM planning documents with TM freight units, the Load Data Capture of actual loading weights, and cost distribution.
  7. SAP SE: What Is SAP AI Core? SAP Help Portal, SAP Business Technology Platform. help.sap.com (accessed 5 October 2026). The SAP BTP service for operating custom machine-learning models, as referenced in this proposal.
  8. Note on evidence: the Average Assessed Weight practice and the loading observations are the author's practitioner evidence from an SAP S/4HANA implementation for an Australian grain supply chain. The proposed ZZ_PRED_WT mechanism is the author's design proposal; the SAP TM Enhancement Guide (SAP Help Portal, release-independent) documents the enhancement layer on which it would rely.

Next: meet Hari Krishnan — or explore the SAP TM Hub and transportation planning in SAP TM.