cancel
Showing results for 
Search instead for 
Did you mean: 

Read Customer Hierarchy backwards

Former Member
0 Kudos

Hello,

i am seaching for a function which gives me all subsidiary customers of a customer.

For an example:

I have a customer 01234 which has 5 customers subsidiary.

I want to know these customer numbers. I know the table KNVH and that i can read it with HKUNR, but there must be another way.

In Transaction VDH2N there is what i need. But i don´t get how SAP reads the customers here.

Accepted Solutions (0)

Answers (1)

Answers (1)

Jelena
Active Contributor
0 Kudos

Customer hierarchies are stored in KNVH table. There is nothing wrong with reading it, there is even a "reverse look-up" index by HITYP and HKUNNR. Keep in mind though that there are also the validity dates.

You may also use one of the BAPIs below, but sometimes a simple SELECT is much faster and easier.

BAPI_CUSTOMER_GET_CHILDREN

BAPI_CUSTOMER_GET_ROOT

BAPI_CUSTOMER_GET_ROOT_LIST

Former Member
0 Kudos

Can you please explain what you mean by Reverse look-up index? How do you see that and what transaction do you go to?

Thanks,

Ta

Jelena
Active Contributor
0 Kudos

Indexes are maintained and viewed in Data Dictionary - transaction SE11. Enter the table name -> Display and then click Indexes button.

"Rreverse look-up" is not a technical or official term, but rather a jargon for the indexes that utilize the fields that are not part of the key but very commonly used to look up the table entries.