SAP Knowledge Base Article - Public

3463242 - Hidden fields are still shown in Data Preview of Custom CDS Views

Symptom

You're using the "Hidden" feature in Custom CDS Views app but then you preview your Custom CDS View, the field is still being shown. 

Environment

SAP S/4HANA Cloud

Reproducing the Issue

  1. Go to Custom CDS Views app
  2. In the edit mode of Custom CDS View, go to "Element Properties" tab 
  3. Select "Hidden" button and turn it to ON in the field that you want to hide 
  4. Save the draft or publish the view 
  5. Click on "Preview" 
  6. Field is shown

Cause

As Custom CDS Views are supposed to be used in other tools, the values shown in the Data Preview are the raw line item data, this is why when you hide a field and click on "Preview", the field will be shown.

Resolution

Hiding a field will make it invisible only in the final consumption runtime (e.g. in an an analytical query or in an odata service). Therefore, when you use the Custom CDS View in OData or Custom Analytical Queries, the output is correct and the field is hidden. 

If you want to remove the fields from the preview, you can delete them from the Custom CDS View. But you can only remove the fields that are not being used. 

See Also

For more details, check SAP Help Portal | Elements Properties - Hidden section.

Keywords

hide, hidden, fields, elements, query, view, custom cds views, element properties , KBA , BC-SRV-APS-GKE , Generic CDS Key User Editor , Problem

Product

SAP S/4HANA Cloud Public Edition all versions