Skip to Content

SAP FIORI OVP tutorial with CDS - DATAPOINT on CDS not working

Hi All,

I have followed the steps in the blog at the below link:

https://blogs.sap.com/2016/07/05/creating-a-fiori-ovp-application-with-cds-view-annotations-part-2/

Its working fine without datapoints.

But I am not able to setup the datapoint.

Below is how the annotations are used

@UI.lineItem:  { type: #AS_DATAPOINT, position: 30, qualifier:'ordOverView', label: 'Net Amount' }
@UI.dataPoint:{title: 'NetAmount', targetValueElement: 'net_amount',targetValue: 1000,
                criticalityCalculation:{ improvementDirection: #TARGET,                                        
                                         deviationRangeLowValue: 100,
                                         toleranceRangeLowValue: 40,
                                         toleranceRangeHighValue: 800,
                                         deviationRangeHighValue: 1200 } 
              }              
so.net_amount,

Getting the following error on the card.

Getting the following error in console.

Any help is appreciated.

Thanks,

Ashiq Ali Ratnani

snap1.jpg (14.0 kB)
snap2.jpg (132.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Jul 04, 2017 at 07:53 AM

    Fixed this by creating a local annotation file and referring to that for displaying the cards.

    Made the below change in the annotation file.

    Annotation file coming from CDS:

    <Record Type="UI.DataFieldForAnnotation">
    <PropertyValue Property="Label" String="Net Amount"/>
    <PropertyValue Property="Value" AnnotationPath="@UI.DataPoint#net_amount"/>
    </Record>

    Modified location annotation file:

    <Record Type="UI.DataFieldForAnnotation">
    <PropertyValue Property="Label" String="Net Amount"/>
    <PropertyValue Property="Target" AnnotationPath="@UI.DataPoint#net_amount"/>
    </Record><br>
    Add comment
    10|10000 characters needed characters exceeded

  • Jun 07, 2017 at 11:55 AM

    On the @UI.lineItem try removing "type: #AS_DATAPOINT". I would also remove "targetValueElement: 'net_amount',targetValue: 1000" on the @UI.dataPoint

    Regards,

    Jamie

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 12, 2017 at 09:42 PM

    On the DataFieldForAnnotation it showing that the property is value, but it should target. Did you add the targetValueElement back in, I think this would be causing the issue.

    Regards,

    Jamie

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 14, 2017 at 06:21 AM

    Still don't have a solution for this. Any other inputs or help?

    Add comment
    10|10000 characters needed characters exceeded