Skip navigation EPAM
Dark Mode
Light Mode

From Barrels to Biofuels: Modernizing Commodity Risk Reporting with SAP Commodity Management

Part 2: The SAP CM and ACM Advantage

From Barrels to Biofuels: Modernizing Commodity Risk Reporting with SAP Commodity Management

Part 2: The SAP CM and ACM Advantage

With the functional framework in place from Part 1, Part 2 dives into SAP CM’s “engine room:” the risk objects and Core Data Services (CDS) layer that record and expose real-time exposures across the value chain.  Each event — price change, contract, nomination, freight, goods movement or derivative — creates or updates a risk object in HANA memory, eliminating the need for batch ETL and ensuring OLTP-OLAP convergence for instant position and PnL reporting. 

Risk Objects and the CDS Layer 

In S/4HANA the risk objects live directly in HANA memory, updated as SD, MM, TM/TSW and FI/CO postings, and occur via manual actions and/or scheduled flagged system events. 

CDS views expose this data model.  Basic views map to SAP physical tables, composite views join multiple sources and consumption views feed Fiori or SAP Analytics Cloud (SAC).  Key examples: 

  • Position cubes (current, end of day, day over day)
  • Mark-to-market/profit and loss (MtM/PnL) cubes for strategy, location or product
  • Derivative exposure cubes for hedge testing

The focus points here are the required extensions and configurations beyond out-of-the-box features, to enable industry-native use as expected with market-leading physical and financial trading platforms. 

Risk Object Population 

Risk objects are created or updated when risk-relevant (config step) business documents like Purchase Orders (PO), Sales Orders (SOs), nominations, freight orders, goods movements or derivatives are posted.  The Exposure Engine evaluates quantity, price status and timing, then writes the result synchronously to HANA (no batch ETL).  This design aims to support snapshot and warehouse strategies while keeping operational data untouched. 

  • Snapshot reporting: Consider how this functionality enables data duplication and your strategy for data warehouse reporting if needed. 
  • Update Mode: The write is synchronous with the source transaction because S/4HANA merges OLTP and OLAP, so no batch replication is required. 

Data Contained in a risk object (natively, extensibility options exist). A risk object is a versioned snapshot with these typical elements: 

  • Reference keys back to the originating document (contract/order/nomination/material doc/derivative ID) 
  • Commodity, delivery location, transport path 
  • Scheduled, delivered and open quantities with unit of measure 
  • Price references, quotation rule, price type (futures/forward/basis), fixation status 
  • Exposure date range, valuation currency, maturity 
  • Counterparty and credit details 
  • Status flags for provisional/final, realized/unrealized, hedge designation 

Risk Object Extensibility 

Risk objects are designed for controlled extensibility: add fields in the HANA data model, populate them through BAdIs or custom logic and surface them via extended CDS views. 

Custom Fields and View extensions 

  • Add custom attributes to the risk object data model with the Custom Fields and Logic app or by enhancing the exposure management data source in SPRO. 
  • New fields are integrated into the underlying HANA table and can be exposed in CDS views after activation. 
  • Once a custom field exists, you can extend the standard CDS consumption or cube views (extend view … with …) to make the new data available to Fiori, SAC or third-party BI tools. 

Business Add-Ins (BAdIs) 

• SAP provides BAdIs like BADI_EXPOSURE_ADD_FIELDS (name may vary by release) that allow population or calculation of additional fields when a risk object is created or updated. 

Restrictions 

  • Core keys that determine the join path, such as contract reference, quantity and valuation date, cannot be altered. 

 Note that any extension should avoid breaking associations used by delivered CDS cubes to ensure compatibility with SAP updates.  

How CDS Layer Uses Risk Objects 

The Core Data Services (CDS) layer is the semantic bridge between risk objects and analytical consumption in S/4HANA.  It defines the process SAP follows in code. Risk objects, created when risk-relevant documents are posted, store all exposure attributes in HANA.  CDS views read these objects directly, without replication or staging. 

