You can request additional OData properties to be fetched with the table's data binding even if these properties are not displayed in the table.
This is useful when you need property values to be available at runtime, for example, for custom actions, conditional formatting, or calculations without exposing them as visible columns.
Additional properties for tables can be requested by using the com.sap.vocabularies.UI.v1.PresentationVariant annotation term and the RequestAtLeast property.
Including 1:n properties in the
RequestAtLeastproperty results in performance issues and prevents exporting tables to a spreadsheet.
XML Annotation
<Annotations xmlns=http://docs.oasis-open.org/odata/ns/edm Target="ZFAR_CUSTOMER_LINE_ITEMS2_SRV.Item"> <Annotation Term="com.sap.vocabularies.UI.v1.PresentationVariant"> <Record> <PropertyValue Property="Visualizations"> <Collection> <AnnotationPath>@UI.LineItem</AnnotationPath> </Collection> </PropertyValue> <PropertyValue Property="RequestAtLeast"> <Collection> <PropertyPath>Customer</PropertyPath> <PropertyPath>CompanyCode</PropertyPath> </Collection> </PropertyValue> </Record> </Annotation> </Annotations>
ABAP CDS Annotation
@UI.PresentationVariant: [ { requestAtLeast: [ 'CUSTOMER', 'COMPANYCODE' ], visualizations: [{type: #AS_LINEITEM }] } ] annotate view ITEM with { }
CAP CDS Annotation
annotate ZFAR_CUSTOMER_LINE_ITEMS2_SRV.Item @( com.sap.vocabularies.UI.v1.PresentationVariant : { Visualizations : [ '@UI.LineItem' ], RequestAtLeast : [ Customer, CompanyCode ] } );
If you cannot use the com.sap.vocabularies.UI.v1.PresentationVariant annotation, additional properties can also be requested using the additionalProperties parameter.
You can request direct and navigation properties but you cannot request 1:n navigation properties or use an absolute path to a singleton.
You can request additional properties using the additionalProperties parameter in the following ways:
- In the
Tablebuilding block - In the
manifest.jsonfile
In the following sample code, the Upvotes and Ratings direct properties and the _Downvotes/count navigation property are fetched in the table request of the Table building block even if the properties are not displayed as columns in the LineItem annotation:
Requesting Additional Properties in the
TableBuilding Block<macros:Table xmlns:macros="sap.fe.macros" id="ItemsTable" metaPath="items/@com.sap.vocabularies.UI.v1.LineItem" additionalProperties="Upvotes,Rating,_Downvotes/count" />
In the following sample code, the Upvotes direct property and _Downvotes/count navigation property are fetched in the table request of the controlConfiguration section of the manifest.json file:
manifest.json{ "sap.ui5": { "routing": { "targets": { "ObjectPage": { "options": { "settings": { "controlConfiguration": { "items/@com.sap.vocabularies.UI.v1.LineItem": { "tableSettings": { "additionalProperties": [ "Upvotes", "_Downvotes/count" ] } } } } } } } } } }
You can also request additional properties at the page level. For more information, see Requesting Additional Properties on the Object Page and Custom Page.