21/05/2025

How to handle SAP Inventory Management in SAP Datasphere 

Abstract

Migrating to SAP Datasphere often raises questions about how to integrate certain SAP-specific data flows. For those familiar with SAP BW, the tight integration with SAP ERP has always been a key strength—particularly in areas like inventory management, where BW’s business content aligns closely with ERP processes.

In this blog post, we demonstrate that the same level of integration is achievable with SAP Datasphere. Specifically, we show how to implement inventory management in a similarl way as in BW. If you’re transitioning from BW to Datasphere and looking to establish integrated inventory management, this blog will be a valuable resource.

SAP MM-IM Analytics 

SAP Inventory Management is a SAP sub-module of SAP Materials Management and allows you to manage your stock, your materials and all related activaties (Goods Movements like Receips/Issues/Transfers, reservations) in an integrated environment. 

In SAP Business Warehouse, Inventory Management is handled via the well-know 2LIS (Logistics Information System) ABAP datasources.

The first thing to take into account is that classical ABAP datasources are no longer the best practice to integrate SAP data into Datasphere. Hence, the alternative to use a CDS view as a starting point to extract the information. CDS View I_GOODSMOVEMENTDOCUMENTDEX is the one used to represent the goods movements.

Architecture

The general architecture is rather classic with the use of CDS views instead of SAP ABAP datsources and replication/modeling activities in Datasphere in a similar way as in SAP BW4HANA. At the end, an object called Analytic Model is created and this object can be very easily consumed in a SAP Analytics Cloud story. 

Modeling

The integration begins with setting up a replication flow to ingest the required data into SAP Datasphere. To build the inventory logic, the following data sources are essential:

  • I_GOODSMOVEMENTDOCUMENTDEX – to retrieve stock movement data
  • I_GOODSMOVEMENTTYPE – to access master data related to movement types
  • TMCA – a table containing translations for special stock types. As no standard CDS view exists for TMCA, a custom CDS view must be created.

These elements form the basis of the inventory data flow within SAP Datasphere.

The data from TMCA and the movement type master data is first combined using a transformation flow. A graphical view is then created to enrich the goods movement data with additional attributes such as movement type descriptions and special stock indicators. This graphical view serves as the foundation for the Analytical Model, where the core SAP inventory logic can be applied.

In parallel to this transactional data flow, it is crucial to ensure that Time Dimension tables are generated at the Space level, as these are required for time-dependent calculations.

Once the Fact view is in place, you can generate an Analytical Model. Within this model, additional enhancements can be made, such as:

  • Calculated and Restricted Key Figures – for instance, creating a restricted key figure to calculate blocked stock or stock under quality inspection
  • Non-Cumulative Key Figures – which require special handling

For non-cumulative key figures, a column called RecordType must be present in the dataset (as an integer). The allowed values are:

  • 0 – Delta (each record represents a change)
  • 1 – Reference point (a snapshot of stock at a specific moment)
  • 2 – Delta included in reference point (used for movements prior to the reference point)

If you choose not to use a reference point, simply set all records to 0, and the stock will be calculated based on the complete history. To use a reference point, insert a single record with RecordType = 1 to represent the stock level at a given time. Any historical movements before this point should be marked with RecordType = 2.

Conclusion

In today’s fast-paced digital landscape, where data and cloud capabilities evolve rapidly, SAP Datasphere offers powerful opportunities—especially through its flexible dataflows.

If your focus is on Inventory Management reporting, we invite you to reach out. We’re happy to share our expertise and insights to help you make the most of these capabilities. With our proven experience and pre-built templates, we can quickly deliver a foundational setup to jumpstart your stock management project.

Fabian Magnabosco

Analytics consultant @ Cubis