Skip to Content

Filter issue "Invalid parametertype used at function 'eq'" in oData

Hi All

I am passing filter value to read an entity set. I am testing in Web Ide and quite often the application stops and getting error "Invalid parametertype used at function 'eq' (Position: 7)" in gateway log.

But without any change and if i do (Empty cache and Hard reload) it works perfectly fine. Upon analyzing, found there is a missing ' ' for the value parameter

My filter parameter is Pernr and value 00003248

GET WorkCalendarCollection?$filter=Pernr%20eq%2000003248 HTTP/1.1 - Not working case (%20 gives space)

GET WorkCalendarCollection?$filter=Pernr%20eq%20%2700003248%27 HTTP/1.1 - Working case (%27 gives ' ' )

Code in JS: filt.push(new sap.ui.model.Filter("PERNR", "EQ", that.empID));

Tried other option:

var PERNR = new sap.ui.model.Filter({path: "PERNR", operator: sap.ui.model.FilterOperator.EQ, value1: that.empID });

filt.push(PERNR);

Found a similar thread but after implementing delay call also, same issue. Any inputs are really helpful. Thanks

https://answers.sap.com/questions/80933/new-sapui5-updat-to-142-has-odata-bug-invalid-para.html

Regrads

Vinoth

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Sep 16 at 05:08 AM

    In the "working case" the Pernr is quoted.

    If it has type NUMC in the backend, then even though it contains digits, it is (from OData point of view) of type Edm.String, so the client must provide a string value in the filter.

    Check the $metadata to verify that the property being filtered has type Edm.String, to verify that quotes are needed.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Evan

      Thanks for your reply.

      1. Yes Pernr is of type NUMC in backend and in gateway (in SEGW), its is of type Edm.String

      so the client must provide a string value in the filter. => Can you please explain this further. Attached screen where i am sending empID as string in filter

      My variable empID declaration is in "onInit" method like this.empID = null;

      Check the $metadata to verify that the property being filtered has type Edm.String, to verify that quotes are needed => Can you also please explain this.

      Strange thing is, it works sometimes and if it doesnt works, i need to do Emty cache and Hard reload. Really appreciate your inputs.

      Regards

      Vinoth

      filter.jpg (27.1 kB)
      gateway-error.jpg (377.3 kB)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.