cancel
Showing results for 
Search instead for 
Did you mean: 

API_BUSINESS_PARTNER Default address

0 Kudos
740

Our middle ware is using API_BUSINESS_PARTNER ODATA service to pull BP address data from S/4HANA 1909 (on Premise) system. There are multiple addresses returned by the ODATA services for the entity A_BusinessPartnerAddress . How can the middle ware determine which one is the default address in S/4HANA ? What is the use of A_BuPaAddressUsage ? The validity end dates returned are not displaying proper date time stamps.

Can you suggest the best way to determine the BP default address using this ODATA service?

Thank you

Sanu

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Dear Sanu,

Create an oData call to: API_BUSINESS_PARTNER/A_BusinessPartner(BusinessPartner='xxxx')?$expand=to_BusinessPartnerAddress,to_BusinessPartnerAddress/to_AddressUsage

You will need to expand to the "to_BusinessPartnerAddress/to_AddressUsage".

It will return the different address usages. Search for the entities:"to_AddressUsage/AddressUsage" with the value: "XXDEFAULT".

The current active standard address is where the current date is between "ValidityStartDate" and "ValidityEndDate"

"to_AddressUsage": {

"results": [ { "__metadata": { "id": "xxxx", "uri": "xxxx", "type": "API_BUSINESS_PARTNER.A_BuPaAddressUsageType" }, "BusinessPartner": "xxx", "ValidityEndDate": "/Date(253402300799000+0000)/", "AddressUsage": "XXDEFAULT", "AddressID": "xxx", "ValidityStartDate": "/Date(1582070400000+0000)/", "StandardUsage": false, "AuthorizationGroup": "" } ]

}