SAP Function Modules

HR_STRUCTURE_GET SAP Function module







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

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


Pattern for FM HR_STRUCTURE_GET - HR STRUCTURE GET





CALL FUNCTION 'HR_STRUCTURE_GET' "
  EXPORTING
*   root_plvar =                " plvar         Plan Version
*   root_otype =                " otype         Object Type
*   root_objid =                " any           Object ID
*   root_objects =              " hrrootob_t    Org. Management: Table of Root Object Entries
*   begda = SY-DATUM            " begdatum      Start Date
*   endda = SY-DATUM            " enddatum      End Date
    pathid =                    " wegid         Evaluation Path
*   pathid_is_intern =          " hr_77awint
*   stru_tech_depth = 0         " tdepth        Technical depth of structure
*   stru_status_vector = '1'    " svect         Status Vector
*   stru_status_overlap = SPACE  " sactiv
*   provide_text = 'X'          " hr_tflag
*   provide_relat = 'X'         " hr_vflag
*   provide_dflag = 'X'         " flag
*   recursion_check = 'X'       " hr_recurs
*   authority_check = 'X'       " hr_authy
*   text_buffer_fill = 'X'      " flag
*   read_mode = 'F'             " hr_structure_buffer_mode  HRBAS: Type of Read Access in Structure Driver
*   keep_order =                " flag
  IMPORTING
    result_objects =            " objec_t       Org. Management: Table of Object Entries
    result_structure =          " struc_t       Org. Management: Table of Structure Entries
    root_copy =                 " gdstr         General Structure Description
  EXCEPTIONS
    PLVAR_NOT_FOUND = 1         "               No active plan version exists
    ROOT_NOT_FOUND = 2          "
    PATH_NOT_FOUND = 3          "
    INTERNAL_ERROR = 4          "
    .  "  HR_STRUCTURE_GET

ABAP code example for Function Module HR_STRUCTURE_GET





The ABAP code below is a full code listing to execute function module HR_STRUCTURE_GET 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_result_objects  TYPE OBJEC_T ,
ld_result_structure  TYPE STRUC_T ,
ld_root_copy  TYPE GDSTR .

DATA(ld_root_plvar) = 'Check type of data required'.
DATA(ld_root_otype) = 'Check type of data required'.
DATA(ld_root_objid) = 'Check type of data required'.
DATA(ld_root_objects) = 'Check type of data required'.
DATA(ld_begda) = 'Check type of data required'.
DATA(ld_endda) = 'Check type of data required'.
DATA(ld_pathid) = 'Check type of data required'.
DATA(ld_pathid_is_intern) = 'Check type of data required'.
DATA(ld_stru_tech_depth) = 'Check type of data required'.
DATA(ld_stru_status_vector) = 'Check type of data required'.
DATA(ld_stru_status_overlap) = 'Check type of data required'.
DATA(ld_provide_text) = 'Check type of data required'.
DATA(ld_provide_relat) = 'Check type of data required'.
DATA(ld_provide_dflag) = 'Check type of data required'.
DATA(ld_recursion_check) = 'Check type of data required'.
DATA(ld_authority_check) = 'Check type of data required'.
DATA(ld_text_buffer_fill) = 'Check type of data required'.
DATA(ld_read_mode) = 'Check type of data required'.
DATA(ld_keep_order) = 'Check type of data required'. . CALL FUNCTION 'HR_STRUCTURE_GET' EXPORTING * root_plvar = ld_root_plvar * root_otype = ld_root_otype * root_objid = ld_root_objid * root_objects = ld_root_objects * begda = ld_begda * endda = ld_endda pathid = ld_pathid * pathid_is_intern = ld_pathid_is_intern * stru_tech_depth = ld_stru_tech_depth * stru_status_vector = ld_stru_status_vector * stru_status_overlap = ld_stru_status_overlap * provide_text = ld_provide_text * provide_relat = ld_provide_relat * provide_dflag = ld_provide_dflag * recursion_check = ld_recursion_check * authority_check = ld_authority_check * text_buffer_fill = ld_text_buffer_fill * read_mode = ld_read_mode * keep_order = ld_keep_order IMPORTING result_objects = ld_result_objects result_structure = ld_result_structure root_copy = ld_root_copy EXCEPTIONS PLVAR_NOT_FOUND = 1 ROOT_NOT_FOUND = 2 PATH_NOT_FOUND = 3 INTERNAL_ERROR = 4 . " HR_STRUCTURE_GET
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 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_result_objects  TYPE OBJEC_T ,
ld_root_plvar  TYPE PLVAR ,
ld_result_structure  TYPE STRUC_T ,
ld_root_otype  TYPE OTYPE ,
ld_root_copy  TYPE GDSTR ,
ld_root_objid  TYPE ANY ,
ld_root_objects  TYPE HRROOTOB_T ,
ld_begda  TYPE BEGDATUM ,
ld_endda  TYPE ENDDATUM ,
ld_pathid  TYPE WEGID ,
ld_pathid_is_intern  TYPE HR_77AWINT ,
ld_stru_tech_depth  TYPE TDEPTH ,
ld_stru_status_vector  TYPE SVECT ,
ld_stru_status_overlap  TYPE SACTIV ,
ld_provide_text  TYPE HR_TFLAG ,
ld_provide_relat  TYPE HR_VFLAG ,
ld_provide_dflag  TYPE FLAG ,
ld_recursion_check  TYPE HR_RECURS ,
ld_authority_check  TYPE HR_AUTHY ,
ld_text_buffer_fill  TYPE FLAG ,
ld_read_mode  TYPE HR_STRUCTURE_BUFFER_MODE ,
ld_keep_order  TYPE FLAG .

ld_root_plvar = 'Check type of data required'.
ld_root_otype = 'Check type of data required'.
ld_root_objid = 'Check type of data required'.
ld_root_objects = 'Check type of data required'.
ld_begda = 'Check type of data required'.
ld_endda = 'Check type of data required'.
ld_pathid = 'Check type of data required'.
ld_pathid_is_intern = 'Check type of data required'.
ld_stru_tech_depth = 'Check type of data required'.
ld_stru_status_vector = 'Check type of data required'.
ld_stru_status_overlap = 'Check type of data required'.
ld_provide_text = 'Check type of data required'.
ld_provide_relat = 'Check type of data required'.
ld_provide_dflag = 'Check type of data required'.
ld_recursion_check = 'Check type of data required'.
ld_authority_check = 'Check type of data required'.
ld_text_buffer_fill = 'Check type of data required'.
ld_read_mode = 'Check type of data required'.
ld_keep_order = 'Check type of data required'.

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