Document Links

 

Introduction

This Data Flow Specification (DFS) defines the end-to-end data flow required to meet the following requirements:


KPI

Analytical Model

Stock Balances

4MA_P2FINV_MaterialStock

Freght KPI Report (ERP-1795)

xxxxxxxxxx

Freight Cost Report (ERP-1792)

xxxxxxxxxx

Carrier Performance (ERP-1782)

xxxxxxxxxx

Freight Cost Allocation (ERP-2359)

4MA_P2FTMS_FrtCstAlloc


Stock Balances

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.

EWM Managed Plants:

No differentiation in the handling of EWM managed plants is 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).


Bonded Stock Reports:

Req NoRequirementDescriptionSource TablesAnalytical ModelNotes
0Current Bonded Stock PositionCurrent stock quantity and value by Plant/SLOC/Material/Batch/StockType, filtered to bonded SLOCs and/or Plants2VR_S4HARM_GoodsMovementDocumentDEX4MA_P2FINV_MaterialStock (reuse)Already built -  filter to bonded SLOC/Plant in SAC story. No new AM required. NonCumulative KF CurrentStock already defined. Reconciles to MB52.
1Inward MovementsProcurement receipts (GR against PO), production FG receipts, intercompany inbound — bonded plants/SLOCs only2VR_S4HARM_GoodsMovementDocumentDEX4MA_P2FINV_MaterialStock (reuse)Filter MvT: 101/501/531/561/101 interco. Plant/SLOC filter for bonded scope. PO reference available via PurchaseOrder field on GoodsMovementDocumentDEX.
2Outward Movements - Export/Domestic SalesGI against outbound delivery (MvT 601/641 etc.). Identifies export vs domestic via customer country or sales org.2VR_S4HARM_GoodsMovementDocumentDEX JOIN 2VR_S4HARM_I_OutboundDelivery JOIN 2VR_S4HARM_I_Customer4MA_P2FINV_MaterialStock (reuse) + new 3VR for delivery enrichmentDelivery join pattern already defined in 3VR_P2FINV_BatchDel — reuse join logic. Customer country drives Export vs Domestic split. Possible ITAR — flag for DAE review before cross-region exposure.
3Bonded <-> Non-Bonded TransfersSTOs and material documents transferring stock between bonded and non-bonded SLOCs/Plants. Must show STO reference, sending/receiving plant+SLOC.2VR_S4HARM_GoodsMovementDocumentDEX4MA_P2FINV_MaterialStock (reuse)MvT 301/303/311/315/641 (STO). Both legs (issue+receive) present in MSEG. ReceivingPlant/StorageLocation/IssuingStorageLocation available on GoodsMovementDocumentDEX. No new source required.
4Manufacturing ConsumptionGI of bonded RM to Production Order (MvT 261). Shows Production Order number, component material, quantity consumed.2VR_S4HARM_GoodsMovementDocumentDEX4MA_P2FINV_MaterialStock (reuse)ProductionOrder field available on GoodsMovementDocumentDEX. No BOM traversal required (confirmed in tech review). Filter MvT 261 + bonded SLOC/Plant.
5Production FG Receipt - BondedGR of finished goods to bonded SLOC from Production Order (MvT 101 against order). Batch-level.2VR_S4HARM_GoodsMovementDocumentDEX4MA_P2FINV_MaterialStock (reuse)MvT 101 with OrderID populated. Batch available. Distinguish from PO receipt (Req 1) by OrderID vs PurchaseOrder population.
6Vendor ReturnsReturn deliveries to vendor (MvT 122) from bonded stock.2VR_S4HARM_GoodsMovementDocumentDEX4MA_P2FINV_MaterialStock (reuse)MvT 122. PurchaseOrder/PurchaseOrderItem reference available. Bonded SLOC/Plant filter.
7Duty-Triggering MovementsMovements associated with customs clearance requests' specific MvTs TBD with Saravanan/GTS team. Count of materials requested for clearance.2VR_S4HARM_GoodsMovementDocumentDEX4MA_P2FINV_MaterialStock (reuse)MvT list to be confirmed (GTS/CMS specific). May require Z-table for clearance reference if not on MSEG. If GTS integration exists, assess /SAPSLL/ table availability in DSP
8Batch-Level TraceabilityBatch identification on all movements above. No recursive chain traversal — flat filter on MATNR/WERKS/CHARG.2VR_S4HARM_GoodsMovementDocumentDEX JOIN 2VD_S4HARM_I_Batch?2VD_S4HARM_I_Batch to be created (already planned for ERP-410) -> reuse. No TF required in contrast with ERP-410 recursive BOM requirements. Batch filter is user selection, not chain expansion.
9ScrapScrapping of bonded stock where applicable (MvT 551).2VR_S4HARM_GoodsMovementDocumentDEX4MA_P2FINV_MaterialStock (reuse)MvT 551. Scope TBC 'where applicable' per functional requirements. Bonded SLOC/Plant filter.

Global Batch Track & Trace

The following table is a mapping of ERP-410's requirements, the Analytical Model used and then a mapping to the legacy code Internal Table(s) used

