Missing key fields in CDS views after migration is a three-part problem requiring systematic diagnosis across definition, mapping, and data dictionary layers.
1. CDS View Definition Review:
First, verify the CDS view syntax matches S/4HANA 2020 requirements. Check for deprecated annotations or syntax:
@AbapCatalog.sqlViewName: 'ZFIGL_ACTUAL'
@Analytics.dataCategory: #CUBE
define view Z_FI_GL_ACTUALS as select from acdoca
association [0..1] to cepc as _CostCenter
on $projection.CostCenter = _CostCenter.prctr
{
key rbukrs as CompanyCode,
key gjahr as FiscalYear,
key belnr as DocumentNumber,
prctr as CostCenter,
_CostCenter
}
Common definition issues post-migration:
- Association paths broken if target views renamed
- Missing KEY annotations cause fields to be non-selectable
- Currency/quantity field pairs incomplete (amount without currency)
- Client field handling differs in S/4HANA (MANDT often implicit)
Activate the view in Eclipse ADT and check for warnings. Sometimes views activate successfully but warnings indicate field mapping issues.
2. ETL Mapping Validation:
Your ETL process may have logical success but semantic failures. Validate field-level mapping:
Create validation SQL to compare source vs target:
SELECT COUNT(*) as missing_costcenter
FROM acdoca
WHERE gjahr = '2024'
AND prctr IS NULL
AND ( SELECT COUNT(*) FROM source_table
WHERE fiscal_year = '2024'
AND cost_center IS NOT NULL ) > 0
This identifies records where source had cost center data but target doesn’t. Key validation points:
- Field length truncation (source 15 chars, target 10 chars)
- Leading zeros stripped during conversion
- Data type conversion issues (CHAR to NUMC)
- Special characters causing load failures
- Case sensitivity changes
For financial dimensions specifically, check conversion exits. Cost centers might need conversion exit ALPHA (leading zeros). If ETL doesn’t apply conversion exits, fields appear empty in CDS views even though data exists in wrong format.
3. Data Dictionary Review:
Data dictionary mismatches are the most common cause. After migration, field definitions must align exactly:
Check field technical details:
- Transaction SE11 → Table ACDOCA → Field PRCTR
- Note data element: PRCTR (Profit Center)
- Check element: CE_PRCTR
- Domain: PRCTR
Now check your CDS view field:
- If CDS view uses different data element for same field, mapping breaks
- If domain definitions changed between source and target, values may not convert
Run this diagnostic query:
SELECT tabname, fieldname, rollname, domname
FROM dd03l
WHERE tabname = 'ACDOCA'
AND fieldname IN ('PRCTR', 'KOSTL', 'RACCT')
Compare results against your CDS view field definitions. Mismatches indicate why fields appear empty.
Complete Diagnostic Process:
Step 1 - Verify base table data:
SELECT COUNT(*), COUNT(prctr), COUNT(kostl)
FROM acdoca
WHERE gjahr = '2024'
If counts differ, data is incomplete in base table (ETL issue).
Step 2 - Test CDS view directly:
SELECT COUNT(*), COUNT(CostCenter), COUNT(ProfitCenter)
FROM Z_FI_GL_ACTUALS
WHERE FiscalYear = '2024'
If counts differ from base table, CDS view definition issue.
Step 3 - Check association integrity:
If CDS view uses associations, test them individually. Missing master data in dimension tables causes nulls in CDS output even when base table has values.
Common Fix Scenarios:
Scenario A - Missing KEY annotation:
Add @ObjectModel.foreignKey.association to properly expose association fields.
Scenario B - Conversion exit missing:
ETL must apply ALPHA conversion for fields like cost center:
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING input = source_value
IMPORTING output = target_value.
Scenario C - Data element mismatch:
Recreate CDS view using exact data elements from base table. Don’t rely on similar-looking elements.
Scenario D - Incomplete dimension data:
Load missing master data (cost centers, profit centers) before expecting CDS views to show complete results.
Prevention for Future Migrations:
- Create field-level validation reports before migration
- Document all data elements and domains used in CDS views
- Test CDS views in target system before data migration
- Implement automated data quality checks post-migration
- Maintain data element mapping documentation
For your specific case with financial dimensions, I suspect either conversion exit issues (leading zeros) or incomplete cost center master data migration. Run the diagnostic queries above to pinpoint the exact cause.