Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Can't use filter when accessing hana table through link from another table in sapui5

$
0
0

Hi all,

 

Have a strange one and I was wondering if someone had come across this before.

 

Hana table structure

 

      entity SalesOrder {

    key element name : String;

    element contact : Association[0..*] to Contact via backlink order;

 

 

entity Contact {

    ...

element location: Location;

    element order : Association to SalesOrder;

 

==

each sales order has a number of contacts.

 

In javascript, if I bind on list of contacts directly then I can use the filter

oRowRepeater.bindRows("/Contact",oRowTemplate,null,[new sap.ui.model.Filter("location",sap.ui.model.FilterOperator.EQ, "Germany")]);

 

and if I enter link i returns the number of entries

Contact/$count?$filter=location eq 'Germany'

 

But if I get contacts through the sales order it doesn't allow me to use the filter,

oRowRepeater.bindRows("/SalesOrder('mike')/Contact",oRowTemplate,null,[new sap.ui.model.Filter("location",sap.ui.model.FilterOperator.EQ, "Germany")]);

I can return the contacts same as accessing them directly and i can get the information such as

new sap.ui.commons.TextView({text: "{location}"}) same as before but only difference is that i can't filter.

 

When I try the following I get error

/SalesOrder('mike')/Contact/$count?$filter=location eq 'Germany'

 

Error

"message": {

            "lang": "en-US",

            "value": {

                "type": "ODataInputError",

                "message": "Bad Request URL: U"

            }

        }

 

When I open Chrome Developer Tools I see the following error

SalesOrder/contact/$count?$filter=location%20eq%20%27EMEA%27 400 (Bad Request)

Basically the $count doesn't work if you access contacts indirectly even though the link is there.

 

Is this a bug or am I doing something wrong?

Hana is sp8, I am up to date with almost everything.

 

Many thanks,

Matthew


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>