cancel
Showing results for 
Search instead for 
Did you mean: 

Need API to Fetch Customer Hierarchies in S/4HANA Public Cloud

THEMBO_JONATHAN
Explorer
0 Kudos
282

Hello SAP Community,

I am currently working with SAP S/4HANA Public Cloud and I need to programmatically retrieve Customer Hierarchies (e.g., parent-child relationships between sold-to, payer, bill-to, ship-to partners, etc.). After reviewing the available APIs in the SAP Business Accelerator Hub, I have not found an OData or SOAP API that explicitly supports fetching customer hierarchies or customer master relationship data.

I have already explored the following:

  • Business Partner APIs (API_BUSINESS_PARTNER)

  • Available CDS Views and Communication Scenarios

None of these seem to expose the full customer hierarchy data as required for our use case.

My questions:

  1. Is there an existing standard API or communication scenario in S/4HANA Public Cloud that supports retrieving customer hierarchies?

  2. If not available as a standard API, is there a released CDS View or extension point that can be used via a custom communication scenario?

  3. Are there recommended approaches or best practices for handling this requirement in a public cloud environment, given the extensibility restrictions?

Any guidance or references would be highly appreciated.

Thank you in advance!

View Entire Topic
Jeremy_Deo
Active Participant

Hello dear user,

And thank you for asking your question in the SAP community blog.

 

To retrieve customer hierarchy data in SAP S/4HANA Cloud Public Edition, there’s no out-of-the-box API that exposes the full hierarchy structure directly. The standard Business Partner OData API (API_BUSINESS_PARTNER) lets you pull core customer master data, but it doesn’t include hierarchy relationships like parent-child customer assignments used for pricing or reporting.

 

To access hierarchy data, create a custom CDS view using standard interface views such as I_CustomerHierarchyNode and I_CustomerHierarchy. From there, you can expose it as a custom OData service using a communication scenario.

 

This gives you a flexible way to pull the relevant hierarchy structure  for example, customer, hierarchy ID, higher-level customer, etc. and integrate it with other systems or reports.

 

I hope this will help you answer your question.

Best regards,

Jeremy

THEMBO_JONATHAN
Explorer
0 Kudos

Thanks @Jeremy_Deo

In my tenant instance I am not able to find  standard interface views I_CustomerHierarchyNode and I_CustomerHierarchy in the browser views app.

Note that I am using SAP S/4HANA public cloud.

And also, are there specific roles I need because I have the

BR_ADMINISTRATOR , BR_EXTENSIBILITY_SPEC

assigned to me.

Even when I am assigned these roles, on the CDS views App the create new CDS view is not active.

@Edrilan_Berisha/ @SAPSupport  what would be the best solution on this especially to have the necessary standard views released for our developement and meeting our timeline, is this something I can do in my test tenant or its the SAP team
Thank you so much