SAP Function Modules

HRTMC_GET_ORG_HIER_SUB_POS SAP Function module







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

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


Pattern for FM HRTMC_GET_ORG_HIER_SUB_POS - HRTMC GET ORG HIER SUB POS





CALL FUNCTION 'HRTMC_GET_ORG_HIER_SUB_POS' "
* EXPORTING
*   depth = 0                   " twpc_v-depth
*   evpath =                    " twpc_v-evpath
*   plvar = 01                  " objec-plvar
*   begda = SY-DATUM            " objec-begda
*   endda = SY-DATUM            " objec-endda
*   level = 1                   " hrwpc_s_keystruc-level
  TABLES
    root_objects =              " hrrootob
    result_objec =              " objec
    result_struc =              " struc
    .  "  HRTMC_GET_ORG_HIER_SUB_POS

ABAP code example for Function Module HRTMC_GET_ORG_HIER_SUB_POS





The ABAP code below is a full code listing to execute function module HRTMC_GET_ORG_HIER_SUB_POS 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_root_objects  TYPE STANDARD TABLE OF HRROOTOB,"TABLES PARAM
wa_root_objects  LIKE LINE OF it_root_objects ,
it_result_objec  TYPE STANDARD TABLE OF OBJEC,"TABLES PARAM
wa_result_objec  LIKE LINE OF it_result_objec ,
it_result_struc  TYPE STANDARD TABLE OF STRUC,"TABLES PARAM
wa_result_struc  LIKE LINE OF it_result_struc .


SELECT single DEPTH
FROM TWPC_V
INTO @DATA(ld_depth).


SELECT single EVPATH
FROM TWPC_V
INTO @DATA(ld_evpath).


DATA(ld_plvar) = some text here

DATA(ld_begda) = 20210129

DATA(ld_endda) = 20210129

DATA(ld_level) = 123

"populate fields of struture and append to itab
append wa_root_objects to it_root_objects.

"populate fields of struture and append to itab
append wa_result_objec to it_result_objec.

"populate fields of struture and append to itab
append wa_result_struc to it_result_struc. . CALL FUNCTION 'HRTMC_GET_ORG_HIER_SUB_POS' * EXPORTING * depth = ld_depth * evpath = ld_evpath * plvar = ld_plvar * begda = ld_begda * endda = ld_endda * level = ld_level TABLES root_objects = it_root_objects result_objec = it_result_objec result_struc = it_result_struc . " HRTMC_GET_ORG_HIER_SUB_POS
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_depth  TYPE TWPC_V-DEPTH ,
it_root_objects  TYPE STANDARD TABLE OF HRROOTOB ,
wa_root_objects  LIKE LINE OF it_root_objects,
ld_evpath  TYPE TWPC_V-EVPATH ,
it_result_objec  TYPE STANDARD TABLE OF OBJEC ,
wa_result_objec  LIKE LINE OF it_result_objec,
ld_plvar  TYPE OBJEC-PLVAR ,
it_result_struc  TYPE STANDARD TABLE OF STRUC ,
wa_result_struc  LIKE LINE OF it_result_struc,
ld_begda  TYPE OBJEC-BEGDA ,
ld_endda  TYPE OBJEC-ENDDA ,
ld_level  TYPE HRWPC_S_KEYSTRUC-LEVEL .


SELECT single DEPTH
FROM TWPC_V
INTO ld_depth.


"populate fields of struture and append to itab
append wa_root_objects to it_root_objects.

SELECT single EVPATH
FROM TWPC_V
INTO ld_evpath.


"populate fields of struture and append to itab
append wa_result_objec to it_result_objec.

ld_plvar = some text here

"populate fields of struture and append to itab
append wa_result_struc to it_result_struc.

ld_begda = 20210129

ld_endda = 20210129

ld_level = 123

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