vdh1n in t codes
T View customer hierarchy using vdh1n and partner tab
D View customer hierarchy using vdh1n and header poartners tab in sales order
& Help View customer hierarchy using tcode vdh1n
Execute tcode VDH1N to view customer hierarchy




View via partner tab in sales order header
You can also view the customer hierachy details within the header parters tab when creating or changing a sales order in @VA01 / @VA02

The abap code to retrieve the customer hiearchy is as follows
*get customer sales org, distribution channel, division from table KNVH
CALL FUNCTION 'RKE_READ_CUSTOMER_HIERARCHY'
EXPORTING customer =
* DATE = SY-DATUM
htype = 'A' sales_channel =
TABLES
hpath = lt_hpath.
CLEAR ls_hpath.
READ TABLE lt_hpath INTO ls_hpath WITH KEY histunr = '03'.