SAP Function Modules

RKE_READ_CUSTOMER_HIERARCHY SAP Function module







RKE_READ_CUSTOMER_HIERARCHY is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name RKE_READ_CUSTOMER_HIERARCHY into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: KEAA
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM RKE_READ_CUSTOMER_HIERARCHY - RKE READ CUSTOMER HIERARCHY





CALL FUNCTION 'RKE_READ_CUSTOMER_HIERARCHY' "
  EXPORTING
    customer =                  " knvh-kunnr
*   date = SY-DATUM             " knvh-datab
    htype =                     " knvh-hityp
    sales_channel =             " knvh-vtweg
    sales_division =            " knvh-spart
    sales_org =                 " knvh-vkorg
  TABLES
    hpath =                     " vbpavb
    .  "  RKE_READ_CUSTOMER_HIERARCHY

ABAP code example for Function Module RKE_READ_CUSTOMER_HIERARCHY





The ABAP code below is a full code listing to execute function module RKE_READ_CUSTOMER_HIERARCHY including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_hpath  TYPE STANDARD TABLE OF VBPAVB,"TABLES PARAM
wa_hpath  LIKE LINE OF it_hpath .


SELECT single KUNNR
FROM KNVH
INTO @DATA(ld_customer).


SELECT single DATAB
FROM KNVH
INTO @DATA(ld_date).


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).


"populate fields of struture and append to itab
append wa_hpath to it_hpath. . CALL FUNCTION 'RKE_READ_CUSTOMER_HIERARCHY' EXPORTING customer = ld_customer * date = ld_date htype = ld_htype sales_channel = ld_sales_channel sales_division = ld_sales_division sales_org = ld_sales_org TABLES hpath = it_hpath . " RKE_READ_CUSTOMER_HIERARCHY
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_customer  TYPE KNVH-KUNNR ,
it_hpath  TYPE STANDARD TABLE OF VBPAVB ,
wa_hpath  LIKE LINE OF it_hpath,
ld_date  TYPE KNVH-DATAB ,
ld_htype  TYPE KNVH-HITYP ,
ld_sales_channel  TYPE KNVH-VTWEG ,
ld_sales_division  TYPE KNVH-SPART ,
ld_sales_org  TYPE KNVH-VKORG .


SELECT single KUNNR
FROM KNVH
INTO ld_customer.


"populate fields of struture and append to itab
append wa_hpath to it_hpath.

SELECT single DATAB
FROM KNVH
INTO ld_date.


SELECT single HITYP
FROM KNVH
INTO ld_htype.


SELECT single VTWEG
FROM KNVH
INTO ld_sales_channel.


SELECT single SPART
FROM KNVH
INTO ld_sales_division.


SELECT single VKORG
FROM KNVH
INTO ld_sales_org.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name RKE_READ_CUSTOMER_HIERARCHY or its description.