SAP RSTH_CREATE_RSTHIE Function Module for NOTRANSL: Erzeugt aus den Vater-Sohn-Beziehungen die RSTHIE (schnell)
RSTH_CREATE_RSTHIE is a standard rsth create rsthie 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: Erzeugt aus den Vater-Sohn-Beziehungen die RSTHIE (schnell) 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 rsth create rsthie FM, simply by entering the name RSTH_CREATE_RSTHIE into the relevant SAP transaction such as SE37 or SE38.
Function Group: RSTH
Program Name: SAPLRSTH
Main Program: SAPLRSTH
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RSTH_CREATE_RSTHIE 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 'RSTH_CREATE_RSTHIE'"NOTRANSL: Erzeugt aus den Vater-Sohn-Beziehungen die RSTHIE (schnell).
EXPORTING
I_ROOT_TYPE = "Type of unique root
I_ROOT_NAME = "Name of unique root
* I_ROOT_DEL = "Delete root node
IMPORTING
E_RSTHIE = "Filled RSTHIE
CHANGING
I_PC_TAB = "Table for parent-child relationships
EXCEPTIONS
ROOT_NOT_FOUND = 1 LOOP_IN_PC_TAB = 2
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLRSTH_001 Deliver Hierarchy Information
EXIT_SAPLRSTH_002 User-defined Hierarchies
IMPORTING Parameters details for RSTH_CREATE_RSTHIE
I_ROOT_TYPE - Type of unique root
Data type: RSTHIE-TYPEOptional: No
Call by Reference: No ( called with pass by value option)
I_ROOT_NAME - Name of unique root
Data type: RSTHIE-NAMEOptional: No
Call by Reference: No ( called with pass by value option)
I_ROOT_DEL - Delete root node
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RSTH_CREATE_RSTHIE
E_RSTHIE - Filled RSTHIE
Data type: RKD7_T_RSTHIEOptional: No
Call by Reference: Yes
CHANGING Parameters details for RSTH_CREATE_RSTHIE
I_PC_TAB - Table for parent-child relationships
Data type: RKD7_T_PARENTCHILDOptional: No
Call by Reference: Yes
EXCEPTIONS details
ROOT_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LOOP_IN_PC_TAB -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RSTH_CREATE_RSTHIE 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_e_rsthie | TYPE RKD7_T_RSTHIE, " | |||
| lv_i_pc_tab | TYPE RKD7_T_PARENTCHILD, " | |||
| lv_i_root_type | TYPE RSTHIE-TYPE, " | |||
| lv_root_not_found | TYPE RSTHIE, " | |||
| lv_i_root_name | TYPE RSTHIE-NAME, " | |||
| lv_loop_in_pc_tab | TYPE RSTHIE, " | |||
| lv_i_root_del | TYPE C. " |
|   CALL FUNCTION 'RSTH_CREATE_RSTHIE' "NOTRANSL: Erzeugt aus den Vater-Sohn-Beziehungen die RSTHIE (schnell) |
| EXPORTING | ||
| I_ROOT_TYPE | = lv_i_root_type | |
| I_ROOT_NAME | = lv_i_root_name | |
| I_ROOT_DEL | = lv_i_root_del | |
| IMPORTING | ||
| E_RSTHIE | = lv_e_rsthie | |
| CHANGING | ||
| I_PC_TAB | = lv_i_pc_tab | |
| EXCEPTIONS | ||
| ROOT_NOT_FOUND = 1 | ||
| LOOP_IN_PC_TAB = 2 | ||
| . " RSTH_CREATE_RSTHIE | ||
ABAP code using 7.40 inline data declarations to call FM RSTH_CREATE_RSTHIE
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 TYPE FROM RSTHIE INTO @DATA(ld_i_root_type). | ||||
| "SELECT single NAME FROM RSTHIE INTO @DATA(ld_i_root_name). | ||||
Search for further information about these or an SAP related objects