SAP SD_CUSTOMER_HIERARCHY_PATH Function Module for NOTRANSL: Ermitteln des Kundenhierarchie-Pfades für Debitoren









SD_CUSTOMER_HIERARCHY_PATH is a standard sd customer hierarchy path SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Ermitteln des Kundenhierarchie-Pfades für Debitoren processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for sd customer hierarchy path FM, simply by entering the name SD_CUSTOMER_HIERARCHY_PATH into the relevant SAP transaction such as SE37 or SE38.

Function Group: V02H
Program Name: SAPLV02H
Main Program: SAPLV02H
Appliation area: V
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function SD_CUSTOMER_HIERARCHY_PATH pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'SD_CUSTOMER_HIERARCHY_PATH'"NOTRANSL: Ermitteln des Kundenhierarchie-Pfades für Debitoren
EXPORTING
CUSTOMER = "Hierarchy node: customer number
* DATE = SY-DATUM "Validity date
HTYPE = "Hierarchy type
SALES_CHANNEL = "Distribution channel
SALES_DIVISION = "Division
SALES_ORG = "Sales organization

IMPORTING
CUSTOMER_HZUOR = "

TABLES
HPATH = "Hierarchy path (partner funct./cust.numbers)

EXCEPTIONS
HITYP_NOT_EXIST = 1 NODE_NOT_EXIST = 2 PARVW_NOT_EXIST = 3
.



IMPORTING Parameters details for SD_CUSTOMER_HIERARCHY_PATH

CUSTOMER - Hierarchy node: customer number

Data type: KNVH-KUNNR
Optional: No
Call by Reference: No ( called with pass by value option)

DATE - Validity date

Data type: KNVH-DATAB
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

HTYPE - Hierarchy type

Data type: KNVH-HITYP
Optional: No
Call by Reference: No ( called with pass by value option)

SALES_CHANNEL - Distribution channel

Data type: KNVH-VTWEG
Optional: No
Call by Reference: No ( called with pass by value option)

SALES_DIVISION - Division

Data type: KNVH-SPART
Optional: No
Call by Reference: No ( called with pass by value option)

SALES_ORG - Sales organization

Data type: KNVH-VKORG
Optional: No
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for SD_CUSTOMER_HIERARCHY_PATH

CUSTOMER_HZUOR -

Data type: KNVH-HZUOR
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for SD_CUSTOMER_HIERARCHY_PATH

HPATH - Hierarchy path (partner funct./cust.numbers)

Data type: VBPAVB
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

HITYP_NOT_EXIST - Hierarchy type does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NODE_NOT_EXIST - Node does not exist in the hierarchy

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PARVW_NOT_EXIST - Partner function does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for SD_CUSTOMER_HIERARCHY_PATH Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lt_hpath  TYPE STANDARD TABLE OF VBPAVB, "   
lv_customer  TYPE KNVH-KUNNR, "   
lv_customer_hzuor  TYPE KNVH-HZUOR, "   
lv_hityp_not_exist  TYPE KNVH, "   
lv_date  TYPE KNVH-DATAB, "   SY-DATUM
lv_node_not_exist  TYPE KNVH, "   
lv_htype  TYPE KNVH-HITYP, "   
lv_parvw_not_exist  TYPE KNVH, "   
lv_sales_channel  TYPE KNVH-VTWEG, "   
lv_sales_division  TYPE KNVH-SPART, "   
lv_sales_org  TYPE KNVH-VKORG. "   

  CALL FUNCTION 'SD_CUSTOMER_HIERARCHY_PATH'  "NOTRANSL: Ermitteln des Kundenhierarchie-Pfades für Debitoren
    EXPORTING
         CUSTOMER = lv_customer
         DATE = lv_date
         HTYPE = lv_htype
         SALES_CHANNEL = lv_sales_channel
         SALES_DIVISION = lv_sales_division
         SALES_ORG = lv_sales_org
    IMPORTING
         CUSTOMER_HZUOR = lv_customer_hzuor
    TABLES
         HPATH = lt_hpath
    EXCEPTIONS
        HITYP_NOT_EXIST = 1
        NODE_NOT_EXIST = 2
        PARVW_NOT_EXIST = 3
. " SD_CUSTOMER_HIERARCHY_PATH




ABAP code using 7.40 inline data declarations to call FM SD_CUSTOMER_HIERARCHY_PATH

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single KUNNR FROM KNVH INTO @DATA(ld_customer).
 
"SELECT single HZUOR FROM KNVH INTO @DATA(ld_customer_hzuor).
 
 
"SELECT single DATAB FROM KNVH INTO @DATA(ld_date).
DATA(ld_date) = SY-DATUM.
 
 
"SELECT single HITYP FROM KNVH INTO @DATA(ld_htype).
 
 
"SELECT single VTWEG FROM KNVH INTO @DATA(ld_sales_channel).
 
"SELECT single SPART FROM KNVH INTO @DATA(ld_sales_division).
 
"SELECT single VKORG FROM KNVH INTO @DATA(ld_sales_org).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!