Showing results for 
Search instead for 
Did you mean: 

OData V2 - Filtering collection using the "any" operator doesn't work

0 Kudos

I'm trying to create a wellformed OData V2 query using the standard Business Partner API on SAP S/4HANA.

According to OData standard, such query should work :

https://server/sap/opu/odata/sap/ API_BUSINESS_PARTNER/A_BusinessPartner?$format=json&$expand=to_BusinessPartnerAddress&$select=to_BusinessPartnerAddress&$filter=to_BusinessPartnerAddress/any(f:f/AddressID eq '25552')

Where I'm trying to filter the subcollection "to_BusinessPartnerAddress" by the property "AddressID" using the "any" operator.

However, I always get a syntax error.

Are such queries not possible in SAP OData V2 API ?

View Entire Topic
Product and Topic Expert
Product and Topic Expert
0 Kudos

Such queries are not possible with OData V2.

As a workaround you can send two requests: filter on A_BusinessPartnerAddress to get a (hopefully short) list of business partner ids, then use these values to filter on A_BusinessPartner.