cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Getting unexpected key 'ID ' in metadata after adding @DefaultAggregation: #SUM in my cds 

sanket2411_0-1780297779828.png

If I remove the @DefaultAggregation: #SUM annotation, the error disappears. However, our business requirements state that we must display the total at the end, so this annotation is necessary. Please let me know if there are any solutions for this issue."

below is my code:
@EndUserText.label: 'Order Cost Analytics'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@vdm.viewType: #CONSUMPTION
@ObjectModel.usageType: {
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@Metadata.allowExtensions: true
@analytics.dataCategory: #CUBE
@odata.publish: true
define view entity /HCLDC/C_ORDERCOSTREPORTAPP
as select from /HCLDC/I_ORDERCOSTREPORTAPPDET
{
@AnalyticsDetails.query.axis: #ROWS
key DocumentNumber,
@AnalyticsDetails.query.axis: #ROWS
@Former Member.lineItem: [{ position: 30 }]
key Object,
@AnalyticsDetails.query.axis: #ROWS
key MaintenanceNotification,
@AnalyticsDetails.query.axis: #ROWS
key ValueCategory,
@AnalyticsDetails.query.axis: #ROWS
key MaintenanceOrder,
@Former Member.lineItem: [{ position: 50 }]
@AnalyticsDetails.query.axis: #ROWS
key fiscalyear,
DocumentType,
DocumentVersion,
DocumentPart,
ControllingArea,
ObjectType,
MaintPriorityType,
MaintPriority,
MaintenanceProcessingPhase,
MaintObjectLocAcctAssgmtNmbr,
TopOrderNotification,
// @Former Member.lineItem: [{ position: 80 }]
ValueCategoryDesc,
// @Former Member.lineItem: [{ position: 90 }]
@AnalyticsDetails.query.axis: #ROWS
PlanningPlant,
@DefaultAggregation: #SUM
// @Semantics.amount.currencyCode: 'Currency'
@AnalyticsDetails.query.axis: #COLUMNS
ActualCost,
@DefaultAggregation: #SUM
// @Semantics.amount.currencyCode: 'Currency'
@AnalyticsDetails.query.axis: #COLUMNS
PlannedCost,
@DefaultAggregation: #SUM
// @Semantics.amount.currencyCode: 'Currency'
@AnalyticsDetails.query.axis: #COLUMNS
TasklistCost,
@DefaultAggregation: #SUM
@AnalyticsDetails.query.axis: #COLUMNS
ApprovalEstCost,
Equipment,
Assembly,
}

 

0 Likes

Accepted Solutions (0)

Answers (0)