Access Pattern 

  • Basic views map one-to-one to the underlying risk object tables and expose quantities, price references, valuation dates and key document links.  Think raw data reporting, no business logic injection. 
  • Composite views join risk objects with related contract, logistics and FI/CO data for MtM, PnL, credit and other analytics across SAP modules (document types and objects). 
  • Consumption views add analytical annotations (@Analytics.dataCategory: #CUBE, @OData.publish: true) so the data can be queried by Fiori apps, SAC, external BI tools or interfaces. 

Examples 

  • Position cubes (current, end-of-day, day-over-day) aggregate open, fixed and realized exposures across SD/MM, TSW and Treasury. 
  • MtM and PnL cubes calculate valuation changes via pulling current market prices (fixed condition records and/or via CPE Formula reference) against risk object quantities. 
  • Derivative exposure cubes combine physical and Treasury (FTR Create transactions) financial risk objects. 

Basic Data Flow 

Risk-relevant transactions → risk object update → CDS basic/composite/consumption views → analytics front-end.  

Because S/4HANA merges OLTP and OLAP, any price fixing, delivery change or inventory adjustment is visible at basic level in CDS queries. Key nuances include what event triggers risk object updates, what data is passed and how to report across the value chain of possible activity types. 

Putting it All Together 

Purpose: Provides a single reporting spine across front, mid and back-office, as well as all enablement functions through each SAP module. 

  • Value chain flow and where exposure lives                 
    • Deal capture: CM creates the initial physical exposure for buy/sell deals with current price state (fixed or formula).  Group by strategy, location, price type as needed. 
    • Contract to order: Contract defaulting copies a subset of deal data into sales/purchase contracts and then into SO/PO via copy control.  Exposure remains open until pricing and quantity are “realized”. 
    • Scheduling and movement: TSW nominations and tickets represent to-be-delivered and delivered quantities by leg; TM adds freight charges and tariff types. 
      • Interbook and physical stock transfers (STO, purchase transfers) move exposure but do not settle it. 
      • Goods movement and inventory: Goods receipt/issue converts logistics exposure into stock exposure. 
        • Pricing may still be provisional. 
          • Inventory valuation follows WACOG/LIFO/FIFO/perpetual or snapshot and roll methods. 
  • Invoicing and settlement:  Provisional invoices post accruals; final invoice flips quantity from open to “realized” (note natively it is document driven, not keying off when the price is known/fixed and quantity actuals) for the priced component and closes the related exposure. 
    • GL assignments hit FI/CO with unrealized vs. realized PnL and B/S accounting (if maintaining both, else just realized). 
  • Quantity-status model (drives open vs. settled) 
    • Suggested canonical states in reporting, regardless of source module names. 
      • Planned quantity: Scheduled on nominations or orders but not yet ticketed.  Exposure = open. 
      • Delivered but unpriced: Ticketed/received, not price-fixed.  Logistics exposure moves to stock exposure.  Exposure = open, valuation provisional. 
      • Delivered and price-fixed (partial or full):  Exposure splits by “priced” (flagged as settlement price, known/fixed) vs. unpriced terms (still floating if formula-based).  Priced portion may still be unrealized until invoiced. 
      • Invoiced provisional: Cash-flow accrual posted.  Exposure remains open for any unpriced or unmatched components. 
      • Invoiced final: All price terms fixed, quantity actuals matched to invoice.  Exposure is settled/realized for that quantity and price component. 
  • Key rule:  When a final invoice is created on the sales or procurement side, the corresponding logistics exposure is removed and the exposure quantity is transferred to inventory “stock”, then closed on settlement.  This is the pivot that converts unrealized to realized PnL. 

 Key DCS Views and Queries to Know 

An inventory of applicable pre-packaged CDS views and queries to know.  Reference official SAP notes for the most recent information. 

  • CDS layer to read the model (consumption cubes and queries) 
  • Position (physical): C_CMMDTYPOSCURRENTDATEQRY, C_CMMDTYPOSENDOFDAYQRY, C_CMMDTYPOSDAYOVERDAYQRY 
  • MtM and PnL (logistics and derivatives):  I_CmmdtyMTMFinValuesCube, I_CmmdtyPNLFinValuesCube, C_CMMDTYMTMCURRENTDATEQRY, C_CMMDTYMTMENDOFDAYQRY, C_CMMDTYMTMDAYOVERDAYQRY 
  • Treasury captured financial deals General: I_DerivativeExpsrPosition, E_FinancialInstrCharacteristic, I_DrvtvPosInterfaceLayer, 2CZVFINDCUBE 
  • Operational queries and sources supporting the chain
    • Contracts: C_PurContrSourceNomination 
    • TSW nominations and ticketing: C_Oij06_MyNominations, C_TICKETHEADTP, C_TICKETITEMTP, C_TICKETADDITIONALQTYTP, C_TICKETADDITIONALPARAMTP 
    • Stock and pricing analysis: CMM_PRC_ANALYSIS, CMM_LREV (extend via BAdI for pricing analysis) 
  • Open vs. settled logic in reports (practical filters)
    • Open exposure filter: “quantity_status” in {planned, delivered_unpriced, priced_uninvoiced} or “invoice_status = provisional”. 
    • Settled exposure filter: “invoice_status = final” and “price_fixation_complete = true” for all formula terms. 
    • Partial settlements: report split by price component (flat, basis, differentials, tariffs) and by quantity matched vs. unmatched to invoice. CPE terms should map to reporting, so MtM and PnL move per term component. 
      •  Customizing and open items to resolve during design: 
        • Risk-relevant assignment: Configure which document types generate exposure and how risk profiles allocate exposure across time and legal entity enterprise org structure. 
        • MtM settings: Decide whether MtM should run at the deal, logistics and stock levels; set BAdIs for pricing analysis where needed. 
        • Roles and extensions: Confirm authorizations and any table/view extensions required (CM_VLOGP, CMM_MTM, VFIND, VFINR, plus current/EOD/DoD queries). 
        • Business functions in scope: FIN_TRM_COMM_RM for paper deals, LOG_CMM_OIL for TSW, LOG_CPE_SD_MM for inventory integration. 
        • Risk Distribution Profile (RDP) setup: Define how exposure quantities are allocated across time buckets, company codes and business segments. Assignment of RDP to risk-relevant contracts or materials so CDS cubes aggregate open vs. settled exposure accurately. 

What the Finished Reports Must Prove

  • Physical position agrees to operational reality at each node of the chain and shows which quantities are still open. 
  • Financial position shows unrealized vs. realized amounts by both price component and quantity status. 
  • Reconciliation from deal to settlement is reproducible via CDS queries without manual spreadsheets. 

Closing 

By designing clear inner-joins across SD, MM, TSW/TM, Treasury and FI/CO and by configuring risk-relevant document types with a well-defined RDP, trading organizations can capture every quantity and price change as it occurs.  Real-time risk objects and CDS cubes present a single, consistent view of open vs. settled exposure, eliminating manual reconciliations and improving the accuracy and timeliness of physical and financial position reporting in CM.

This supports the demands of integrated energy and agricultural portfolios, providing the foundation for real-time MtM, PnL and position intelligence. 

GET IN TOUCH

Hi! We’d love to hear from you.

Want to talk to us about your business needs?