cancel
Showing results for 
Search instead for 
Did you mean: 

Smartfilterbar no value help values for filters from HANA odata service

former_member182500
Contributor
0 Kudos

Hi,

I have a HANA backend system with an oData service defined,  with the entity type RecipeHeaderType shown below:



<EntityType Name="RecipeHeaderType" sap:semantics="aggregate">

<Key>

<PropertyRef Name="P_SAPClient"/>

<PropertyRef Name="P_KeyDate"/>

<PropertyRef Name="P_Calculation"/>

<PropertyRef Name="P_CalculationOwnerCode"/>

<PropertyRef Name="P_Worklist"/>

<PropertyRef Name="SAPClient"/>

<PropertyRef Name="RecipePrimaryOutput"/>

<PropertyRef Name="RecipeAlternativeNumber"/>

<PropertyRef Name="RecipeVersionNumber"/>

</Key>

<Property Name="P_SAPClient" Type="Edm.String" Nullable="false" MaxLength="3"/>

<Property Name="P_KeyDate" Type="Edm.String" Nullable="false" MaxLength="8"/>

<Property Name="P_Calculation" Type="Edm.String" Nullable="false" MaxLength="20"/>

<Property Name="P_CalculationOwnerCode" Type="Edm.String" Nullable="false" MaxLength="1"/>

<Property Name="P_Worklist" Type="Edm.String" Nullable="false" MaxLength="12"/>

<Property Name="SAPClient" Type="Edm.String" Nullable="false" MaxLength="3" sap:aggregation-role="dimension" sap:label="SAP Client"/>

<Property Name="RecipeInternalID" Type="Edm.Binary" sap:aggregation-role="dimension" sap:label="Recipe ID"/>

<Property Name="RecipePrimaryOutput" Type="Edm.String" Nullable="false" MaxLength="12" sap:aggregation-role="dimension" sap:label="Recipe Primary Output"/>

<Property Name="RecipeAlternativeNumber" Type="Edm.String" Nullable="false" MaxLength="3" sap:aggregation-role="dimension" sap:label="Recipe Alternative Number"/>

<Property Name="RecipeVersionNumber" Type="Edm.String" Nullable="false" MaxLength="3" sap:aggregation-role="dimension" sap:label="Recipe Version Number"/>

<Property Name="RecipeDescription" Type="Edm.String" MaxLength="132" sap:aggregation-role="dimension" sap:label="Recipe Description"/>

<Property Name="RecipeTypeCode" Type="Edm.String" MaxLength="20" sap:aggregation-role="dimension" sap:label="Recipe Type Code"/>

<Property Name="RecipeTypeDescription" Type="Edm.String" MaxLength="40" sap:aggregation-role="dimension" sap:label="Recipe Type"/>

<Property Name="RecipeCreatedByUser" Type="Edm.String" MaxLength="12" sap:aggregation-role="dimension" sap:label="Created By User ID"/>

<Property Name="RecipeCreatedByUserName" Type="Edm.String" MaxLength="80" sap:aggregation-role="dimension" sap:label="Created By"/>

<Property Name="RecipeCreateDateTime" Type="Edm.Decimal" Precision="15" Scale="0" sap:aggregation-role="dimension" sap:label="Created At"/>

<Property Name="RecipeChangedByUser" Type="Edm.String" MaxLength="12" sap:aggregation-role="dimension" sap:label="Changed By User ID"/>

<Property Name="RecipeChangedByUserName" Type="Edm.String" MaxLength="80" sap:aggregation-role="dimension" sap:label="Changed By"/>

<Property Name="RecipeChangeDateTime" Type="Edm.Decimal" Precision="15" Scale="0" sap:aggregation-role="dimension" sap:label="Changed At"/>

<Property Name="Status" Type="Edm.String" MaxLength="20" sap:aggregation-role="dimension" sap:label="Status Code"/>

<Property Name="StatusDescription" Type="Edm.String" MaxLength="60" sap:aggregation-role="dimension" sap:label="Status"/>

<Property Name="RecipeValidityStartDate" Type="Edm.String" MaxLength="8" sap:aggregation-role="dimension" sap:label="Valid From"/>

<Property Name="RecipeValidityEndDate" Type="Edm.String" MaxLength="8" sap:aggregation-role="dimension" sap:label="Valid To"/>

<Property Name="RecipeValidityMinQuantity" Type="Edm.Decimal" Precision="18" Scale="6" sap:aggregation-role="dimension" sap:label="Min. Quantity"/>

