Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SAP: KNVH Customer Hierarchy Table

Hi,

In SAP there is an Hierarchy Table called KNVH which gives an overview of the Customer Hierarchy.

For example, in the field KUNNR you'll find a customer number which refers to its higher leveled customer number, mentioned in the field HKUNNR.

When you select this HKUNNR, and you look it up in the KUNNR, you'll find it, again with a reference to a higher leveled customer number HKUNNR.

And so on and so on.

This circular loop mechanism repeats it selves in the same table over and over again, until you reach a highest level (the HKUNNR stays empty).

Now how can you manage this table in Qlikview, How do you determine which is the highest and lowest level.

This Table is linked to the Customer MasterData table KNA1, and the key we use is customer number (KUNNR)

6 Replies
Not applicable
Author

hi sven

You can see in table KNVH the field HZUOR. In this field it's the hierarchy level. Or you can in qlikview call the function BAPI_CUSTOMER_GET_CHILDREN .This Function, or BAPI, return a table with all the hierarchy per a customer number.

serge

Not applicable
Author

Thanks,

I'll try this sugestion

Not applicable
Author

Hi Sven,

Would you have an example of how to call the function. I am new to Qlikview and SAP.

Any help would be greatly appreciated.

Regards

Conor

skn
Employee
Employee

...

KundenHier:
hierarchy (KUNNR, HKUNNR, CustomerName,, CustomerName,Path,'|') load
*
resident KNVH;

Not applicable
Author

Hi Conor,

It was no succes for me with calling the function. But there is a good functionality in QV which can help you.

Here's an example of how I build a hierarchy. This will certainly work.











ProductHierarchy:

Hierarchy

CategoryID

,

CategoryName,

ParentCategoryID

FROM

;

ProductBelongsTo:

HierarchyBelongsTo

CategoryID

,

CategoryName as Name,

ParentCategoryID

RESIDENT

ProductHierarchy;

Hope to help you with this.

KR

Sven



(CategoryID, ParentCategoryID, Name, CategoryTreeID, CategoryTree)

LOAD

D:\MYDOCS\Projects (CategoryID, ParentCategoryID, CategoryName)

LOAD





mmichalke
Partner - Contributor III
Partner - Contributor III

Hey all,

can somebody explain hot to call bapi from qlikview or even provide a sample code ?

That would be great !

Cheers,

Moritz