Req NoRequirementDescriptionInternal TableSource TablesAnalytical ModelNotes
0Batch Chain - Primary ReportThe main report results screen showing the full resolved batch genealogy chain for the selected material/plant/batch and directionGT_WORKLISTCHVW / MCH1 / MARA / MAKT / T001W4MA_P2FINV_BatchTraceEntry point for all branching. Driven by TF_WPP_BatchTrace recursive traversal of CHVW. All 8 branch requirements filter against this result set
1Material MovementsReports all material movements for all materials/batches on the report resultsGT_MSEGMSEG / MKPF4MA_P2FINC_MaterialStockFiltered by MATNR/WERKS/CHARG from batch chain. Movement types 101/102/531/532. MENGE calculated via SHKZG +/-
2StocksReports all current stock of all materials/batches on the report resultsGT_MCHBDerived from MSEG via GoodsMovementDocumentDEX aggregation4MA_P2FINC_MaterialStockNo separate MCHB extraction required - derived from GT_MSEG aggregated by MATNR/WERKS/CHARG per P2F DDFS pattern
3NCNReports all NCN quality notifications for all the materials/batches on the report resultsGT_NCNNew Z-table - pending CL_IT_NCN analysis4MA_P2FINV_QualityComplianceBlocked pending CL_IT_NCN analysis. Join on MATNR/WERKS/CHARG from batch chain assumed.
4SpecsShows all entries in the multi spec table for all materials/batches on the report resultsGT_SPECSUnknown - pending parent class ZWPP_MDE_HCE analysis4MA_P2FINV_QualityComplianceBlocked pending ZWPP_MDE_HCE. Shares AM with NCN and FG_CHARS assumed.
5Finished Goods CharacteristicsReports characteristic values for all materials/batches on the report resultsGT_CHARAUSP / CABN / CAWN via 3VR_CharcValue (already exists in DSP)4MA_P2FINV_QualityCompliance3VR_CharcValue already built - join to batch chain on ObjectInternalID = MATNR. Filter to relevant class type
6PCDReports PCD document numbers for all materials/batches on the report resultsGT_PCDMAST / STAS / STPO / DRAT4MA_P2FINV_PCDDocumentsJoin on MATNR/WERKS only - no CHARG. PCD is at material level not batch level. DOKAR = KPR AND DKTXT LIKE PCD%
7DeliveriesReports all outbound deliveries for all selected materials/batches including the first specification on the sales orderGT_DELLIKP / LIPS / KNA1 (via ZWPP_GET_MDE_DEL RFC)4MA_P2FINV_DeliveriesTwo-hop join: MSEG VBELN_IM to delivery then validated against batch chain. Includes first spec from VGBEL/VGPOS - spec logic in parent class ZWPP_MDE_HCE
8Delivery SpecsReports all outbound deliveries for all selected materials/batches and all specifications on the sales orderGT_DEL_SPECLIKP / LIPS / KNA1 plus all spec entries via create_spec_table4MA_P2FINV_DeliverySpecsDerived from GT_DEL via create_spec_table - returns full spec table per delivery item not just first entry. Spec logic blocked pending ZWPP_MDE_HCE availability

Physical Inventory

Physical inventory adjustments are processed in SAP as material documents with movement types 701/702 (inventory difference posting). These postings are captured in MSEG and will flow through the standard I_GoodsMovementDocument CDS view. No separate extraction path is required; physical inventory adjustments are included in the GoodsMovementDocumentDEX flow and will be unioned with the period opening balance to produce the closing balance.





Effort Estimate and Object Count


S/4 Custom CDS

1 - Medium

1 * 5

1 Custom CDS View Z_I_BatchWhereUsedLevel on CHVW for single-level batch where-used extraction into DSP inbound layer. ERP-410

S/4 Custom CDS

1 - Medium

1 * 5

1 Custom CDS View Z_I_NCN for NCN Z-table extraction. Effort unknown - blocked pending CL_IT_NCN class analysis.ERP-410

S/4 Custom CDS (VDM)

1` - Medium

1 * 5

Custom CDS view for PCD documents. Join of legacy tables MAST/STPO/DRAT. New cds view will join I_MaterialBOMLink (MAST),I_BillOfMaterialItem (STPO & STAS), I_DocumentInfoRecord (DRAT) ERP-410

S/4 CDS

1 - Small

1 * 10

Custom extractor and wrapper for i_maintenanceplanbasic ERP-1098




Extract cds views, all require wrappers.

I_ClfnCharcDesc

I_ClfnObjectCharcValue

I_ClfnInternalIdObjectMapping

I_ClfnClass

I_ClfnCharcDesc

I_ClfnClassCharcBasic      ERP - 1422

Source System Extractors


`

Extractor NameDescription

Build Jira Ref For Extension Information

Z_I_TranspRoot         (XE_TransRoot)



Z_I_TranspChargesRoot  (XE_TransChRoot)



Z_I_TranspChargesItem  (XE_TransChitem)



Z_I_TranspChargesItemElement  (XE_TransChItemE)



Z_I_TranspExecData     (XE_TransExec)



Z_I_TranspRootNode     (XE_TransRootN)



Z_I_TranspRootNode     (XE_TransRootN)



Z_I_BatchWhereUsedLevel (XE_BatchWUL)

Single-level CHVW extraction. One row per parent-child batch pair. No recursion here — handled in 3VR_P2FINV_TF_BatchTrace.


Z_I_NCN (XE_NCN)

NCN Z-table extraction. BLOCKED — source table and fields TBD. Pending CL_IT_NCN analysis.


Plqaceholder (XE_Specs)

BLOCKED — Pending analysis for class ZWPP_MDE_HCE.





VDM

Z_I_WPP_PCDDocuments - WPP - PCD Document Links by Material/Plant

GAP: Report is cross instance, which means ROW and China data must be combined/. Cross plant BOMs? 

JiraRequirementDescription
ERP-410

PCD - Reports PCD document numbers for all materials/batches on the report results.

Custom CDS view for PCD documents. Join of legacy tables MAST/STPO/DRAT.

New cds view will join I_MaterialBOMLink (MAST),I_BillOfMaterialItem (STPO & STAS), I_DocumentInfoRecord (DRAT)

This requirement cannot be delivered by DSP as it is potential ITAR restricted data., will be presented in SAC.

Sample Code: 

@AbapCatalog.sqlViewName: 'ZWPP_VPCD'
@AbapCatalog.compiler.compareFilter: true --  push WHERE clause filter conditions down to the database level
@AbapCatalog.preserveKey: true -- compiler to keep the key definition exactly as specified. Should this be false?
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'WPP - PCD Document Links by Material/Plant'

@Analytics.dataCategory: #DIMENSION -- Master Data, no measures.
@Analytics.dataExtraction.enabled: true
@OData.publish: true -- oData service needed to publish to SAC

@ObjectModel.usageType: {
serviceQuality: #C, --  Customer/partner developed — stability not guaranteed by SAP
sizeCategory:   #M, -- Medium — thousands to low millions of rows
dataClass:      #MASTER_DATA -- Slow changing reference data
}

define view Z_I_WPP_PCDDocuments
as select from I_MaterialBOMLink          as m     -- replaces MAST
  inner join   I_BillOfMaterialItem       as bi   -- replaces STPO + STAS
      on  m.BillOfMaterial          = bi.BillOfMaterial
      and m.BillOfMaterialVariant   = bi.BillOfMaterialVariant
  inner join   I_DocumentInfoRecord       as d     -- replaces DRAT
      on  bi.DocumentType           = d.DocumentType
      and bi.DocumentNumber         = d.DocumentNumber
      and bi.DocumentVersion        = d.DocumentVersion
      and bi.DocumentPart           = d.DocumentPart



Inbound Layer

Extension of the cds views SCTMS_D required to include the expected extensions mentioned in ERP-1792 'Manual updated charges vs Freight Agreement calculated amount'

TMS KPI to source mapping

Jira

KPI

Source Views (Harmonisation Layer 2VR_*)



2VR_TransRoot

2VR_TransChRoot

2VR_TransChitem

2VR_TransChItemE

2VR_TransExec

2VR_TransRootN

2VR_Outbound

2VR_CustSettlmt

2VR_GL_Acc_Line




Z_I_TranspRoot

/SCMTMS/D_TORROT

Z_I_TranspChargesRoot

/SCMTMS/D_TCHRGR

Z_I_TranspChargesItem

/SCMTMS/D_TCHRGI

Z_I_TranspChargesItemElement

/SCMTMS/D_TCHRGE

Z_I_TranspExecData

/SCMTMS/D_TOREXE

Z_I_TranspRootNode

/SCMTMS/D_SF_ROT

I_OutboundDelivery

(LIKP/LIPS)

C_CustSettlmtDEX

(WBRK/WBRP)

I_GLAccountLineItemRAW

(ACDOCA)

Notes

ERP-1795

Freight Unit Compliance Score








FUs with planning status at time of PGI. Delivery goods movement date as base.

ERP-1795

FSD Timing Compliance Score







FSD CREATED_ON vs ActualDeparture (PlannedDeparture as fallback).

ERP-1795

Freight Agreement Usage Score






FAGRMNTID044 presence on charge items; MANUALLY_CHANGED on charge elements.

ERP-1795

Overall Compliance Score



Weighted average of the three scores above.

ERP-1792

Manual Charges vs FA Calculated






CALC_AMOUNT vs AMOUNT where MANUALLY_CHANGED = X on charge elements.

ERP-1792

3rd Party Charges Overview






Charges assigned to 3rd party; filtered by charge type on element.

ERP-1792

Freight Agreement Utilisation






All freight orders linked to a freight agreement including costs.

ERP-1792

Freight Charge Breakdown






Breakdown by charge type, carrier, posting/doc status, timeline.

ERP-1782

Confirmed Pick-up vs Actual








Earliest pick-up event vs confirmed pick-up date on freight order.

ERP-1782

Confirmed ETA vs Actual Arrival








Earliest arrival event vs confirmed ETA on freight order.

ERP-1782

Proof of Delivery Rate








POD event reported (PROCESSING_STATUS = Confirmed) as % of total FOs.

ERP-1782

Event Reporting Rate








Critical event compliance per defined rules; split Outbound / Inbound.

ERP-2359

Freight Cost to Cost Account/Material Account








Amount posted to material/expense/P&L G/L accounts after settlement.

ERP-2359

Cost Allocation Breakdown







Breakdown by CompanyCode, PurchOrg, Plant, Material, SalesOrder/PO, G/L.



Source View / Extractor

Key Relationships

Freight Order /SCMTMS/D_TORROT  (XE_TransRoot = Z_I_TranspRoot)

DB_KEY = TOR_ID

Freight Order /SCMTMS/D_TORITE


NEW

Charges Root /SCMTMS/D_TCHRGR   (XE_TransChRoot = Z_I_TranspChargesRoot)

DB_KEY = HOST_KEY (DB_KEY freight order)

Charges Item /SCMTMS/D_TCHRGI   (XE_TransChitem = Z_I_TranspChargesItem)

DB_KEY = PARENT_KEY (DB_KEY charges root)

Charges Elem /SCMTMS/D_TCHRGE   (XE_TransChItemE = Z_I_TranspChargesItemElement)

DB_KEY = ROOT_KEY (charges root) or PARENT_KEY (charges item)

Execution Events /SCMTMS/D_TOREXE  (XE_TransExec = Z_I_TranspExecData)

Linked via TORITMUID to freight order item

Freight Settl. Doc /SCMTMS/D_SF_ROT  (XE_TransRootN = Z_I_TranspRootNode)

SFIR_ID; linked to freight order via REF_KEY

Customer Settlement (XE_CustSettlmt = C_CustSettlmtDEX)

WBRP/WBRK; joined to GL via CompanyCode + FiscalYear + ReferenceDocument


1TL_S4Hx_I_BatchWhereUsedLevel

Purpose

Initial + delta load of single-level CHVW batch where-used records via Z_I_BatchWhereUsedLevel.

Filled by

1TF_S4Hx_I_BatchWhereUsedLevel


1TF_S4Hx_I_BatchWhereUsedLevel

Source

Z_I_BatchWhereUsedLevel (XE_BatchWUL)

Purpose

Transformation flow loading Z_I_BatchWhereUsedLevel into 1TL_S4Hx_I_BatchWhereUsedLevel. No transformations.


1TL_S4Hx_Specs

BLOCKED — source CDS view, tables and fields TBD. Pending ZWPP_MDE_HCE analysis.

Harmonisation Layer

2TL_S2HARM_GoodsMovementDocumentDEX

Purpose:

2TF_S4HARM_I_GoodsMovementDocumentDEX

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.

2VR_S2HARM_GoodsMovementDocumentDEX

Projection:

Projection Details

Exclude Column: MaterialDocumentKey1

Exclude Column: MaterialDocumentKey2

Exclude Column: MaterialDocumentKey3

Exclude Column: MaterialDocumentKey4

Exclude Column: MaterialDocumentKey5

Exclude Column: MaterialDocumentKey6

2TL_S4HARM_C_TranspOrdItemAnlytsSDEX

Source: 1TL_S4Hx_I_GOODSMOVEMENTDOCUMENTDEX

Purpose:

2TF_S4HARM_C_TranspOrdItemAnlytsSDEX

Source: 1TL_S4HR_C_TranspOrdItemAnlytsSDEX

2VR_S4HARM_C_TranspOrdItemAnlytsSDEX

Filter:

(TransportationOrder <> '' OR TransportationOrder IS NOT NULL) 


Formula:

FieldFormula
TransportationOrderItemUUIDBINTOHEX(TransportationOrderItemUUID)
TransportationOrderUUIDBINTOHEX(TransportationOrderUUID)
TranspOrdItemParentItemUUIDBINTOHEX(TranspOrdItemParentItemUUID)
SourceStopUUID:BINTOHEX(SourceStopUUID)
DestinationStopUUIDBINTOHEX(DestinationStopUUID)
CarrierUUIDBINTOHEX(CarrierUUID)
ShipperUUIDBINTOHEX(ShipperUUID
ConsigneeUUIDBINTOHEX(ConsigneeUUID)
TranspOrdNetDurationto_double(TranspOrdNetDuration)
TranspOrdItemShipperUUI

BINTOHEX(TranspOrdItemShipperUUID)

ProductUUIDBINTOHEX(ProductUUID)
NetDurationInHoursto_decimal((to_integer("TranspOrdNetDuration" / 10000)) + (to_integer((MOD("TranspOrdNetDuration", 10000)) / 100) / 60 ),5,2)


2TF_S4HARM_I_TranspOrdStageAnalytics

Source: 1TL_S4Hx_I_TRANSPORDSTAGEANALYTICS

2TL_S4HARM_I_TranspOrdStageAnalytics

Purpose:


2VR_S4HARM_I_TranspOrdStageAnalytics

Filter:

 TranspOrdStageDestStopCategory = 'L'


Projection: Exclude ALL, except: 


Projection Details

Include Column: TransportationOrderUUID

Include Column: TranspOrdStageDistance

Include Column: TranspOrdStageDistanceUnit

Include Column: TranspOrdStageNetDuration


Formula:

FieldFormula
TransportationOrderStageUUIDBINTOHEX(TransportationOrderStageUUID)
TransportationOrderUUIDBINTOHEX(TransportationOrderUUID)
TranspOrdStageSrceStopUUIDBINTOHEX(TranspOrdStageSrceStopUUID)
TranspOrdStageDestStopUUIDBINTOHEX(TranspOrdStageDestStopUUID)
CarrierUUIDBINTOHEX(CarrierUUID)
NumberOfStages1


Aggregation

FieldAggregation
NumberOfStagesSUM
TranspOrdStageDistanceSUM
TranspOrdStageNetDurationSUM


2TL_S4HARM_I_TranspChargesRoot  (2TL_TransChRoot)

Purpose:


2TF_S4HARM_I_TranspChargesRoot

Source: 1TL_S4Hx_I_TranspChargesRoot  (1TL_TransChRoot)


2VR_S4HARM_I_TranspChargesRoot  (2VR_TransChRoot)

Filter:

CALC_STATUS <> ''


Formula:

Field

Formula

HOST_KEY

BINTOHEX(HOST_KEY)

HOST_BO_KEY

BINTOHEX(HOST_BO_KEY)

HOST_NODE_KEY

BINTOHEX(HOST_NODE_KEY)


2TL_S4HARM_I_TranspChargesItem  (2TL_TransChitem)

Purpose:


2TF_S4HARM_I_TranspChargesItem

Source: 1TL_S4Hx_I_TranspChargesItem  (1TL_TransChitem)


2VR_S4HARM_I_TranspChargesItem  (2VR_TransChitem)

Filter:

HOST_KEY IS NOT NULL


Formula:

Field

Formula

HOST_KEY

BINTOHEX(HOST_KEY)

HOST_BO_KEY

BINTOHEX(HOST_BO_KEY)

HOST_NODE_KEY

BINTOHEX(HOST_NODE_KEY)

HOST_ROOT_KEY

BINTOHEX(HOST_ROOT_KEY)

PARENT_KEY

BINTOHEX(PARENT_KEY)

PARENT_ITEM_KEY

BINTOHEX(PARENT_ITEM_KEY)

EXECUTING_DOC_KEY

BINTOHEX(EXECUTING_DOC_KEY)

DESTLOC_UUID

BINTOHEX(DESTLOC_UUID)

SOURCELOC_UUID

BINTOHEX(SOURCELOC_UUID)

CONTEXT_KEY

BINTOHEX(CONTEXT_KEY)

ORIG_OP_UUID

BINTOHEX(ORIG_OP_UUID)

PARTY_UUID

BINTOHEX(PARTY_UUID)

REF_KEY

BINTOHEX(REF_KEY)

REF_ROOT_KEY

BINTOHEX(REF_ROOT_KEY)

UUID020

BINTOHEX(UUID020)

UUID057

BINTOHEX(UUID057)


2TL_S4HARM_I_TranspChargesItemElement  (2TL_TransChItemE)

Purpose:


2TF_S4HARM_I_TranspChargesItemElement

Source: 1TL_S4Hx_I_TranspChargesItemElement  (1TL_TransChItemE)


2VR_S4HARM_I_TranspChargesItemElement  (2VR_TransChItemE)

Filter:

ROOT_KEY IS NOT NULL AND INVOICING <> ''


Formula:

Field

Formula

ROOT_KEY

BINTOHEX(ROOT_KEY)

PARENT_KEY

BINTOHEX(PARENT_KEY)

PARENT_TCE

BINTOHEX(PARENT_TCE)

DESTLOC_UUID

BINTOHEX(DESTLOC_UUID)

SOURCELOC_UUID

BINTOHEX(SOURCELOC_UUID)

DIST_ELEM_KEY

BINTOHEX(DIST_ELEM_KEY)

REF_ELEM_KEY

BINTOHEX(REF_ELEM_KEY)

RATE_RECORD_KEY

BINTOHEX(RATE_RECORD_KEY)

CALCBASELINE_KEY

BINTOHEX(CALCBASELINE_KEY)

UUID026

BINTOHEX(UUID026)

SPLIT_PARENT_KEY

BINTOHEX(SPLIT_PARENT_KEY)

TARGET_ITEM_KEY

BINTOHEX(TARGET_ITEM_KEY)

SRV_NODE

BINTOHEX(SRV_NODE)

UUID_INDEX_RATE

BINTOHEX(UUID_INDEX_RATE)


2TL_S4HARM_I_TranspExecData  (2TL_TransExec)

Purpose:


2TF_S4HARM_I_TranspExecData

Source: 1TL_S4Hx_I_TranspExecData  (1TL_TransExec)


2VR_S4HARM_I_TranspExecData  (2VR_TransExec)

Filter:

EVENT_REVOKED <> 'X' AND EVENT_STATUS <> ''


Formula:

Field

Formula

TORITMUID

BINTOHEX(TORITMUID)

TORSTOPUUID

BINTOHEX(TORSTOPUUID)

TORSTSUID

BINTOHEX(TORSTSUID)

PARENT_KEY

BINTOHEX(PARENT_KEY)

EXT_LOC_UUID

BINTOHEX(EXT_LOC_UUID)

ORIG_EXEC_KEY

BINTOHEX(ORIG_EXEC_KEY)

ORIG_NODE_KEY

BINTOHEX(ORIG_NODE_KEY)

REF_EXEC_KEY

BINTOHEX(REF_EXEC_KEY)

ACTUAL_DATE

to_date(to_varchar(ACTUAL_DATE, 'YYYYMMDD'), 'YYYY-MM-DD')

2TL_S4HARM_I_TranspRootNode  (2TL_TransRootN)

Purpose:


2TF_S4HARM_I_TranspRootNode

Source: 1TL_S4Hx_I_TranspRootNode  (1TL_TransRootN)


2VR_S4HARM_I_TranspRootNode  (2VR_TransRootN)

Filter:

SFIR_TYPE <> '' AND LIFECYCLE <> 'X'


Formula:

Field

Formula

TSP_UUID

BINTOHEX(TSP_UUID)

REF_BO_KEY

BINTOHEX(REF_BO_KEY)

REF_KEY

BINTOHEX(REF_KEY)

BILL_FROM_PARTY

BINTOHEX(BILL_FROM_PARTY)

PAYEE_ID

BINTOHEX(PAYEE_ID)

CARRIER_INVOICE_KEY

BINTOHEX(CARRIER_INVOICE_KEY)

CREATED_ON

to_date(to_varchar(CREATED_ON, 'YYYYMMDD'), 'YYYY-MM-DD')

CREATION_DATE_EXT

to_date(to_varchar(CREATION_DATE_EXT, 'YYYYMMDD'), 'YYYY-MM-DD')

2TL_S4HARM_C_CustSettlmtDEX  (2TL_CustSettlmt)

Purpose:


2TF_S4HARM_C_CustSettlmtDEX

Source: 1TL_S4Hx_C_CustSettlmtDEX  (1TL_CustSettlmt)


2VR_S4HARM_C_CustSettlmtDEX  (2VR_CustSettlmt)

Filter:

CustSettlmt IS NOT NULL


Projection:

Projection Details

Include Column: CustSettlmt

Include Column: CustSettlmtItem

Include Column: CompanyCode

Include Column: SettlementFiscalYear

Include Column: ControllingArea

Include Column: CostCenter

Include Column: BusinessArea

Include Column: PurchasingOrganization

Include Column: Plant

Include Column: Material

Include Column: CndnContrType

Include Column: ActualSettlmtDate

Include Column: CreationDate

Include Column: CreatedByUser


Batch Track and Trace

2TF_S4HARM_I_BatchWhereUsedLevel

Source

1TL_S4Hx_I_BatchWhereUsedLevel

Projection:

Project Details

Add as Key: Material

Add as Key: Plant

Add as Key: Batch

Add as Key: ParentMaterial

Add as Key: ParentPlant

Add as Key: ParentBatch


2TL_S4HARM_I_BatchWhereUsedLevel

Purpose

Load of single-level CHVW batch where-used records.

Filled by

2TF_S4HARM_I_BatchWhereUsedLevel


2VR_S4HARM_I_BatchWhereUsedLevel

Source

2TL_S4HARM_I_BatchWhereUsedLevel

Filter:

Batch IS NOT NULL AND ParentBatch IS NOT NULL

Projection:

Projection Details

Include Column: Material

Include Column: Plant

Include Column: Batch

Include Column: ParentMaterial

Include Column: ParentPlant

Include Column: ParentBatch

2TL_S4HARM_I_NCN

BLOCKED — pending CL_IT_NCN analysis. Source Z-table and fields TBD.


2VR_S4HARM_I_NCN

Source

2TL_S4HARM_I_NCN

BLOCKED — pending CL_IT_NCN analysis. Filter, formula and projection TBD.

Propagation Layer

3VR_P2FINC_MaterialStock

Source: 2VR_S2HARM_GoodsMovementDocumentDEX & 2VR_S4HARM_I_GLAccountLineItemRAW

Filters:

FlowFilter Values
2VR_S4HARM_I_GLAccountLineItemRAW

"ReferenceDocumentType" = 'PRCHG' AND
"ControllingBusTransacType" = '' AND
"SourceLedger" = '0L' AND
"Product" != ''

2VR_S4HARM_I_GoodsMovementDocumentDEXMaterial" != '' AND
"InventoryStockType" != ''


Projection:

Union:

Accept default union mappings


3VF_P2FINV_MaterialStock

Source: 3VR_P2FINC_MaterialStock

Calculation:

NameDescriptionData TypeExpressionNotes
RecordTypeUsed for Non-Cumulative Key Figures to track inventory balance over time.Integercase 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.

3VR_P2FTMS_TransportationOrderSql  (3VR_TranOrdSql)

Source: 2VR_S4HARM_C_TranspOrdItemAnlytsDEX (2VR_TrItemDex)


Purpose:


3VR_P2FTMS_TransportationOrder  (3VR_TranOrd)

Source: 3VR_P2FTMS_TransportationOrderSql (3VR_TranOrdSql) left join 2VR_S4HARM_C_TranspOrdStageAnalytics (2VR_TrStg)


Join Condition:

TransportationOrderSql.TransportationOrderUUID = TrStg.TransportationOrderUUID


Filter:

TransportationOrder <> '' AND TranspOrdLifeCycleStatus NOT IN ('X', 'Z')


Projection – include:

Projection Details

Include Column: TransportationOrder

Include Column: TransportationOrderUUID

Include Column: TransportationOrderType

Include Column: TransportationMode

Include Column: CarrierUUID

Include Column: ShipperUUID

Include Column: ConsigneeUUID

Include Column: FreightAgreement

Include Column: PlannedDepartureDateTime

Include Column: ActualDepartureDateTime

Include Column: PlannedArrivalDateTime

Include Column: ActualArrivalDateTime

Include Column: TranspOrdLifeCycleStatus

Include Column: TranspOrdPlanningStatus

Include Column: ShippingCondition

Include Column: TransportationOrderItemUUID

Include Column: Product / ShipFromParty / ShipToParty

Include Column: NetDurationInHours (stage)

Include Column: NumberOfStages (stage)

Include Column: TranspOrdStageDistance / DistanceUnit (stage)

Include Charge fields: FAGRMNTID044, HOST_KEY, CALC_AMOUNT, AMOUNT, INVOICED_AMT, ANALYTICRELEV, CCOD, MANUALLY_CHANGED (from charges SQL join)

Include Execution fields: EVENT_CODE, ACTUAL_DATE, DISCREPANCY, DISCR_TYPE, PROCESSING_STATUS (from exec join)



3VF_P2FTMS_TransportationOrder  (3VF_TranOrd)

Source: 3VR_P2FTMS_TransportationOrder  (3VR_TranOrd)


3VR_P2FTMS_FrtCstAlloc  (3VR_FrtCstAlloc)

Source: 2VR_S4HARM_I_TranspRootNode (2VR_TransRootN)  JOIN  2VR_S4HARM_C_CustSettlmtDEX (2VR_CustSettlmt)  JOIN  2VR_S4HARM_I_GLAccountLineItemRAW (2VR_GL_Acc_Line_Itm)


Join Condition (ERP-2359 specification):

G.CompanyCode = S.CompanyCode AND G.FiscalYear = S.SettlementFiscalYear AND G.ReferenceDocument = S.CustSettlmt AND G.ReferenceDocumentItem = S.CustSettlmtItem AND G.ReferenceDocumentContext = 'WB' AND N.REF_KEY = S.SettlmtRefDoc (link FSD to Settlement Doc)


Filter:

ReferenceDocumentContext = 'WB' AND S.CustSettlmt IS NOT NULL AND N.LIFECYCLE <> 'X'


Projection – from Customer Settlement (2VR_CustSettlmt):

Projection Details

CustSettlmt, CustSettlmtItem

CompanyCode, SettlementFiscalYear

PurchasingOrganization, Plant, Material

CndnContrType, ActualSettlmtDate


Projection – from GL Account Line Item (2VR_GL_Acc_Line_Itm):

Projection Details

GLAccount, DebitCreditCode

AmountInCompanyCodeCurrency, CompanyCodeCurrency

AmountInTransactionCurrency, TransactionCurrency

CostCenter, ControllingArea, ProfitCenter, BusinessArea

SalesOrder / PurchaseOrder


Projection – from TranspRootNode (2VR_TransRootN):

Projection Details

SFIR_ID (FSD document number)

CREATED_ON (FSD creation timestamp)

TSP_ID, PURCH_COMPANY_CODE, PURCH_ORG_ID

LIFECYCLE, BLOCK, BLOCK_REASON


3VF_P2FTMS_FrtCstAlloc  (3VF_FrtCstAlloc)

Source: 3VR_P2FTMS_FrtCstAlloc  (3VR_FrtCstAlloc)



Batch Track & Trace

3VR_P2FINV_TF_BatchChain

Purpose

SQLScript Table Function.

Called dynamically at runtime by SAC — not persisted.

Recursive CHVW traversal for a single batch input.

DSP equivalent of ZWPP_HCE->GET_BATCHES WHILE loop.

Reads 2VR_S4HARM_I_BatchWhereUsedLevel on demand.

Output feeds both 3VR_P2FINV_BatchTrace and 3VR_P2FINV_QC — shared join anchor for both branches.

Source

2VR_S4HARM_I_BatchWhereUsedLevel — read at runtime, not pre-loaded

Note

2TL_S4HARM_I_BatchWhereUsedLevel runs on schedule independently. The TF reads its output on demand. No persistence between them.


Input Parameters:

Parameter

Type

Description

IV_Material

NVARCHAR(18)

Starting material

IV_Plant

NVARCHAR(4)

Starting plant

IV_Batch

NVARCHAR(10)

Starting batch

IV_DIRECTION

NVARCHAR(1)

B = Bottom Up / T = Top Down


Output Table:

Column

Type

Description

Material

NVARCHAR(18)

Child material

Plant

NVARCHAR(4)

Child plant

Batch

NVARCHAR(10)

Child batch

ParentMaterial

NVARCHAR(18)

Parent material

ParentPlant

NVARCHAR(4)

Parent plant

ParentBatch

NVARCHAR(10)

Parent batch

Level

INTEGER

Depth in chain — 0 = seed batch


Note:

Direction B: joins on Material/Plant/Batch to find ParentMaterial/ParentPlant/ParentBatch.

Direction T: reverses. Already-processed batches excluded via NOT EXISTS. Loops until no new batches returned.

3VR_P2FINV_BatchTrace

Purpose

Primary result set for the batch traceability report. Enriches TF output with master data and classification. Filter anchor for all branch AMs.

Source

3VR_P2FINV_TF_BatchChain


Joins:

Join

Type

On

Source

Purpose

Batch master

LEFT JOIN

Material = Material AND Batch = Batch

2VD_S4HARM_I_Batch (to be created)

Add ExternalBatch

Material master

LEFT JOIN

Material = Material

2VD_S4HARM_Material

Add MaterialDescription / BaseUnit

Plant master

LEFT JOIN

Plant = Plant

2VD_S4HARM_Plant

Add PlantName

Classification

LEFT JOIN

Material = ObjectInternalID

3VR_P2FINV_CharcValue

Add characteristic values. Filter to relevant class type.


3VF_P2FINV_BatchTrace

Purpose

Formula only — makes the view a fact. No joins.

Source

3VR_P2FINV_BatchTrace


Formula:

Field

Formula

Description

ChainDirection

CASE WHEN Level = 0 THEN 'Seed' WHEN ParentMaterial = Material THEN 'Same Material' ELSE 'Cross Material' END

Classifies each batch node

IsFinishedGood

CASE WHEN Level = 0 THEN 'X' ELSE '' END

Flags root batch


3VR_P2FINV_BatchDel

Purpose

Resolves outbound deliveries for batches in the chain.

Equivalent of GET_DEL in ZWPP_HCE.

Delivery numbers sourced from MSEG VBELN_IM, validated against batch chain.


Joins:

Join 1:

2VR_S2HARM_GoodsMovementDocumentDEX

INNER JOIN 2VR_S4HARM_I_OutboundDelivery

ON ReferenceSDDocument = OutboundDelivery

Filter on Join 1:

ReferenceSDDocument IS NOT NULL

AND PurchaseOrder IS NULL

AND Material / Plant / Batch IN (SAC batch chain filter context)


Join 2:

Result of Join 1 INNER JOIN 2VR_S4HARM_I_Customer ON SoldToParty = KUNNR


Projection — key fields from ty_del type definition:

Field

Source

OutboundDelivery / OutboundDeliveryItem

OutboundDelivery / OutboundDeliveryItem

ReferenceSDDocument / ReferenceSDDocumentItem / ReferenceSDDocumentCategory - TBD

OutboundDeliveryItem — preceding document reference

PurchaseOrder / PurchaseOrderItem

OutboundDeliveryItem — customer PO reference

SoldToParty / Country - TBD / CustomerName - TBD / CityName - TBD

Customer join

Material / Batch

OutboundDeliveryItem

Plant

OutboundDeliveryItem

ActualGoodsmovementDate

OutboundDelivery — actual goods issue date

ActualDeliveryQuantity / DeliveryQuantityUnit

OutboundDeliveryItem — quantity and unit

SalesGroup / SalesOffice

OutboundDelivery / OutboundDeliveryItem

3VF_P2FINV_BatchDel

Purpose

Final derivations on delivery data before AM exposure.

Source

3VR_P2FINV_BatchDel

3VR_P2FINV_BatchDelSpec

Purpose

All spec entries per delivery item. Contrast with 3VR_P2FINV_BatchDel which carries first spec only.

Source

3VR_P2FINV_BatchDel

BLOCKED — create_spec_table / init_specs / get_spec all in ZWPP_MDE_HCE. Source tables and join keys TBD.


3VF_P2FINV_BatchDelSpec

Source

3VR_P2FINV_BatchDelSpec

BLOCKED — dependent on 3VR_P2FINV_BatchDelSpec.


3VR_P2FINV_QC

Purpose

NCN records, specifications and FG characteristics for all batches in the chain.

Source

3VR_P2FINV_TF_BatchChain — shared with 3VR_P2FINV_BatchTrace


Joins:

Dataset

Join Type

Join Condition

Status

FG Characteristics

INNER JOIN

3VR_CharcValue ON ObjectInternalID = MATNR filtered to relevant class type

Available — 3VR_CharcValue already exists

NCN

INNER JOIN

2VR_S4HARM_I_NCN ON MATNR / WERKS / CHARG from SAC batch chain context

BLOCKED — pending CL_IT_NCN analysis

Specifications

INNER JOIN

TBD

BLOCKED — pending ZWPP_MDE_HCE analysis


3VF_P2FINV_QC

Purpose

Final derivations on quality and compliance data.

Source

3VR_P2FINV_QC

Partially BLOCKED — NCN and Specs TBD. Pending CL_IT_NCN and ZWPP_MDE_HCE analysis.


Reporting Layer

4MA_P2FINV_DowntimeFact

Supports:

Includes technical details for:

Calculated Measures (Post Aggregation Calculations / exception aggregation etc)

Report Field DescriptionSAP Table-Field Name / processComments / Calculation / Formula / Restriction dimensions and valuesAggregation of dataExample SAP field data
CurrentStockMatlStkChangeQtyInBaseUnit

Non-Cumulative

Record Type Field: RecordType

TimeDimension: PostingDate

Earliest Reporting Start Date: TBD

LatestReportingEndDate: TBD

Set Unbooked Values to 0: X

LAST1,000

CurrentStockValue

InventoryValuationAmtInCoCodeCrcy

Non-Cumulative – same parameters as CurrentStock

SUM



4MA_P2FTMS_TransportationOrder  (4MA_TranOrd)

Source: 3VF_P2FTMS_TransportationOrder  (3VF_TranOrd)


Calculated Measures:

Detailed calculated measure specifications for 4MA_P2FTMS_TransportationOrder are pending story design for ERP-1795, ERP-1792, and ERP-1782. 


xxxxxxxxxxxxxx – Freight KPI Report  (ERP-1795)



Intended KPI measures (draft – subject to model naming decision):

Measure

Logic / Source

FreightUnitComplianceScore

Ratio of Freight Units planned prior to PGI. Source: 2VR_S4HARM_I_OutboundDelivery + 2VR_S4HARM_I_TranspRoot. Hierarchy: Syensqo → Country → CompanyCode → Plant.

FSDTimingComplianceScore

Ratio of FSDs where CREATED_ON <= ActualDepartureDateTime (PlannedDeparture as fallback). Source: 2VR_S4HARM_I_TranspRootNode.

FreightAgreementUsageScore

Ratio of FSD items where FAGRMNTID044 IS NOT NULL. Manual updates counted: MANUALLY_CHANGED = 'X' on charges element. Excludes non-FA charge types (configurable list).

OverallComplianceScore

Weighted average of the three scores. Weighting factors TBD per project requirements.


xxxxxxxxxxxxx– Freight Cost Report  (ERP-1792)



Intended measures (draft):

Measure

Logic / Source

TotalChargeAmount

Sum of AMOUNT from Charges Element, restricted to INVOICING <> '' and ANALYTICRELEV = 'X'.

ManualChargeVariance

CALC_AMOUNT vs AMOUNT on elements where MANUALLY_CHANGED = 'X'. Supports ERP-1792 KPI: Manual Updated Charges vs FA Calculated Amount.

InvoicedAmount

INVOICED_AMT at Charges Root (total) and Element (detail) level.

WeightedAvgFreightRate

TotalChargeAmount / TotalWeight (CHRG_WEI_VAL). Post-aggregation in SAC.


[Not yet defined] – Carrier Performance Report  (ERP-1782)

The analytical model for the Carrier Performance Report has not yet been assigned a name in the data flow diagram. This section is reserved once the model name is confirmed.


Intended measures (draft):

Measure

Logic / Source

PickupOnTimeRate

Earliest actual pick-up event (EVENT_CODE = pick-up) vs PlannedDepartureDateTime +/- threshold. Source: 2VR_S4HARM_I_TranspExecData.

ETAOnTimeRate

Earliest arrival event vs PlannedArrivalDateTime +/- threshold. Uses confirmed ETA from Transportation Order extension field.

ProofOfDeliveryRate

Ratio of FOs with POD event reported (EVENT_CODE = POD, PROCESSING_STATUS = Confirmed).

EventReportingRate

Compliance per defined event rules (ERP-1782). Separate rate for Outbound / Inbound FOs.

Note: Event code mappings (pick-up, arrival, POD) must be configured as input parameters or a reference table in DSP, as they are client-specific customising values in /SCMTMS/D_TOREXE.


4MA_P2FTMS_FrtCstAlloc  (4MA_FrtCstAlloc)

Source: 3VF_P2FTMS_FrtCstAlloc  (3VF_FrtCstAlloc)


Calculated Measures:

Measure

Base Fields

Calculation / Logic

Aggregation

FreightCostToCostAccount

AmountInCompanyCodeCurrency

Sum of amounts where GLAccount is classified as an expense/cost account.

SUM

FreightCostToMaterialAccount

AmountInCompanyCodeCurrency

Sum of amounts where GLAccount is classified as a material/stock account.

SUM

CostVsMaterialSplit

FreightCostToCostAccount / TotalFreightCost

Ratio split between cost and material account postings. Expressed as %.

PERCENTAGE


Dimensions:


Out of Scope:

Breakdown by charge type or carrier – refer to Freight Cost Report (ERP-1792) for that analysis.



Batch Track and Trace


4MA_P2FINV_BatchTrace

Source

3VF_P2FINV_BatchTrace

Supports

ERP-410 Req 0 — Primary batch chain report. Entry point for all 7 branch AMs.


Input Parameters:

Parameter

Description

IV_Material

Material

IV_Plant

Plant

IV_Batch

Batch

IV_DIRECTION

B = Bottom Up / T = Top Down


Dimensions:

Material / Plant / Batch / Vendor Batch / Material Description / Plant Name / Parent Material / Parent Plant / Parent Batch / Chain Level / Chain Direction

Measures:

Batch count by level.


4MA_P2FINV_QC

Source

3VF_P2FINV_QC

Supports

ERP-410 Req 3 (NCN) / Req 4 (Specs) / Req 5 (FG Characteristics)


Dimensions:

Material / Plant / Batch / Class / Characteristic / Characteristic Value / NCN Number / NCN Status

Measures:

NCN Count (SUM)

Partially BLOCKED — NCN and Specs TBD. 

4MA_P2FINV_BatchDel

Source

3VF_P2FINV_BatchDel

Supports

ERP-410 Req 7 — Deliveries incl. first spec on sales order.


Dimensions:

OutboundDelivery / OutboundDeliveryItem / SoldToParty / Material / Plant / Batch / ReferenceSDDocument / ReferenceSDDocumentItem / ActualGoodsmovementDate / SalesGroup / SalesOffice / PurchaseOrder / PurchaseOrderItem / ActualDeliveryQuantity / DeliveryQuantityUnit

Measures:

Delivery Quantity (SUM)

BLOCKED — pending ZWPP_MDE_HCE analysis.


4MA_P2FINV_BatchDelSpec

Source

3VF_P2FINV_BatchDelSpec

Supports

ERP-410 Req 8 — All specs per delivery item.


Dimensions:

Delivery / Item / Customer / Material / Plant / Batch / Specification / Specification Value

Measures: TBD

BLOCKED — pending ZWPP_MDE_HCE analysis.


Restricted Measures

tbd

Currency Conversions

tbd

Variables





































Data access controls











Outbound Layer