cancel
Showing results for 
Search instead for 
Did you mean: 

Semantic date range on smart filter bar

pierre_dominique2
Contributor
0 Kudos

Hi,

I'm trying to use the new semantic date range feature with SAP FE but I can't get it to work. I suppose the issue is that I'm using CAP with the odata v2 proxy and my Date is converted to DateTime?

schema.cds:

entity Requests : managed {
    approvalDate : Date;
}

metadata.xml:

<Property Name="approvalDate" Type="Edm.DateTime" sap:display-format="Date"/>

manifest.json:

"sap.ui.generic.app": {
        "_version": "1.3.0",
        "settings": {
            "flexibleColumnLayout": {
                "defaultTwoColumnLayoutType": "TwoColumnsBeginExpanded",
                "defaultThreeColumnLayoutType": "ThreeColumnsEndExpanded"
            },
            "forceGlobalRefresh": false,
            "objectPageHeaderType": "Dynamic",
            "showDraftToggle": false
        },
        "pages": {
            "ListReport|Requests": {
                "entitySet": "Requests",
                "component": {
                    "name": "sap.suite.ui.generic.template.ListReport",
                    "list": true,
                    "settings": {
                        "condensedTableLayout": true,
                        "smartVariantManagement": true,
                        "enableTableFilterInPageVariant": true
                    },
                    "filterSettings": {
                        "dateSettings": {
                            "useDateRange": true
                        }
                    }
                },
                "pages": {
                    "ObjectPage|Requests": {
                        "entitySet": "Requests",
                        "component": {
                            "name": "sap.suite.ui.generic.template.ObjectPage"
                        }
                    }
                }
            }
        }
    }

Cheers,

Pierre

Pierre_Godart
Explorer
0 Kudos

Hi Pierre!

Did you find the way to activate semantic date range?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

The Filter restriction for the property should be "interval" inorder for the property to be considered as a date range.

eg:

<Property Name="approvalDate" Type="Edm.DateTime" sap:display-format="Date" sap:filter-restriction="interval"/>
pierre_dominique2
Contributor

Hi Reshma,

Thanks but I don't know how to produce this annotation using CAP. I'll try to find a way to do it.

EDIT: I just found a way to do it ->

approvalDate @sap.filter.restriction: 'interval'

Cheers,

Pierre

0 Kudos

Hi,

Is there a possibility to default the filter value , for example to "Today" while using the semantic date range?

Thanks & Regards,

Madhumathi

Answers (4)

Answers (4)

former_member797472
Discoverer
0 Kudos

How can semantic date range filter be enabled on Analytical List Page floorplan? The SAPUI5 documentation does not provide a way to do this.

Regards.

Abhishek

0 Kudos

Hi Pierre,

Can you maybe share a screenshot of how the approvalDate filter looks like after the change?

Thanks,

Reshma

pierre_dominique2
Contributor
0 Kudos

I get the standard dialog with or without the configuration in the manifest:

0 Kudos

Hi Pierre,

Can you please modify your changes to the below code snippet ?

"sap.ui.generic.app": {
        "_version": "1.3.0",
        "settings": {
            "flexibleColumnLayout": {
                "defaultTwoColumnLayoutType": "TwoColumnsBeginExpanded",
                "defaultThreeColumnLayoutType": "ThreeColumnsEndExpanded"
            },
            "forceGlobalRefresh": false,
            "objectPageHeaderType": "Dynamic",
            "showDraftToggle": false
        },
        "pages": {
            "ListReport|Requests": {
                "entitySet": "Requests",
                "component": {
                    "name": "sap.suite.ui.generic.template.ListReport",
                    "list": true,
                    "settings": {
                        "condensedTableLayout": true,
                        "smartVariantManagement": true,
                        "enableTableFilterInPageVariant": true,
                        "filterSettings": {
                           "dateSettings": {
                              "useDateRange": true
                           }
                        }
                    }
                },
                "pages": {
                    "ObjectPage|Requests": {
                        "entitySet": "Requests",
                        "component": {
                            "name": "sap.suite.ui.generic.template.ObjectPage"
                        }
                    }
                }
            }
        }
    
pierre_dominique2
Contributor
0 Kudos

Hi,

I have already tried that, it doesn't change anything.

Cheers,

Pierre

vigneshss
Explorer
0 Kudos

Please add the "filterSettings" object under the "settings" object, and give a try.

pierre_dominique2
Contributor
0 Kudos

I just tried but it doesn't change anything. The documentation is not really clear on where to put this in the manifest.