0

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?

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
  • Rodrigo, Is "MatnrGetdetailCollection" a function? or an entitySet? if it is a function and all the filters are the pararmeters, why don't you just directly use them as parameter? If is is an entitySet, I want to know whether the query option is to filter the expanded MatnrClassGetdetail? or is to filter MatnrGetdetailCollection? – Layla Liu MSFT Jan 26 '15 at 02:17

2 Answers2

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.

Community
  • 1
  • 1
bgerth
  • 1,256
  • 1
  • 12
  • 19
  • Can you please clarify what you mean by "Review the questions Layla has asked." Who is Layla and where are these questions? – leigero Nov 05 '15 at 15:32
  • Sorry, I referred to [Layla Liu MSFT's comment](http://stackoverflow.com/questions/28052391/odata-sap-gateway-about-query-with-filter-and-expand-simultaneously#comments-28052391) above. I will update may answer accordingly. – bgerth Nov 05 '15 at 15:57
0

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
aniski
  • 1,263
  • 1
  • 16
  • 31