SAP FM4C_READ_HIERARCHY Function Module for Hierarchy processing
FM4C_READ_HIERARCHY is a standard fm4c read hierarchy SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Hierarchy processing 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 fm4c read hierarchy FM, simply by entering the name FM4C_READ_HIERARCHY into the relevant SAP transaction such as SE37 or SE38.
Function Group: FM4C
Program Name: SAPLFM4C
Main Program: SAPLFM4C
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FM4C_READ_HIERARCHY 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 'FM4C_READ_HIERARCHY'"Hierarchy processing.
EXPORTING
I_FIKRS = "FM area
* I_FIPOS = ' ' "Start from commitment item
* I_FIPEX = ' ' "
* I_VARNT = '000' "
* I_HIVARNT = ' ' "
* I_FISTL = ' ' "Start from funds center
* I_GEBER = ' ' "Fund
* I_GJAHR = ' ' "Fiscal year
* I_FAREA = ' ' "
IMPORTING
E_PROFIL = "
TABLES
* T_EX_CARR = "
* T_FIPEX = "
* T_FISTL = "
EXCEPTIONS
FIKRS_NOT_FOUND = 1 FIPOS_NOT_FOUND = 2 FISTL_NOT_FOUND = 3
IMPORTING Parameters details for FM4C_READ_HIERARCHY
I_FIKRS - FM area
Data type: FM01-FIKRSOptional: No
Call by Reference: No ( called with pass by value option)
I_FIPOS - Start from commitment item
Data type: FMFPO-FIPOSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FIPEX -
Data type: FMFPO-FIPEXDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_VARNT -
Data type: FMPG-VARNTDefault: '000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_HIVARNT -
Data type: FMHISV-HIVARNTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FISTL - Start from funds center
Data type: FMFCTR-FICTRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_GEBER - Fund
Data type: BPIN-GEBERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_GJAHR - Fiscal year
Data type: BPIN-GJAHRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FAREA -
Data type: FMBU-FAREADefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for FM4C_READ_HIERARCHY
E_PROFIL -
Data type: TBP1C-PROFILOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for FM4C_READ_HIERARCHY
T_EX_CARR -
Data type: FM4C_CARROptional: Yes
Call by Reference: No ( called with pass by value option)
T_FIPEX -
Data type: RANGE_C24Optional: Yes
Call by Reference: No ( called with pass by value option)
T_FISTL -
Data type: RANGE_C16Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
FIKRS_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FIPOS_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FISTL_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for FM4C_READ_HIERARCHY 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: | ||||
| lv_i_fikrs | TYPE FM01-FIKRS, " | |||
| lv_e_profil | TYPE TBP1C-PROFIL, " | |||
| lt_t_ex_carr | TYPE STANDARD TABLE OF FM4C_CARR, " | |||
| lv_fikrs_not_found | TYPE FM4C_CARR, " | |||
| lv_i_fipos | TYPE FMFPO-FIPOS, " SPACE | |||
| lt_t_fipex | TYPE STANDARD TABLE OF RANGE_C24, " | |||
| lv_fipos_not_found | TYPE RANGE_C24, " | |||
| lv_i_fipex | TYPE FMFPO-FIPEX, " SPACE | |||
| lt_t_fistl | TYPE STANDARD TABLE OF RANGE_C16, " | |||
| lv_fistl_not_found | TYPE RANGE_C16, " | |||
| lv_i_varnt | TYPE FMPG-VARNT, " '000' | |||
| lv_i_hivarnt | TYPE FMHISV-HIVARNT, " SPACE | |||
| lv_i_fistl | TYPE FMFCTR-FICTR, " SPACE | |||
| lv_i_geber | TYPE BPIN-GEBER, " SPACE | |||
| lv_i_gjahr | TYPE BPIN-GJAHR, " SPACE | |||
| lv_i_farea | TYPE FMBU-FAREA. " SPACE |
|   CALL FUNCTION 'FM4C_READ_HIERARCHY' "Hierarchy processing |
| EXPORTING | ||
| I_FIKRS | = lv_i_fikrs | |
| I_FIPOS | = lv_i_fipos | |
| I_FIPEX | = lv_i_fipex | |
| I_VARNT | = lv_i_varnt | |
| I_HIVARNT | = lv_i_hivarnt | |
| I_FISTL | = lv_i_fistl | |
| I_GEBER | = lv_i_geber | |
| I_GJAHR | = lv_i_gjahr | |
| I_FAREA | = lv_i_farea | |
| IMPORTING | ||
| E_PROFIL | = lv_e_profil | |
| TABLES | ||
| T_EX_CARR | = lt_t_ex_carr | |
| T_FIPEX | = lt_t_fipex | |
| T_FISTL | = lt_t_fistl | |
| EXCEPTIONS | ||
| FIKRS_NOT_FOUND = 1 | ||
| FIPOS_NOT_FOUND = 2 | ||
| FISTL_NOT_FOUND = 3 | ||
| . " FM4C_READ_HIERARCHY | ||
ABAP code using 7.40 inline data declarations to call FM FM4C_READ_HIERARCHY
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 FIKRS FROM FM01 INTO @DATA(ld_i_fikrs). | ||||
| "SELECT single PROFIL FROM TBP1C INTO @DATA(ld_e_profil). | ||||
| "SELECT single FIPOS FROM FMFPO INTO @DATA(ld_i_fipos). | ||||
| DATA(ld_i_fipos) | = ' '. | |||
| "SELECT single FIPEX FROM FMFPO INTO @DATA(ld_i_fipex). | ||||
| DATA(ld_i_fipex) | = ' '. | |||
| "SELECT single VARNT FROM FMPG INTO @DATA(ld_i_varnt). | ||||
| DATA(ld_i_varnt) | = '000'. | |||
| "SELECT single HIVARNT FROM FMHISV INTO @DATA(ld_i_hivarnt). | ||||
| DATA(ld_i_hivarnt) | = ' '. | |||
| "SELECT single FICTR FROM FMFCTR INTO @DATA(ld_i_fistl). | ||||
| DATA(ld_i_fistl) | = ' '. | |||
| "SELECT single GEBER FROM BPIN INTO @DATA(ld_i_geber). | ||||
| DATA(ld_i_geber) | = ' '. | |||
| "SELECT single GJAHR FROM BPIN INTO @DATA(ld_i_gjahr). | ||||
| DATA(ld_i_gjahr) | = ' '. | |||
| "SELECT single FAREA FROM FMBU INTO @DATA(ld_i_farea). | ||||
| DATA(ld_i_farea) | = ' '. | |||
Search for further information about these or an SAP related objects