OData call with $filter and $expand simultaneously

Deadly 提交于 2020-01-25 18:03:43

问题


I've been trying to call a entity, but i'm supposed to call the results from its associated entities. I tried to do it with the following URL:

/sap/opu/odata/XXXXXXXX/SERVICE_NAME/MatnrGetdetailCollection?$filter=IVendorId eq '1701' and ILanguage eq 'P' and IMaterial eq 'M-05'&$expand=MatnrClassGetdetail

I must use the filter because the called function has these mandatory parameters.

Am I making any mistake on the URL or the error isn't there?


回答1:


In general $filter and $expand can be combined, we use it in our application. Therefore please see Layla's Comment. In addition, you should tell us what the actual error is.

If MatnrGetdetailCollection is indeed an entity set, then the corresponding entity must have a navigation property of the name MatnrClassGetdetail, otherwise $expand won't work.




回答2:


There is some problem with the URL when you want to go for obligatory parameters. Please pass them as key values in segw and and go for the format I'm sending:

/sap/opu/odata/sap/SERVICE_NAME/EntitySet(keyfield='value',keyfield='value')/?$expand=navigationName


来源:https://stackoverflow.com/questions/28052391/odata-call-with-filter-and-expand-simultaneously

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!