<Property Name="RecipeValidityMaxQuantity" Type="Edm.Decimal" Precision="18" Scale="6" sap:aggregation-role="dimension" sap:label="Max. Quantity"/>

<Property Name="RecipeValidityUnit" Type="Edm.String" MaxLength="3" sap:aggregation-role="dimension" sap:label="Validity Unit"/>

<Property Name="RecipePurposeCode" Type="Edm.String" MaxLength="5" sap:aggregation-role="dimension" sap:label="Recipe Purpose Code"/>

<Property Name="RecipePurposeDescription" Type="Edm.String" MaxLength="40" sap:aggregation-role="dimension" sap:label="Recipe Purpose"/>

<Property Name="Plant" Type="Edm.String" MaxLength="4" sap:aggregation-role="dimension" sap:label="Plant ID"/>

<Property Name="PlantName" Type="Edm.String" MaxLength="30" sap:aggregation-role="dimension" sap:label="Plant Name"/>

<Property Name="AuthorizationGroup" Type="Edm.String" MaxLength="10" sap:aggregation-role="dimension" sap:label="Authorization Group"/>

<Property Name="AuthorizationGroupDescription" Type="Edm.String" MaxLength="40" sap:aggregation-role="dimension" sap:label="Authorization Group"/>

<Property Name="RecipeIsTopLevel" Type="Edm.String" MaxLength="1" sap:aggregation-role="dimension" sap:label="Is Top Level"/>

<Property Name="Worklist" Type="Edm.String" MaxLength="12" sap:aggregation-role="dimension" sap:label="Worklist"/>

<Property Name="RecipeInternalID_E" Type="Edm.String" MaxLength="32" sap:aggregation-role="dimension" sap:label="Recipe Internal ID External"/>

</EntityType>

In my view controller, OnInit, I set the model:

     sURL = "/system/odata/Recipe.xsodata/";

    oModel = new sap.ui.model.odata.ODataModel(sURL, true);

    oModel.setCountSupported(false);

    oView.setModel(oModel);

In my view xml I set up the Smart Filter Bar, with custom config for filters for columns AuthorizationGroupDescription, RecipeTypeDescription, Plant and StatusDescription.  Note that the service metadata from HANA does not give me sap:filterable, so I have to add them in the control configuration.

<smartFilterBar:SmartFilterBar id="ra.SmartFilterBar"  entityType="RecipeHeaderType" search="onSearchButtonPressed" initialise="onInitDone" reset="onReset" persistencyKey="dfgfdg">

          <smartFilterBar:controlConfiguration>

            <smartFilterBar:ControlConfiguration key="AuthorizationGroupDescription" index="1" visible="true" controlType="dropDownList" mandatory="notMandatory" hasValueHelpDialog="true" groupId="_BASIC" >

    </smartFilterBar:ControlConfiguration>

            <smartFilterBar:ControlConfiguration key="RecipeTypeDescription" index="2" visible="true" controlType="dropDownList" mandatory="notMandatory" hasValueHelpDialog="false" groupId="_BASIC" >

    </smartFilterBar:ControlConfiguration>         

          <smartFilterBar:ControlConfiguration key="Plant" index="2" visible="true" controlType="dropDownList" mandatory="notMandatory" groupId="_BASIC" >

    </smartFilterBar:ControlConfiguration>

          <smartFilterBar:ControlConfiguration key="StatusDescription" index="2" visible="true" controlType="dropDownList" mandatory="notMandatory" groupId="_BASIC" >

    </smartFilterBar:ControlConfiguration>          

          </smartFilterBar:controlConfiguration>         

        </smartFilterBar:SmartFilterBar>

You can see from above I have set control type to dropwDownList.  Makes no difference whether I have hasValueHelpDialog true or false, I do not get any values in value help upon clicking the drop-down.

Wondering whether this is a limitation of the metadata provided by HANA?  When I click on the + icon to add more filter fields I can see all of the exposed columns from my HANA odata service, so proves the SmartFilterBar is bound to the service and can access the service metadata.

Grateful for any help/suggestions.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jon-Paul,

If you are using Native HANA XS Odata Services then it doesn't currently have Annotations, so making drop downlists etc with Smart Filter bar is tricky.

If you check out the metadata.xml used in  SAPUI5 Explored   [Check out the network traffic]

then you'll see they type of Annotation you need for a search list on Company Code:

