cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CAP CDS annotation for direct date picker

amallari
Explorer
0 Kudos
997

Hi Experts,

I created a standard report fiori list ung CAP CDS annotations. I have a filter bar with a filter for a date. At the moment, the user would need to click on the icon to show the value help dialog before the user is able to see the filter:


I wanted to have it directly on the filter bar instead so the user would no longer have to view the dialog.

Is there any way to achieve this via CAP CDS annotations?

Accepted Solutions (0)

Answers (1)

Answers (1)

sgourgouras
Explorer
0 Kudos

Hello @amallari,

In CAP, there is no annotation for Date fields like we do in ABAP CDS.

Please use annotation Capabilities on filter to display the DatePicker:

annotate YOUR_ENTITY with @Capabilities : {
    FilterRestrictions : {
        $Type              : 'Capabilities.FilterRestrictionsType',
        RequiredProperties : [ YOUR_PROPERTY ],
        FilterExpressionRestrictions : [
            {
                $Type : 'Capabilities.FilterExpressionRestrictionType',
                Property : YOUR_PROPERTY,
                AllowedExpressions : 'SingleRange' (please see documentation for other values)
            }
        ]
    }
};

Regards,
Sébastien