SAP Function Modules

G_SET_TREE_REPLACE_NAMES SAP Function module







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

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


Pattern for FM G_SET_TREE_REPLACE_NAMES - G SET TREE REPLACE NAMES





CALL FUNCTION 'G_SET_TREE_REPLACE_NAMES' "
* EXPORTING
*   i_new_setclass =            " setclass
*   i_new_kokrs =               " kokrs
*   i_new_ktopl =               " ktopl
*   i_new_fikrs =               " fikrs
*   i_new_subclass =            " setsubcls
*   i_new_prefix =              " setnamenew
*   i_old_prefix =              " setnamenew
*   i_new_suffix =              " setnamenew
*   i_delete_old_suffix =       " flag
*   i_copy_mask =               " setnamenew
*   i_application = SPACE       " char10
  TABLES
    t_sethier =                 " sethier
  EXCEPTIONS
    SET_IS_DYNAMIC = 1          "
    ILLEGAL_SETCLASS = 2        "
    NEW_NAME_TOO_LONG = 3       "
    ILLEGAL_SETNAME = 4         "
    .  "  G_SET_TREE_REPLACE_NAMES

ABAP code example for Function Module G_SET_TREE_REPLACE_NAMES





The ABAP code below is a full code listing to execute function module G_SET_TREE_REPLACE_NAMES 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_t_sethier  TYPE STANDARD TABLE OF SETHIER,"TABLES PARAM
wa_t_sethier  LIKE LINE OF it_t_sethier .

DATA(ld_i_new_setclass) = 'Check type of data required'.
DATA(ld_i_new_kokrs) = 'Check type of data required'.
DATA(ld_i_new_ktopl) = 'Check type of data required'.
DATA(ld_i_new_fikrs) = 'Check type of data required'.
DATA(ld_i_new_subclass) = 'Check type of data required'.
DATA(ld_i_new_prefix) = 'Check type of data required'.
DATA(ld_i_old_prefix) = 'Check type of data required'.
DATA(ld_i_new_suffix) = 'Check type of data required'.
DATA(ld_i_delete_old_suffix) = 'Check type of data required'.
DATA(ld_i_copy_mask) = 'Check type of data required'.
DATA(ld_i_application) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_sethier to it_t_sethier. . CALL FUNCTION 'G_SET_TREE_REPLACE_NAMES' * EXPORTING * i_new_setclass = ld_i_new_setclass * i_new_kokrs = ld_i_new_kokrs * i_new_ktopl = ld_i_new_ktopl * i_new_fikrs = ld_i_new_fikrs * i_new_subclass = ld_i_new_subclass * i_new_prefix = ld_i_new_prefix * i_old_prefix = ld_i_old_prefix * i_new_suffix = ld_i_new_suffix * i_delete_old_suffix = ld_i_delete_old_suffix * i_copy_mask = ld_i_copy_mask * i_application = ld_i_application TABLES t_sethier = it_t_sethier EXCEPTIONS SET_IS_DYNAMIC = 1 ILLEGAL_SETCLASS = 2 NEW_NAME_TOO_LONG = 3 ILLEGAL_SETNAME = 4 . " G_SET_TREE_REPLACE_NAMES
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_i_new_setclass  TYPE SETCLASS ,
it_t_sethier  TYPE STANDARD TABLE OF SETHIER ,
wa_t_sethier  LIKE LINE OF it_t_sethier,
ld_i_new_kokrs  TYPE KOKRS ,
ld_i_new_ktopl  TYPE KTOPL ,
ld_i_new_fikrs  TYPE FIKRS ,
ld_i_new_subclass  TYPE SETSUBCLS ,
ld_i_new_prefix  TYPE SETNAMENEW ,
ld_i_old_prefix  TYPE SETNAMENEW ,
ld_i_new_suffix  TYPE SETNAMENEW ,
ld_i_delete_old_suffix  TYPE FLAG ,
ld_i_copy_mask  TYPE SETNAMENEW ,
ld_i_application  TYPE CHAR10 .

ld_i_new_setclass = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_sethier to it_t_sethier.
ld_i_new_kokrs = 'Check type of data required'.
ld_i_new_ktopl = 'Check type of data required'.
ld_i_new_fikrs = 'Check type of data required'.
ld_i_new_subclass = 'Check type of data required'.
ld_i_new_prefix = 'Check type of data required'.
ld_i_old_prefix = 'Check type of data required'.
ld_i_new_suffix = 'Check type of data required'.
ld_i_delete_old_suffix = 'Check type of data required'.
ld_i_copy_mask = 'Check type of data required'.
ld_i_application = '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 G_SET_TREE_REPLACE_NAMES or its description.