on 2023 May 25 6:54 AM
Hi community,
I have built a list report & object page app based on OData V4 developed with RAP. UI5 version is 1.114.0. On the object page, a chart is defined with the annotations below.
<Annotations Target="SAP__self.Container/PurchaseOrderItem">
<Annotation Term="Aggregation.ApplySupported">
</Annotation><br>
<Annotations Target="SAP__self.PurchaseOrderType">
<Annotation Term="UI.Facets">
<Collection>
...
<Record Type="UI.ReferenceFacet">
<PropertyValue Property="Label" String="{@i18n>itemChart}"/>
<PropertyValue Property="Target" AnnotationPath="_Item/@UI.Chart#barchart"/>
</Record>
</Collection>
</Annotation>
</Annotations><br>
<Annotations Target="SAP__self.PurchaseOrderItemType">
<Annotation Term="UI.Chart" Qualifier="barchart">
<Record Type="UI.ChartDefinitionType">
<PropertyValue Property="ChartType" EnumMember="UI.ChartType/Bar"/>
<PropertyValue Property="Dimensions">
<Collection>
<PropertyPath>Material</PropertyPath>
<PropertyPath>DocumentCurrency</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="DimensionAttributes">
<Collection>
<Record Type="UI.ChartDimensionAttributeType">
<PropertyValue Property="Dimension" PropertyPath="DocumentCurrency"/>
<PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Category"/>
</Record>
<Record Type="UI.ChartDimensionAttributeType">
<PropertyValue Property="Dimension" PropertyPath="Material"/>
<PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Series"/>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="Measures">
<Collection>
<PropertyPath>GrossAmount</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="MeasureAttributes">
<Collection>
<Record Type="UI.ChartMeasureAttributeType">
<PropertyValue Property="Measure" PropertyPath="GrossAmount"/>
<PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations><br>
However, the chart is not rendered and an error "[50017] - Invalid data binding" is shown instead. The cosole does not show any errors that seem to be related to this issue.

It used to work with UI5 version 1.90.6, but now if I run it with the same version, it now shows the same error as above. In the console, there are the following errors that may be relevant to this issue.
sap.ui.mdc.Chart: Item Material has no property info representing it in the metadata. Make sure the name is correct and the metadata is defined correctly. Skipping the item!
Since the fields mentioned in the console exist in the datasource, it is unclear what this error means.

I saw a similar question here, where a solution was provided. But the soution was based on CAP project and I am not sure if it applies to ABAP CDS or XML annotations.
Regards,
Mio
Request clarification before answering.
I have added below local annotations and it worked.

<Annotations Target="SAP__self.PurchaseOrderItemType">
<Annotation Term="Aggregation.ApplySupported">
<Record Type="Aggregation.ApplySupportedType">
<PropertyValue Property="Transformations">
<Collection>
<String>aggregate</String>
<String>topcount</String>
<String>bottomcount</String>
<String>identity</String>
<String>concat</String>
<String>groupby</String>
<String>filter</String>
<String>expand</String>
<String>search</String>
</Collection>
</PropertyValue>
<PropertyValue Property="Rollup" EnumMember="Aggregation.RollupType/None"/>
<PropertyValue Property="GroupableProperties">
<Collection>
<PropertyPath>Material</PropertyPath>
<PropertyPath>DocumentCurrency</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="PropertyRestrictions" Bool="true"/>
<PropertyValue Property="AggregatableProperties">
<Collection>
<Record Type="Aggregation.AggregatablePropertyType">
<PropertyValue Property="Property" PropertyPath="GrossAmount"/>
<PropertyValue Property="RecommendedAggregationMethod" String="sum"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Analytics.AggregatedProperty" Qualifier="totalAmount">
<Record Type="Analytics.AggregatedPropertyType">
<PropertyValue Property="Name" String="totalAmount"/>
<PropertyValue Property="AggregationMethod" String="sum"/>
<PropertyValue Property="AggregatableProperty" PropertyPath="GrossAmount"/>
</Record>
</Annotation>
<Annotation Term="UI.Chart" Qualifier="barchart">
<Record Type="UI.ChartDefinitionType">
<PropertyValue Property="ChartType" EnumMember="UI.ChartType/Bar"/>
<PropertyValue Property="Title" String="合計金額"/>
<PropertyValue Property="Dimensions">
<Collection>
<PropertyPath>Material</PropertyPath>
<PropertyPath>DocumentCurrency</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="DynamicMeasures">
<Collection>
<AnnotationPath>@Analytics.AggregatedProperty#totalAmount</AnnotationPath>
</Collection>
</PropertyValue>
<PropertyValue Property="DimensionAttributes">
<Collection>
<Record Type="UI.ChartDimensionAttributeType">
<PropertyValue Property="Dimension" PropertyPath="Material"/>
<PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Series"/>
</Record>
<Record Type="UI.ChartDimensionAttributeType">
<PropertyValue Property="Dimension" PropertyPath="DocumentCurrency"/>
<PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Category"/>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="MeasureAttributes">
<Collection>
<Record Type="UI.ChartMeasureAttributeType">
<PropertyValue Property="DynamicMeasure" AnnotationPath="@Analytics.AggregatedProperty#totalAmount"/>
<PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I stumbled on same errorI have attached my annotations file, can you please help me in correcting the file please.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.