on 2021 Sep 02 9:09 AM
Hello,
We are trying to fetch business partners with filter of city through S4 API in CAP project.
As City is present inside Address composite entity, we are not able to apply filter on city.
// Not compiling as .eq doesnt come on BusinessPartner.TO_BUSINESS_PARTNER_ADDRESS.Country
bpList = businessPartnerService.getAllBusinessPartner().filter(BusinessPartner.TO_BUSINESS_PARTNER_ADDRESS.Country.eq("India"))
Can you please help us to know how a filter on composite/associated entity can be applied.
P.S :
We found following link which shows it can work, but this is only for javascript.
/*
Get all business partners that match all the following conditions:
- Have customer with the customer name 'name'
- Have customer with the customer full name 'fullName'
*/
.filter(
BusinessPartner.TO_CUSTOMER.filter(
Customer.CUSTOMER_NAME.equals('name'),
Customer.CUSTOMER_FULL_NAME.equals('fullName')
)
)
We want to know if something similar is present in java.
I would suggest you try the filter as a pure OData query against the backend service. You will learn that the S/4HANA Business Partner service does not support filtering on 1:n relationships. If you need to restrict to the country you should start by filtering the Address Entity and expand to the business partners. Also the Country must be an ISO Code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
11 | |
10 | |
10 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.