Skip to Content

Annotation for Fiori Overview Page Filter

Hello Experts..

I am currently developing Overview page based on oData service (There is no CDS Views involved here. It is normal UI5 app on front end and oData service in Neweaver system in backend).

I have an Entity type with following metadata, which needs to be used as OVP Filter

<EntityType Name="Filter_Details" sap:content-version="1">
<Key>
<PropertyRef Name="IdV"/>
</Key>
<Property Name="IdV" Type="Edm.String" Nullable="false" MaxLength="10" sap:unicode="false" sap:label="IdV" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="DateRange" Type="Edm.DateTime" Precision="7" sap:unicode="false" sap:label="Date Range" sap:creatable="false" sap:updatable="false" sap:sortable="false"/>
<Property Name="EmpType" Type="Edm.String" Nullable="false" MaxLength="20" sap:unicode="false" sap:label="Employee Type" sap:creatable="false" sap:updatable="false" sap:sortable="false"/>
<Property Name="CountNum" Type="Edm.Double" Nullable="false" sap:unicode="false" sap:label="Count" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</EntityType> 

For this, I have added the follwing Annotation

<Annotations Target="EmpDetails.Filter_Details">
<Annotation Term="UI.SelectionFields">
<Collection>
<PropertyPath>DateRange</PropertyPath>
<PropertyPath>EmpType</PropertyPath>
</Collection>
</Annotation>
</Annotations>

This included two input valuehelp fields (named Date Range and Employee Type) in the filter screen. 

My questions are:
1. These filter fields are hidden by default. I have to expand the filter section, click Adapt Filters, Select both the filters and Save. How can I push this setting by default so that users can see both filter fields in header by default
2. Both the filter fields appear like a value help. If I click value help icon, it opens up the "Define Conditions" window, which is used to include/exclude values in the filter field. How can I get rid of this behaviour?
3. One of my filter field (EmpType - Employee Type) is supposed to be a dropdown, whcih should bring up the list of values from an entity set named EmpType_ListSet. Metadata definition of this entity set is as follows:


<EntitySet Name="EmpType_ListSet" EntityType="Empployee.EmpType_List" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:content-version="1"/>


What change should I make in the annotation file for this.
4. Though DateRange is of type Datetime type (as per metadata), it appears to be a valuehelp (as mentioned in point 2 above). How to make it datepicker field.


