I’m designing analytics for production planning and execution in S/4HANA 1909, and I’m torn between using pure ABAP CDS views versus HANA calculation views. The analytics need to cover production orders, capacity utilization, material consumption variances, and cost analysis across multiple plants.
The complexity comes from multiple data sources - production orders (AUFK/AFKO), confirmations (AFRU), goods movements (MSEG), cost elements (COEP), and master data. We need real-time dashboards for shop floor managers and detailed analytical reports for production controllers.
Here’s a simplified example of the join complexity:
-- Pseudocode - Key data integration requirements:
1. Join production orders (AUFK) with operation details (AFVC)
2. Link confirmations (AFRU) to calculate actual vs planned times
3. Connect goods movements (MSEG) for material consumption
4. Aggregate cost postings (COEP) by order and cost element
5. Apply complex calculations for variance analysis
-- Multiple currency conversions and unit transformations needed
I’ve heard CDS views integrate better with Fiori, but calculation views offer more flexibility for complex transformations. What are the real-world trade-offs? Has anyone built similar production analytics and can share insights on which approach worked better?
From a production planning perspective, real-time data is critical. Shop floor managers need to see current capacity utilization and order status without delays. CDS views give you that real-time access because they’re virtual - no data replication. HANA calc views can also be virtual, but if you need complex SQL script logic for variance calculations, you might introduce performance bottlenecks. Have you considered a hybrid approach? Use CDS views for standard metrics and calc views only for the really complex analytical calculations that CDS can’t handle efficiently?
I’ll offer a contrarian view - HANA calculation views are underrated for this scenario. Yes, they’re harder to transport and maintain, but for production analytics with variance calculations, currency conversions, and multi-level aggregations, they’re more powerful. You can use SQL script nodes for complex logic that would require multiple CDS view layers. The performance is often better because HANA optimizer can handle the entire calculation in one pass rather than materializing intermediate CDS view results. The Fiori integration argument isn’t as strong anymore - you can expose calc views through XS OData services fairly easily in 1909.
One major advantage of CDS views that often gets overlooked is the authorization concept. With CDS you use @AccessControl and DCL (Data Control Language) which integrates with standard S/4HANA authorization objects. For production data, you probably need plant-level and production supervisor-level access control. Implementing this in HANA calc views requires analytic privileges which are completely separate from ABAP authorizations and harder to maintain. If your security requirements are complex, CDS is the way to go.
I’ve implemented both approaches for production analytics. CDS views are definitely easier to maintain because they’re in ABAP and transportable through standard mechanisms. The Fiori integration is seamless - you define your CDS view with @Analytics annotations and it’s automatically available for consumption. However, for your multi-source scenario with complex calculations, you’ll end up with 8-10 layered CDS views which can impact performance.