Based on the symptoms you’re describing, here’s a comprehensive optimization approach that addresses all three key areas:
CDS View Optimization Strategy:
First, restructure your view hierarchy to minimize layers. For project accounting, you should have: 1) Basic interface views on PRPS/COEP/BSEG, 2) Composite views for calculations, 3) A single consumption view. Each additional layer adds 15-25% overhead.
Delta Extraction Configuration:
This is likely your biggest issue. Add these annotations to your consumption view:
@Analytics.dataExtraction.enabled: true
@Analytics.dataExtraction.delta.byElement: {
lastChangedAt: 'LastChangedDateTime',
changeDataCapture: { automatic: true }
}
Ensure your underlying tables have timestamp fields. For COEP and BSEG, use CPUDT/CPUTM or AEDAT/AEZET. Without delta extraction, you’re doing full extracts every query - with 2.3M records, that’s your 45-60 second problem.
HANA Calculation View Consideration:
Don’t switch to HANA calc views yet. While they can handle complex multi-source scenarios better, they have downsides: harder maintenance, no automatic Fiori integration, and manual security implementation. However, if after optimization you still have issues, calc views excel at: complex currency conversions, multi-level aggregations, and scenarios requiring SQL script logic.
Immediate Actions:
- Add @Analytics.query: true to enable query-specific optimizations
- Use @ObjectModel.usageType.dataClass: #MIXED for transactional-analytical hybrid
- Push filters down using WHERE clauses in lower view layers
- For project accounting, always filter on BUKRS (company code) and GJAHR (fiscal year) as early as possible
- Use @EndUserText.quickInfo for calculated fields to help the optimizer
- Check association cardinality - use [0..1] or [1] instead of [0..*] where possible
Performance Validation:
After implementing delta extraction, run a test query. First execution will still be slow (initial load), but subsequent queries should drop to 3-8 seconds. Use transaction RSRT or HANA Studio SQL console to verify execution plans. Look for “COLUMN SEARCH” instead of “COLUMN TABLE” in the plan - that indicates proper index usage.
Long-term Monitoring:
Set up HANA view analysis using transaction SUSG or /IWFND/ERROR_LOG to track query performance over time. For project accounting with growing data volumes, plan for view optimization every 6-8 months as data patterns change.
The combination of proper delta extraction, view layer reduction, and early filtering should bring your query times down to under 10 seconds for most scenarios. If specific reports still lag, those are candidates for HANA calc views or even BW extraction for historical analysis.
This draft is based on general SAP S/4HANA knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.