This Data Flow Specification (DFS) defines the end-to-end data flow required to meet the following requirements:
The objective of the Stock Balances Analytical Model is to provide a comprehensive view of Material/Plant/Storage Location/Stock Type values and quantities at a given date, which reconciles to MB52.
Quantities and values are obtained from a combination of Goods Movement (MM) documents and Fi adjustment postings.
Snapshots of monthly and weekly inventories will be created and partitioned (how so it makes sense?)
A persisted/portioned flow, containing aggregated data will also be created. This aggregated view will carry the stock balances for a month by Material/Plant/Storage Location/Stock Type. The current month stock movements will be union-ed to it to get to the current month ending balance.
No differentiation in the handling of EWM managed plants are required. EWM handles the process, but each movement is reflected as a GoodsMovementDocument in table MSEG. This allows for a single process to calculate Closing Inventory.
The standard CDS views for physical stock and plant stock for EWM managed plants will be extracted and made available for reporting (if required for cross instance reporting...).
Need some words here.


| Extractor Name | Build Jira Ref For Extension Information |
|---|---|
No inbound field adjustments are applied. Standard technical fields are retained as delivered
Purpose:
Source: 1TL_S4Hx_I_GOODSMOVEMENTDOCUMENTDEX
Projection:
| Project Details |
|---|
Add as Key: MaterialDocumentYear |
Add as Key: MaterialDocument |
Add as Key: MaterialDocumentItem |
Note, keep keys MaterialDocumentKey1 - 6 for Delta Capture.
Projection:
| Projection Details |
|---|
Exclude Column: MaterialDocumentKey1 |
Exclude Column: MaterialDocumentKey2 |
Exclude Column: MaterialDocumentKey3 |
Exclude Column: MaterialDocumentKey4 |
Exclude Column: MaterialDocumentKey5 |
Exclude Column: MaterialDocumentKey6 |
Source: 1TL_S4Hx_I_GOODSMOVEMENTDOCUMENTDEX
Purpose:
Source: 1TL_S4HR_C_TranspOrdItemAnlytsSDEX

Filter:
(TransportationOrder <> '' OR TransportationOrder IS NOT NULL) |
|---|
Formula:
| Field | Formula |
|---|---|
| TransportationOrderItemUUID | BINTOHEX(TransportationOrderItemUUID) |
| TransportationOrderUUID | BINTOHEX(TransportationOrderUUID) |
| TranspOrdItemParentItemUUID | BINTOHEX(TranspOrdItemParentItemUUID) |
| SourceStopUUID: | BINTOHEX(SourceStopUUID) |
| DestinationStopUUID | BINTOHEX(DestinationStopUUID) |
| CarrierUUID | BINTOHEX(CarrierUUID) |
| ShipperUUID | BINTOHEX(ShipperUUID |
| ConsigneeUUID | BINTOHEX(ConsigneeUUID) |
| TranspOrdNetDuration | to_double(TranspOrdNetDuration) |
| TranspOrdItemShipperUUI | BINTOHEX(TranspOrdItemShipperUUID) |
| ProductUUID | BINTOHEX(ProductUUID) |
| NetDurationInHours | to_decimal((to_integer("TranspOrdNetDuration" / 10000)) + (to_integer((MOD("TranspOrdNetDuration", 10000)) / 100) / 60 ),5,2) |
Source: 1TL_S4Hx_I_TRANSPORDSTAGEANALYTICS
Purpose:

Filter:
| TranspOrdStageDestStopCategory = 'L' |
Projection: Exclude ALL, except:
| Projection Details |
|---|
Include Column: TransportationOrderUUID |
Include Column: TranspOrdStageDistance |
Include Column: TranspOrdStageDistanceUnit |
Include Column: TranspOrdStageNetDuration |
Formula:
| Field | Formula |
|---|---|
| TransportationOrderStageUUID | BINTOHEX(TransportationOrderStageUUID) |
| TransportationOrderUUID | BINTOHEX(TransportationOrderUUID) |
| TranspOrdStageSrceStopUUID | BINTOHEX(TranspOrdStageSrceStopUUID) |
| TranspOrdStageDestStopUUID | BINTOHEX(TranspOrdStageDestStopUUID) |
| CarrierUUID | BINTOHEX(CarrierUUID) |
| NumberOfStages | 1 |
Aggregation
| Field | Aggregation |
|---|---|
| NumberOfStages | SUM |
| TranspOrdStageDistance | SUM |
| TranspOrdStageNetDuration | SUM |
Source: 2VR_S2HARM_GoodsMovementDocumentDEX & xxxxxxxx

Filters:
| Flow | Filter Values |
|---|---|
| 2VR_S4HARM_I_GLAccountLineItemRAW | "ReferenceDocumentType" = 'PRCHG' AND |
| 2VR_S4HARM_I_GoodsMovementDocumentDEX | Material" != '' AND "InventoryStockType" != '' |
Projection:
Accept default union mappings
Source: 3VR_P2FINC_MaterialStock

Calculation:
| Name | Description | Data Type | Expression | Notes |
|---|---|---|---|---|
| RecordType | Used for Non-Cumulative Key Figures to track inventory balance over time. | Integer | case when 'PostingDate' < '20251231' then 2 when 'PostingDate' = '20251231' then 1 else 0 end | The dates must be parameterised to set the marker based on an input table. |
Supports:
Includes technical details for:
| Report Field Description | SAP Table-Field Name / process | Comments / Calculation / Formula / Restriction dimensions and values | Aggregation of data | Example SAP field data |
| CurrentStock | MatlStkChangeQtyInBaseUnit | Non-Cumulative Record Type Field: RecordType TimeDimension: PostingDate Earliest Reporting Start Date: TBD LatestReportingEndDate: TBD Set Unbooked Values to 0: X | LAST | 1,000 |
tbd
tbd