[英]Error in calling Filter URL odata service sapui5
I have to pass two filter parameters to ODATA service.我必须将两个过滤器参数传递给 ODATA 服务。 I am trying it as follows:
我正在尝试如下:
new ODataModel("proxy/http/FIORI-DEV.abc.com:8000/sap/opu/odata/sap/Z_FI_PAY_D_SRV/PdetailSet?$filter=Laufi eq '"+spayid+"' and Laufd eq '"+spaydt+"'?$sap-client=100",
It is giving following error.它给出了以下错误。 GET http://localhost:63655/Payment1/proxy/http/FIORI-DEV.abc.com:8000/sap/opu/odata/sap/Z_FI_PAY_D_SRV/PdetailSet/$metadata?$filter=Laufi%20eq%20%27U2-28%27 400 (Bad Request) Log-dbg.js:456 2020-07-21 16:40:39.956774 [ODataMetadata] initial loading of metadata failed -
GET http://localhost:63655/Payment1/proxy/http/FIORI-DEV.abc.com:8000/sap/opu/odata/sap/Z_FI_PAY_D_SRV/PdetailSet/$metadata?$filter=Laufi%20eq%20%27U2 -28%27 400(错误请求)Log-dbg.js:456 2020-07-21 16:40:39.956774 [ODataMetadata] 元数据初始加载失败 -
Can anyone suggest correct way to add filter parameters on ODATA service.谁能建议在 ODATA 服务上添加过滤器参数的正确方法。 Thanks.
谢谢。
When you create a new OData model, then you can not provide any filters.当您创建新的 OData model 时,您不能提供任何过滤器。 You have to provide the base URI of the service.
您必须提供服务的基本 URI。
Filtering by value happens automatically by the UI5 framework based on a context binding . UI5 框架基于上下文绑定自动按值过滤。
new ODataModel("proxy/http/FIORI-DEV.abc.com:8000/sap/opu/odata/sap/Z_FI_PAY_D_SRV/")
(or even better: you define your model using your manifest.json). new ODataModel("proxy/http/FIORI-DEV.abc.com:8000/sap/opu/odata/sap/Z_FI_PAY_D_SRV/")
(or even better: you define your model using your manifest.json )。view.setModel
view.setModel
将 model 分配给您的视图controlWhichShowsTheThing.bindObject
and will perform an HTTP request to the OData model to retrieve that object when required. controlWhichShowsTheThing.bindObject
的绑定路径,并将向 OData model 执行 HTTP 请求,以便在需要时检索该 ZA8CFDE6331BD59EB2AC96F8911C4B666。 Now you might ask "OK, so how does that binding path look"?现在您可能会问“好的,那么绑定路径看起来如何”? This actually depends on the oData model itself and how it addresses individual objects.
这实际上取决于 oData model 本身以及它如何处理单个对象。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.