cancel
Showing results for 
Search instead for 
Did you mean: 

SAP List Report - Hide & Disable Columns using UI Annotations

SaiNithesh_Gajula
Active Participant
5,978

Hi Experts,

I am working on SAP Fiori Element List Report app with Grid Table that uses an OData v2 service. We have column personalization button on the table. Currently the line item fields mentioned in UI.Annotations renders the default view and rest of the fields moved to the personalization button. We have a requirements as below

  1. We need to hide one field from the column personalization but it should be available for the filters. We have tried UI.Hidden but it didn’t worked.
<Annotation Term="UI.LineItem">
  <Collection>
	<Record Type="UI.DataField">
		<PropertyValue Property="Value" Path="field1"/>
		<Annotation Term="UI.Hidden" Bool="true"/>
	</Record>
  </Collection>
</Annotation>

2. We have to make couple fields(columns) has mandatory to display in table all the time, so how we can restrict the user to unselect those fields from the column personalization.

Please someone suggest how to achieve this.

SAP UI5 version: 1.71.29

Please do let me know, if you need any more details.

Regards,

Sai Nithesh

Accepted Solutions (0)

Answers (5)

Answers (5)

Lydie
Product and Topic Expert
Product and Topic Expert

Hi,

If someone is still looking for the answer to that question, here it is :

you need to use the UI.Hidden term in a seperate annotation, not in the lineitem one, because otherwise it wants to add the field to the table...

So it would give something like that :

<Annotations Target="YourODataService.YourEntitySet/field1" 
<Annotation Term="UI.Hidden" Bool="true"/>
</Annotations>
catalinfeidi
Participant
0 Kudos

I confirm. This is the solution if you want to display/hide fields via XML Annotation.

arunbharathi
Advisor
Advisor

Hello,

For requirement 1 to not show certain fields on the smart table personalization dialog please check the settings 'ignoreFromPersonalisation' here: https://sapui5.hana.ondemand.com/1.71.46/#/api/sap.ui.comp.smarttable.SmartTable/controlProperties

And currently using SAP Visual Editor you can edit this property and add the field names in the requested format (CSV).

Thanks,

Arun

0 Kudos

He is asking about UI Annotations.

Dhanasupriya
Active Participant
0 Kudos

Hello

Can you check with UI.HiddenFilter.

Attila
Active Participant
0 Kudos

The UI.Hidden completely hides the field from the UI, including the Object Page etc. as well.

The second approach mentioned is for freestyle applications including a SmartTable, not Fiori Element list report combined with annotations.

I was able to combine both solutions to a programmatic approach in a controller extension for the OData v2 FE List Report:

sap.ui.controller("<appId>.ext.controller.ListReportExt", {

/**
* View initialization
*/
onInit: function () {
// Hide virtual fields
// With v4 FE this approach would work: https://answers.sap.com/questions/13412687/hide-fields-in-column-personalization-button-of-fi.html
let smartTable = this.getView().byId("listReport");
if (smartTable && smartTable.getMetadata().getName() === 'sap.ui.comp.smarttable.SmartTable') {
smartTable.setIgnoredFields("EquipmentVirtual,FunctionalLocationVirtual");
}
}
});
Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

I found this blog post, I am however not sure how much this still applies.

Options to disable Fiori Personalization | SAP Blogs