SAP Knowledge Base Article - Public

2796677 - SAP OData Service accounthierarchylist Does not Fetch the Parent Account Data for the Entity BusinessPartnerBusinessPartnerCollection


Your requirement is to get the Parent Account related information from Account Hierarchy using the SAP OData Service accounthierarchylist. Upon executing the query for the entity BusinessPartnerBusinessPartnerCollection, the Account IDs does not contain the Parent Account details.


SAP Cloud for Customer

Reproducing the Issue

1. Go to Administrator work center
2. Go to OData Service Explorer view
3. Show SAP OData Services
4. Highlight the Service name: accounthierarchylist and select Test
5. On the OData Console, in the left pane, select the Entity Set BusinessPartnerBusinessPartnerCollection
6. Select the Test tab
7. For the Request Method GET, execute the query
(where myxxxxxx represents the tenant)
8. Check the Response in the XML tab
9. Account IDs do not contain the Parent Account details

When you execute the Request Method for the above query, you notice that the Account ID: YYYYY does not contain the Parent Account details


(YYYYY represents the Account ID)


The SAP OData Service accounthierarchylist is modeled to fetch the details of a single account at a time.


While calling the GET method, the particular Account ID needs to be passed. The SAP OData Service accounthierarchylist can accept one Account ID and gives the complete hierarchy structure of the respective account, for example all the Child Accounts and its Parent and Top details.

Example:$filter=InternalID eq 'YYYYY'

Parent Account details are available when you execute the above OData Query

<d:Parent_Account_Name>Max Mustermann</d:Parent_Account_Name>
<d:Top_Account_Name>Max Mustermann</d:Top_Account_Name>

(where ZZZZZ represents the Parent Account and Top Level Account in this example)

See Also

KBA  2930423  informs about an alternative approach to download multiple accounts within their account hierarchy.


Account Hierarchy, accounthierarchylist, Top Level Account, Parent Account, BusinessPartnerBusinessPartnerCollection , KBA , LOD-CRM-INT-API , OData API (C4C Only) , Problem


SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions