Get information about what UI annotations to use hide fields from SAP Fiori UIs.
Generally, all fields that are exposed by the OData service are available to the client, regardless if the fields are exposed explicitly using UI annotations. To enable end-user personalization, the client may offer the possibility to add fields that are hidden by default, for example to a list report.
You can use this annotation if, for example, a CDS view contains technical keys, for example GUIDs, that have to be exposed to the OData service to work. These keys are usually not supposed to be displayed on the UI. You can also use this annotation if fields are required in calculations, but are not supposed to be displayed on a UI.
... define view ZExample_SalesOrdersByCustomer as select from ... as so { @UI.hidden key so.buyer_guid as BuyerGuid, ... @UI.dataPoint: { criticality: 'AmountCriticality', -- Reference to element trend: 'AmountTrend', -- Reference to element } so.actual_amount as ActualAmount, @UI.hidden so.criticality as AmountCriticality, @UI.hidden so.trend as AmountTrend }
Preventing fields from being available to a client is necessary for system parameters. These parameters are filled by the runtime engine, but must not be available to the client.
... define view OverdueSalesOrder with parameters @Consumption.hidden : true @Environment.systemField : #SYSTEM_DATE P_Date : sydate, as select from ... { ... }
For more information about consumption annotations, see section Consumption Annotations linked below.
... define view ZExample_SalesOrder as select from sepm_cds_sales_order as so association [0..1] to sepm_cds_business_partner as _BusinessPartner on $projection.buyer_guid = _BusinessPartner.business_partner_key { key so.sales_order_id as SalesOrder, @Consumption.hidden: true so.buyer_guid, ... _BusinessPartner }
There may be cases, where a field is needed in the client, for example for calculations, but should not be displayed directly in a list or table, or on an object-page floorplan. In this case the annotation @Consumption.hidden is not suitable.