Skip to Content

How to remove fieldgroups in adapt filters in VDM CDS view


I want to control how many fieldsgroups should be seen in the adapt filter.

I tried following things, but in vein.

@UI.hidden: true


this work fine for the field that u don' want to expose to ui,

I tried @consumption.filter.hidden: true , this also doesn't worked like i want.

all the association that i am exposing all are part of adapt filter by default.

This default functionality i want to control and expose only required field for filtering.

How to achieve this in smart temple?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Oct 24, 2019 at 07:35 AM

    Hi Shivakumar . ,

    I've found the solution in my cds:

    In the cds of Interface :

    define view ZCDS_SHOPDESC_F2_LS as select distinct from ZCDS_SHOPDESC_F_LS
    association to ZCDS_ITMTYP_TX on $projection.item_type = ZCDS_ITMTYP_TX.item_type and ZCDS_ITMTYP_TX.langu = $session.system_language
    association to ZCDS_ITEMDATA_I as _itemdata on $projection.guid = _itemdata.guid
        @EndUserText.label: 'External ID'
         @ObjectModel.text.element: ['shop_descr']
         @Search.defaultSearchElement: true
        key external_id,
        @UI.hidden: true  
        @EndUserText.label: 'Shop Description'
        @Search.defaultSearchElement: true
        @Search.ranking: #HIGH
        @Semantics.text: true
        shop_descr as shop_descr,
        @UI.hidden: true
        @EndUserText.label: 'Status'
        @UI.hidden: true
        @EndUserText.label: 'Sap Code'
        @UI.hidden: true
        ZCDS_ITMTYP_TX.item_type_t as itm_typ_desc,
        //info country and region
         @EndUserText.label: 'Geo Area'
         @ObjectModel.text.association: '_geoarea'
         //@Search.defaultSearchElement: true
         @EndUserText.label: 'Country'
         @ObjectModel.text.association: '_country'
         //@Search.defaultSearchElement: true,
         @EndUserText.label: 'Region'
         @ObjectModel.text.association: '_region'
         //@Search.defaultSearchElement: true
        @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
        @Consumption.filter.hidden: true
        @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
        @Consumption.filter.hidden: true
        @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
        @Consumption.filter.hidden: true

    @Consumption.filter.hidden: true

    Over the association hide the field group , then over the sigle field hide the single filter.

    Sebastiano ;)

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 22, 2016 at 06:52 AM

    Hi Shiva,

    Please check if below solution helps.

    #1 - Remove the field group annotations for the field which you don't want to show up in the adapt filter list (this will push the field to default grouping, not to basic)

    #2 - You need to set the odata filterable property of field as false; as of now the cds annotations are not seting this property, so you can do this using ABAP in the define() of the MPC_EXT class. Below is sample code for it.

    model->get_entity_type( '<your entity name>' )->get_property( '<your desired property>' )->set_filterable( abap_false ).

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.