Skip to Content
0
Jan 25, 2021 at 06:43 PM

requiresContext is not an available property in the CDS syntax

100 Views

Hello All,

We have an OVP with a "Donut" chart which uses a local annotation file for intent based navigation. Right now, we are considering transferring the code of this local file into a metadata extension. So far, we have found that the @UI.chart has an 'action' property which takes the intent based navigation properties. But interestingly although in the local xml file we are able to set the 'requiresContext' property as 'true' (which works perfectly), in the metadata annotation, we are unable to use this specific property. In addition this property seems also available on the back end call, which we can't touch via metadata extension but with local file. It seems this property only released for Cloud applications, which can be understood. But there is also no page that explains which CDS annotation syntax is available in which version of a SAP system. The only way was to give it a try to see whether the system offers this particular property or not.


So I am asking two questions:

1. (still unsure) Is that possible to set this 'requiresContext' property inside of a metadata extension

2. Is there an official SAP page that shares the available CDS annotation properties by the version of a SAP system?

The local annotation file

		<Annotation Term="UI.Identification">
					<Collection>
						<Record Type="UI.DataFieldForIntentBasedNavigation">
							<PropertyValue Property="SemanticObject" String="ZMG_CP"/>
							<PropertyValue Property="Action" String="display"/>
							<PropertyValue Property="RequiresContext" Bool="true"/>
						</Record>
					</Collection>
				</Annotation>

The metadata extension

@Consumption.semanticObject: 'ZMG_CP'
@UI.chart: [{   title: 'Tickets',
                actions:[{ type: #FOR_INTENT_BASED_NAVIGATION, semanticObjectAction: 'display', invocationGrouping: #ISOLATED}], //THERE IS NO REQUIRESCONTEXT PROPERTY AVAILABLE
                chartType:#DONUT,
                dimensions: [ 'zmg_ticket_status' ],
                measures: [ 'zmg_ticket_count' ],
                dimensionAttributes: [{
                dimension: 'zmg_ticket_status',
                role: #CATEGORY
            }],
                measureAttributes: [{ measure: 'zmg_ticket_count',
                                      role: #AXIS_1,
                                      asDataPoint: false }]
            }]         
annotate view ZMG_TICKETCHART with

The call invoke with the metadata extension. The 'requiresContext' property is exist, but can't be reachable from the metadata extension.

Thanks in advance,

Best,

Merve

Attachments

ok.jpg (45.0 kB)