
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Tags:
- qlikview_scripting

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
I'll try this sugestion

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
...
KundenHier:
hierarchy (KUNNR, HKUNNR, CustomerName,, CustomerName,Path,'|') load
*
resident KNVH;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey all,
can somebody explain hot to call bapi from qlikview or even provide a sample code ?
That would be great !
Cheers,
Moritz