<Annotations Target="com.sap.GL.zrha.LineItems/Bukrs" xmlns="http://docs.oasis-open.org/odata/ns/edm"> <Annotation Term="com.sap.vocabularies.Common.v1.ValueList"> <Record> <PropertyValue Property="Label" String="Company Codes" /> <PropertyValue Property="CollectionPath" String="VL_SH_H_T001" /> <PropertyValue Property="SearchSupported" Bool="true" /> <PropertyValue Property="Parameters"> <Collection> <Record Type="com.sap.vocabularies.Common.v1.ValueListParameterInOut"> <PropertyValue Property="LocalDataProperty" PropertyPath="Bukrs" /> <PropertyValue Property="ValueListProperty" String="BUKRS" /> </Record> <Record Type="com.sap.vocabularies.Common.v1.ValueListParameterDisplayOnly"> <PropertyValue Property="ValueListProperty" String="BUTXT" /> </Record> <Record Type="com.sap.vocabularies.Common.v1.ValueListParameterDisplayOnly"> <PropertyValue Property="ValueListProperty" String="ORT01" /> </Record> <Record Type="com.sap.vocabularies.Common.v1.ValueListParameterDisplayOnly"> <PropertyValue Property="ValueListProperty" String="WAERS" /> </Record> </Collection> </PropertyValue> </Record> </Annotation> </Annotations>

You will need to find a way of adding custom annotations to the HANA XS OData metadata

I'm sure it's possible with a bit of hacking 😉

If you have the option to use a Netweaver Gateway Odata servive then I believe you can configure these relations, so the necessary Annotations are automatically available.


Good luck.

Aron

former_member182500
Contributor
0 Kudos

Hi Aron,

Thanks for the reply!

The use of the Smart Filter Bar belongs to a pathfinder project where Im looking to serve the UI component of a Fiori-like app directly from XS.  Exploring possibility to innovate faster with newest controls and fixes by bootstrapping to latest stable UI5 version uploaded to custom HANA repository.

Also exploring any speed to market benefit by avoiding central gateway which hosts apps for several lines of business and incurs additional layers of change management overhead, additional deployment complexity, not in control of our specific line of business UI5 version and destiny etc.

I thought the issue would be the HANA service metadata as you suggest.  Wonder if there is any roadmap to service metadata parity between Gateway and HANA.  Would be interested in any comment from Former Member

any joy on SmartFilterBar value dialog help directly from a HANA XS service?  P.S. Thanks for 30 da...

Answers (3)

Answers (3)

former_member182500
Contributor
0 Kudos

With a little further investigation I would assert that the Smart Filter Bar is not really designed for use with HANA analytical apps, only really meant for transactional apps with the control bound to a NetWeaver Gateway service.

These would be my questions to SAP Former Member

 

Q. Is the Smart Filter Bar limited in functionality when bound to a HANA XS OData service?

Q. Is the Smart Filter Bar only really meant for use with a NetWeaver Gateway service?

Q. What functionality exists, or is on the roadmap, for amending the HANA XS OData metadata e.g. adding annotations, xsodata service exit for dynamic modification of metadata.  Documentation and example?

Q. Could it help developers for SAP to clearly indicate limitations of a UI5 control when bound to a HANA OData service?

Former Member
0 Kudos

Would definitely be useful to know answers to these.

I hope the 'Smart' SAPUI5 objects will have better Annotation support from HANA XS OData service in subsequent releases. In the meantime I have now managed to get it working by:

- creating a custom annotations XML

- use the mockdata server to read the XML into a temporary model

- copy the Annotations from the temporary model, to the main model (which uses the XS OData service).

It's not pretty but seems to work for both Smart Filter and Smart Table.

I’ve also noticed that sap.ui.model.odata.v2.ODataModel  supports adding a separate annotationsURI, but haven’t managed to get that working yet.

For analytical Apps I also like the idea of using ExactBrowser but haven’t seen it covered yet in either the Fiori design guidelines or by  Smart Business Cockpits. It also requires quite a bit of code to use so would benefit from being ‘Smart’ enabled before widespread use.

Former Member
0 Kudos

This message was moderated.

former_member182500
Contributor
0 Kudos

The app I'm working on is an analytical app with HANA backend, so no Netweaver Gateway service - service is HANA xsodata.

Came across the following in a SAP standard Fiori app, which looks to be adding annotations to a model.

sap.ui.comp.providers.ValueListProvider

sap.ui.comp.providers.ValueHelpProvider

sap.ui.comp.odata.MetadataAnalyser

Will have a play.  Would be useful for folks to have example of Smartfilterbar in application added to next SHINE content release, as I see requests for more complex and flexible search capability than can be offered by facet filters for example Former Member

Former Member
0 Kudos

This message was moderated.