Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

SAP: KNVH Customer Hierarchy Table

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

SAP: KNVH Customer Hierarchy Table

Thanks,

I'll try this sugestion

Not applicable

SAP: KNVH Customer Hierarchy Table

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
New Contributor

AW:SAP: KNVH Customer Hierarchy Table

...

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

Not applicable

SAP: KNVH Customer Hierarchy Table

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
New Contributor III

SAP: KNVH Customer Hierarchy Table

Hey all,

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

That would be great !

Cheers,

Moritz