SAP Function Modules

RSTC_GET_INFOAREA_HIER SAP Function module - Hierarchy Extractor for 0TCTIFAREA







RSTC_GET_INFOAREA_HIER 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 RSTC_GET_INFOAREA_HIER into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM RSTC_GET_INFOAREA_HIER - RSTC GET INFOAREA HIER





CALL FUNCTION 'RSTC_GET_INFOAREA_HIER' "Hierarchy Extractor for 0TCTIFAREA
  EXPORTING
    i_s_hiebas =                " rsap_s_hiebas
    i_s_hieflag =               " rsap_s_hieflag
    i_s_hiersel =               " rsap_s_hier_list
*   i_rlogsys =                 " rsap_s_request-rcvprn
  IMPORTING
    e_s_header =                " roshiersel    Interface: Requested hierarchies
  TABLES
    i_t_langu =                 " sbiwa_t_langu
    e_t_hietext =               " rsap_t_hietext
*   e_t_foldert =               " rsap_t_foldert
*   e_t_hieintv =               " roverfhin2    Interface: Hierarchy Intervals for 3.0A
    e_t_hienode =               " rstctifareahienode  Infoarea Hierarchy Nodes
  EXCEPTIONS
    INVALID_CHABASNM_HCLASS = 1  "
    INVALID_HIERARCHY_FLAG = 2  "
    INVALID_HIERARCHY_SELECT = 3  "
    LANGU_NOT_SUPPORTED = 4     "
    HIERARCHY_TAB_NOT_FOUND = 5  "
    APPLICATION_ERROR = 6       "
    .  "  RSTC_GET_INFOAREA_HIER

ABAP code example for Function Module RSTC_GET_INFOAREA_HIER





The ABAP code below is a full code listing to execute function module RSTC_GET_INFOAREA_HIER 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:
ld_e_s_header  TYPE ROSHIERSEL ,
it_i_t_langu  TYPE STANDARD TABLE OF SBIWA_T_LANGU,"TABLES PARAM
wa_i_t_langu  LIKE LINE OF it_i_t_langu ,
it_e_t_hietext  TYPE STANDARD TABLE OF RSAP_T_HIETEXT,"TABLES PARAM
wa_e_t_hietext  LIKE LINE OF it_e_t_hietext ,
it_e_t_foldert  TYPE STANDARD TABLE OF RSAP_T_FOLDERT,"TABLES PARAM
wa_e_t_foldert  LIKE LINE OF it_e_t_foldert ,
it_e_t_hieintv  TYPE STANDARD TABLE OF ROVERFHIN2,"TABLES PARAM
wa_e_t_hieintv  LIKE LINE OF it_e_t_hieintv ,
it_e_t_hienode  TYPE STANDARD TABLE OF RSTCTIFAREAHIENODE,"TABLES PARAM
wa_e_t_hienode  LIKE LINE OF it_e_t_hienode .

DATA(ld_i_s_hiebas) = 'Check type of data required'.
DATA(ld_i_s_hieflag) = 'Check type of data required'.
DATA(ld_i_s_hiersel) = 'Check type of data required'.

DATA(ld_i_rlogsys) = some text here

"populate fields of struture and append to itab
append wa_i_t_langu to it_i_t_langu.

"populate fields of struture and append to itab
append wa_e_t_hietext to it_e_t_hietext.

"populate fields of struture and append to itab
append wa_e_t_foldert to it_e_t_foldert.

"populate fields of struture and append to itab
append wa_e_t_hieintv to it_e_t_hieintv.

"populate fields of struture and append to itab
append wa_e_t_hienode to it_e_t_hienode. . CALL FUNCTION 'RSTC_GET_INFOAREA_HIER' EXPORTING i_s_hiebas = ld_i_s_hiebas i_s_hieflag = ld_i_s_hieflag i_s_hiersel = ld_i_s_hiersel * i_rlogsys = ld_i_rlogsys IMPORTING e_s_header = ld_e_s_header TABLES i_t_langu = it_i_t_langu e_t_hietext = it_e_t_hietext * e_t_foldert = it_e_t_foldert * e_t_hieintv = it_e_t_hieintv e_t_hienode = it_e_t_hienode EXCEPTIONS INVALID_CHABASNM_HCLASS = 1 INVALID_HIERARCHY_FLAG = 2 INVALID_HIERARCHY_SELECT = 3 LANGU_NOT_SUPPORTED = 4 HIERARCHY_TAB_NOT_FOUND = 5 APPLICATION_ERROR = 6 . " RSTC_GET_INFOAREA_HIER
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here 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_e_s_header  TYPE ROSHIERSEL ,
ld_i_s_hiebas  TYPE RSAP_S_HIEBAS ,
it_i_t_langu  TYPE STANDARD TABLE OF SBIWA_T_LANGU ,
wa_i_t_langu  LIKE LINE OF it_i_t_langu,
ld_i_s_hieflag  TYPE RSAP_S_HIEFLAG ,
it_e_t_hietext  TYPE STANDARD TABLE OF RSAP_T_HIETEXT ,
wa_e_t_hietext  LIKE LINE OF it_e_t_hietext,
ld_i_s_hiersel  TYPE RSAP_S_HIER_LIST ,
it_e_t_foldert  TYPE STANDARD TABLE OF RSAP_T_FOLDERT ,
wa_e_t_foldert  LIKE LINE OF it_e_t_foldert,
ld_i_rlogsys  TYPE RSAP_S_REQUEST-RCVPRN ,
it_e_t_hieintv  TYPE STANDARD TABLE OF ROVERFHIN2 ,
wa_e_t_hieintv  LIKE LINE OF it_e_t_hieintv,
it_e_t_hienode  TYPE STANDARD TABLE OF RSTCTIFAREAHIENODE ,
wa_e_t_hienode  LIKE LINE OF it_e_t_hienode.

ld_i_s_hiebas = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_i_t_langu to it_i_t_langu.
ld_i_s_hieflag = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_e_t_hietext to it_e_t_hietext.
ld_i_s_hiersel = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_e_t_foldert to it_e_t_foldert.

ld_i_rlogsys = some text here

"populate fields of struture and append to itab
append wa_e_t_hieintv to it_e_t_hieintv.

"populate fields of struture and append to itab
append wa_e_t_hienode to it_e_t_hienode.

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 RSTC_GET_INFOAREA_HIER or its description.