Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP CDS Smart table: annotation to display either key or value

jthuijls
Participant

Hi,

A field defined in a CDS as:

     @UI: {
          lineItem: {position: 30, label: 'Status' },
          selectionField: {position: 30 }
      }
      @EndUserText.label: 'Status'
      @ObjectModel.foreignKey.association: '_Status'
      @Consumption.valueHelp: '_Status'
      Header.status_id                                 as Status

Will display a search help in the filter bar, which is great. the line item displays both the description and the key in brackets.

Draft (E0001)

I would like to choose which one to display, the key or the description. I hardly ever want both. Lists and tables tend to become real large if they have a lot of statuses or business partners (with names and search helps) in it. Standard width is modelled after key field width, which means all fields constructed this way are too small in a grid table.

If I leave out `@ObjectModel.foreignKey.association: '_Status'`, I get only the key.

I've had minor success duplicating fields, and trying to hide one from the filters, and the other from the table personalisation.

How do I get only the description?

0 REPLIES 0