SAP Function Modules

RSTS_HIERARCHY_TO_SET SAP Function module - BRST generate sets from general (sub-) hierarchies







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

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


Pattern for FM RSTS_HIERARCHY_TO_SET - RSTS HIERARCHY TO SET





CALL FUNCTION 'RSTS_HIERARCHY_TO_SET' "BRST generate sets from general (sub-) hierarchies
  EXPORTING
    hclass =                    " rsthvkey-hclass  Hierarchy class (from table TRSTHC)
    hienm =                     " rsthvkey-hienm  Hierarchy name
*   node_name = SPACE           " rsthie-name   Node name (for sub-hierarchy selection)
*   node_type = SPACE           " rsthie-type   Node type (for sub-hierarchy selection)
*   set_table =                 " rgsbs-table
*   set_field =                 " rgsbs-field
*   requester = SPACE           " rsthdivers-requester  Requested by
*   sellevel = SPACE            " any           Select up to this level
*   selmode = SPACE             " rsthdivers-selmode  Selection mode
*   with_texts = SPACE          " flag          Expects I-RSTTXT to be filled
  IMPORTING
    set_name =                  " csequence     Root set of the generated hierarchy
  EXCEPTIONS
    HIERARCHY_NOT_FOUND = 1     "
    NODE_NOT_FOUND = 2          "
    INCONSISTENT_HIERARCHY = 3  "
    .  "  RSTS_HIERARCHY_TO_SET

ABAP code example for Function Module RSTS_HIERARCHY_TO_SET





The ABAP code below is a full code listing to execute function module RSTS_HIERARCHY_TO_SET 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_set_name  TYPE CSEQUENCE .


DATA(ld_hclass) = some text here

DATA(ld_hienm) = some text here

DATA(ld_node_name) = some text here

DATA(ld_node_type) = some text here

DATA(ld_set_table) = some text here

DATA(ld_set_field) = some text here

DATA(ld_requester) = some text here
DATA(ld_sellevel) = 'Check type of data required'.

DATA(ld_selmode) = some text here
DATA(ld_with_texts) = 'Check type of data required'. . CALL FUNCTION 'RSTS_HIERARCHY_TO_SET' EXPORTING hclass = ld_hclass hienm = ld_hienm * node_name = ld_node_name * node_type = ld_node_type * set_table = ld_set_table * set_field = ld_set_field * requester = ld_requester * sellevel = ld_sellevel * selmode = ld_selmode * with_texts = ld_with_texts IMPORTING set_name = ld_set_name EXCEPTIONS HIERARCHY_NOT_FOUND = 1 NODE_NOT_FOUND = 2 INCONSISTENT_HIERARCHY = 3 . " RSTS_HIERARCHY_TO_SET
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 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_set_name  TYPE CSEQUENCE ,
ld_hclass  TYPE RSTHVKEY-HCLASS ,
ld_hienm  TYPE RSTHVKEY-HIENM ,
ld_node_name  TYPE RSTHIE-NAME ,
ld_node_type  TYPE RSTHIE-TYPE ,
ld_set_table  TYPE RGSBS-TABLE ,
ld_set_field  TYPE RGSBS-FIELD ,
ld_requester  TYPE RSTHDIVERS-REQUESTER ,
ld_sellevel  TYPE ANY ,
ld_selmode  TYPE RSTHDIVERS-SELMODE ,
ld_with_texts  TYPE FLAG .


ld_hclass = some text here

ld_hienm = some text here

ld_node_name = some text here

ld_node_type = some text here

ld_set_table = some text here

ld_set_field = some text here

ld_requester = some text here
ld_sellevel = 'Check type of data required'.

ld_selmode = some text here
ld_with_texts = '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 RSTS_HIERARCHY_TO_SET or its description.