We’ve successfully automated our project cost allocation process using custom CDS views integrated with a Fiori app. Previously, our finance team spent 3-4 days each month manually allocating costs across 200+ active projects, leading to delayed month-end closures.
Our solution leverages CDS view automation to calculate allocation percentages based on project resource utilization, Fiori app integration for approval workflows, and background job scheduling to run allocations automatically on the 25th of each month. The system now processes all allocations in under 2 hours with full audit trails.
I’ll share our technical implementation approach, the CDS view design patterns we used, and lessons learned from our 6-month production run. This might help teams facing similar manual allocation challenges in SAP S/4HANA 2020.
We built a custom Fiori Elements app using the List Report template connected to our consumption CDS view. The app shows pending allocations with drill-down capabilities to see calculation details. For approvals, we integrated with standard SAP workflow using Business Rule Framework plus (BRFplus) to route based on cost thresholds and project categories. Project managers approve allocations under 50K, while finance directors handle anything above. The authorization uses standard S_TABU_DIS for CDS views and custom authority objects for the approval actions.
How did you integrate this with the Fiori approval workflow? Did you use standard SAP Fiori apps or build custom tiles? Also curious about the authorization model you implemented since cost allocation typically requires multiple approval levels.
Let me provide the complete technical implementation details for anyone looking to build something similar.
CDS View Automation Architecture:
Our base CDS view (Z_PROJECT_RESOURCES) extracts resource assignments from PRPS and COEP tables with time-dependent validity. The calculation view (Z_COST_ALLOCATION_CALC) aggregates actual hours from CATS time sheets and computes allocation percentages using CASE statements for different project types. The consumption view (Z_ALLOCATION_FIORI) adds analytical annotations and exposes OData services.
Key design pattern: We used UNION operations to combine direct and indirect costs, with parameters for fiscal period and company code. This allows real-time recalculation without materialized views.
Fiori App Integration:
Built using SAPUI5 with Fiori Elements List Report template. The app connects via OData V2 service generated from our consumption CDS view. We implemented custom actions for approve/reject using function imports. The navigation properties link to project master data for drill-down analysis.
Critical success factor: We added value help annotations in CDS views for project selection, which automatically generated search helps in the Fiori UI without additional coding.
Background Job Scheduling:
Created ABAP report Z_RUN_COST_ALLOCATION that executes in three phases:
Data validation - checks for complete time sheet entries and project status
Allocation calculation - calls CDS views and writes to COEP staging table
Posting - uses BAPI_ACC_DOCUMENT_POST for actual CO postings
The job runs via SM36 with variant containing cut-off date and organizational scope. We set up event-driven triggering so month-end closing jobs automatically wait for allocation completion.
Error handling includes transaction rollback for any validation failures, detailed application logs (SLG1), and email alerts via SOST. We maintain an error table (Z_ALLOCATION_LOG) for audit trails.
Performance Optimization:
Initial runs took 6+ hours for 200 projects. We optimized by:
Adding secondary indexes on COEP for project and date ranges
Using table buffering for master data CDS views
Implementing parallel processing with CALL FUNCTION IN BACKGROUND TASK for project batches
Reducing commit frequency from per-project to per-batch (50 projects)
Now completes in under 2 hours with 95% CPU efficiency.
Lessons Learned:
Start with read-only CDS views and perfect the calculation logic before building write operations
Fiori app user training is crucial - we created video tutorials showing drill-down navigation
Background jobs need comprehensive monitoring - we integrated with Solution Manager for proactive alerts
Always maintain manual override capability for exceptions - about 5% of allocations still need finance team review
Measurable Benefits:
Month-end close reduced from 8 days to 4 days. Finance team reallocated 120 hours/month to analytical work. Allocation accuracy improved from 87% to 98% based on audit findings. ROI achieved in 7 months including development costs.
Happy to answer specific technical questions about any component of this solution.
This sounds like a solid approach. Could you share more details about your CDS view structure? Specifically, how did you handle the calculation logic for allocation percentages? We’re dealing with similar manual processes and considering whether to build custom CDS views or use standard allocation tools.