Would be great if someone can give me an answer for above queries w.r.to the code/metadata pasted above. Sorry to ask these questions in one stretch as I am stuck with this multiple issues where not getting the exact solution
Regards,
SAP Learner

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Nov 06, 2018 at 07:51 AM

    Hi,

    Please find answers to most of your questions in the below blog. There are multiple parts to it and you have to go through all the parts to get answers to your questions. Let me know if you still have any questions.

    https://blogs.sap.com/2017/03/02/annotating-and-extending-fiori-element-applications/

    Regards,

    Jay

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 08, 2018 at 05:57 AM

    Hi,

    This blog explains different configuration possible for a smart filter bar of an OVP application.

    Hope it helps :)

    Thanks and Regards

    Ashish

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 07, 2018 at 07:37 AM
    Hello Jay, 

    Thanks for the link. I was able to learnmany things using the link you have provided. Now, I am able to include date picker as well as drop down in OVP filter. However, I still have some issues. Please note that Gateway system is of version 7.4. Following is metadata file after making changes in oData service.

    <EntityType Name="Filter_Details" sap:content-version="1">
    <Key>
    <PropertyRef Name="IdV"/>
    </Key>
    <Property Name="IdV" Type="Edm.String" Nullable="false" MaxLength="10" sap:unicode="false" sap:label="IdV" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
    <Property Name="DateRange" Type="Edm.DateTime" Precision="7" sap:unicode="false" sap:label="Date Range" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:display-format="Date" sap:filter-restriction="interval" />
    <Property Name="EmpType" Type="Edm.String" Nullable="false" MaxLength="20" sap:unicode="false" sap:label="Employee Type" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:value-list="fixed-values"/>
    <Property Name="CountNum" Type="Edm.Double" Nullable="false" sap:unicode="false" sap:label="Count" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
    </EntityType>

    I am able to see DateRange field as datepicker to choose the date. Also, EmpType is dislayed as dropdown. However, EmpType drodown is not having any values to select.

    I want to load values from EMPType_ListSet entityset to EmType dropdown. For this, I have added the following tags in annotation file.

    <Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm" Target="EmpDetails.Filter_Details/EmpType"> 
    <Annotation Term="com.sap.vocabularies.Common.v1.ValueList"> 
    <Record> 
    <PropertyValue Property="CollectionPath" String="EMPType_ListSet"/> 
    <PropertyValue Property="Parameters"> 
    <Collection> 
    <Record Type="com.sap.vocabularies.Common.v1.ValueListParameterOut"> 
    <PropertyValue Property="LocalDataProperty" PropertyPath="EmpType"></PropertyValue> 
    <PropertyValue Property="ValueListProperty" String="EmpType"></PropertyValue> 
    </Record> 
    <Record Type="com.sap.vocabularies.Common.v1.ValueListParameterDisplayOnly"> 
    <PropertyValue Property="ValueListProperty" String="EmpType"></PropertyValue> 
    </Record> 
    </Collection> 
    </PropertyValue> 
    </Record> 
    </Annotation> 
    </Annotations> 

    Metadata for EMPType_ListSet entityset is as follows:

    <EntitySet Name="EMPType_ListSet" EntityType="EmpDetails.EMPType_List" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:content-version="1"/> 

    Metadata for EMPType_List entitytype is as follows:

    <EntityType Name="EMPType_List" sap:content-version="1">
    <Key>
    <PropertyRef Name="EmpType"/>
    </Key>
    <Property Name="EmpType" Type="Edm.String" Nullable="false" MaxLength="20" sap:unicode="false" sap:label="Emp Type" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
    </EntityType>

    What is wrong here. I suspect the texts in bold below (which can be referred from the details mentioned above) which I am not sure what value to be provided, so mentioned values as per my understanding w.r.to the metadata.

    http://docs.oasis-open.org/odata/ns/edm" Target="EmpDetails.Filter_Details/EmpType">

    .....

    <PropertyValue Property="CollectionPath" String="EMPType_ListSet"/>

    Also, the filter section is collapsed and search is not triggered by default. How to default the search triggering and expanded filter area during the initial load.

    Regards,

    SAP Learner

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 09, 2018 at 07:48 PM

    Hi Ashish,

    Thanks a lot for the blog link. You have detailed it really well there. It depicts many info and tricks about OVP in one place, which would surely help developers working on Fiori Elements..

    I have compared the data above with the details mentioned in the blog. However, I could not find any discrepancy in the annotation/metadata, which is stopping the dropdown to load values. Did you find any.. Can you please verify the details mentioned above and provide some suggestions

    Please note that In network tab, I don't see any traces of the entity set EMPType_ListSet being called. I am completely stuck here as I don't have an option to debug it.. Can you please throw some lights..

    Regards,

    SAP Learner

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 14, 2018 at 10:27 AM

    Hello,

    Can someone please help me here

    Regards,

    SAP Learner

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 20, 2018 at 04:11 AM

    Hello,

    Can some one please share some hints to solve this?

    Regards,

    SAP Learner

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 20, 2018 at 07:16 AM

    Hi,

    Can you check if you have generated the runtime artifacts after redefining the MPC_EXT class? If you have created your own CDS views then you need to retrieve them by creating search help annotations and generating runtime artifacts. Please check the below link for reference.

    https://blogs.sap.com/2016/04/27/how-to-build-drop-down-list-based-on-fixed-value-defined-in-a-domain/

    Regards,

    Jay

    Add comment
    10|10000 characters needed characters exceeded