SAP Function Modules

TTE_DT_TREE_STRING_REPLACE SAP Function module - Replace string in decision tree







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

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


Pattern for FM TTE_DT_TREE_STRING_REPLACE - TTE DT TREE STRING REPLACE





CALL FUNCTION 'TTE_DT_TREE_STRING_REPLACE' "Replace string in decision tree
  TABLES
    tree_nodes =                " ttet_dt_tab_nodes  Decision Tree Nodes
    hdr_target =                " ttet_dt_tab_target  Target fields
    target_ctx =                " ttet_dt_tab_ctx  Target context
    test_fields =               " ttet_dt_tab_fld  Field used for Tests
    test_values =               " ttet_dt_tab_isvalue  Test Node: IsValue
    test_ctx =                  " ttet_dt_tab_ctx  Context Fields
    test_cmp =                  " ttet_dt_tab_comp  Context Fields
    result_nodes =              " ttet_dt_tab_result  Results
    result_ctx =                " ttet_dt_tab_ctx  Context Fields
    error_nodes =               " ttet_dt_tab_err  Error Nodes
    notes =                     " ttet_dt_note_tab  Notes text
    str_rep_tab =               " ttet_str_rep_tab  Table with string replacement instructions
  EXCEPTIONS
    STRING_FROM_IS_INITIAL = 1  "               str_rep_tab-string_from is initial
    .  "  TTE_DT_TREE_STRING_REPLACE

ABAP code example for Function Module TTE_DT_TREE_STRING_REPLACE





The ABAP code below is a full code listing to execute function module TTE_DT_TREE_STRING_REPLACE 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_tree_nodes  TYPE STANDARD TABLE OF TTET_DT_TAB_NODES,"TABLES PARAM
wa_tree_nodes  LIKE LINE OF it_tree_nodes ,
it_hdr_target  TYPE STANDARD TABLE OF TTET_DT_TAB_TARGET,"TABLES PARAM
wa_hdr_target  LIKE LINE OF it_hdr_target ,
it_target_ctx  TYPE STANDARD TABLE OF TTET_DT_TAB_CTX,"TABLES PARAM
wa_target_ctx  LIKE LINE OF it_target_ctx ,
it_test_fields  TYPE STANDARD TABLE OF TTET_DT_TAB_FLD,"TABLES PARAM
wa_test_fields  LIKE LINE OF it_test_fields ,
it_test_values  TYPE STANDARD TABLE OF TTET_DT_TAB_ISVALUE,"TABLES PARAM
wa_test_values  LIKE LINE OF it_test_values ,
it_test_ctx  TYPE STANDARD TABLE OF TTET_DT_TAB_CTX,"TABLES PARAM
wa_test_ctx  LIKE LINE OF it_test_ctx ,
it_test_cmp  TYPE STANDARD TABLE OF TTET_DT_TAB_COMP,"TABLES PARAM
wa_test_cmp  LIKE LINE OF it_test_cmp ,
it_result_nodes  TYPE STANDARD TABLE OF TTET_DT_TAB_RESULT,"TABLES PARAM
wa_result_nodes  LIKE LINE OF it_result_nodes ,
it_result_ctx  TYPE STANDARD TABLE OF TTET_DT_TAB_CTX,"TABLES PARAM
wa_result_ctx  LIKE LINE OF it_result_ctx ,
it_error_nodes  TYPE STANDARD TABLE OF TTET_DT_TAB_ERR,"TABLES PARAM
wa_error_nodes  LIKE LINE OF it_error_nodes ,
it_notes  TYPE STANDARD TABLE OF TTET_DT_NOTE_TAB,"TABLES PARAM
wa_notes  LIKE LINE OF it_notes ,
it_str_rep_tab  TYPE STANDARD TABLE OF TTET_STR_REP_TAB,"TABLES PARAM
wa_str_rep_tab  LIKE LINE OF it_str_rep_tab .


"populate fields of struture and append to itab
append wa_tree_nodes to it_tree_nodes.

"populate fields of struture and append to itab
append wa_hdr_target to it_hdr_target.

"populate fields of struture and append to itab
append wa_target_ctx to it_target_ctx.

"populate fields of struture and append to itab
append wa_test_fields to it_test_fields.

"populate fields of struture and append to itab
append wa_test_values to it_test_values.

"populate fields of struture and append to itab
append wa_test_ctx to it_test_ctx.

"populate fields of struture and append to itab
append wa_test_cmp to it_test_cmp.

"populate fields of struture and append to itab
append wa_result_nodes to it_result_nodes.

"populate fields of struture and append to itab
append wa_result_ctx to it_result_ctx.

"populate fields of struture and append to itab
append wa_error_nodes to it_error_nodes.

"populate fields of struture and append to itab
append wa_notes to it_notes.

"populate fields of struture and append to itab
append wa_str_rep_tab to it_str_rep_tab. . CALL FUNCTION 'TTE_DT_TREE_STRING_REPLACE' TABLES tree_nodes = it_tree_nodes hdr_target = it_hdr_target target_ctx = it_target_ctx test_fields = it_test_fields test_values = it_test_values test_ctx = it_test_ctx test_cmp = it_test_cmp result_nodes = it_result_nodes result_ctx = it_result_ctx error_nodes = it_error_nodes notes = it_notes str_rep_tab = it_str_rep_tab EXCEPTIONS STRING_FROM_IS_INITIAL = 1 . " TTE_DT_TREE_STRING_REPLACE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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:
it_tree_nodes  TYPE STANDARD TABLE OF TTET_DT_TAB_NODES ,
wa_tree_nodes  LIKE LINE OF it_tree_nodes,
it_hdr_target  TYPE STANDARD TABLE OF TTET_DT_TAB_TARGET ,
wa_hdr_target  LIKE LINE OF it_hdr_target,
it_target_ctx  TYPE STANDARD TABLE OF TTET_DT_TAB_CTX ,
wa_target_ctx  LIKE LINE OF it_target_ctx,
it_test_fields  TYPE STANDARD TABLE OF TTET_DT_TAB_FLD ,
wa_test_fields  LIKE LINE OF it_test_fields,
it_test_values  TYPE STANDARD TABLE OF TTET_DT_TAB_ISVALUE ,
wa_test_values  LIKE LINE OF it_test_values,
it_test_ctx  TYPE STANDARD TABLE OF TTET_DT_TAB_CTX ,
wa_test_ctx  LIKE LINE OF it_test_ctx,
it_test_cmp  TYPE STANDARD TABLE OF TTET_DT_TAB_COMP ,
wa_test_cmp  LIKE LINE OF it_test_cmp,
it_result_nodes  TYPE STANDARD TABLE OF TTET_DT_TAB_RESULT ,
wa_result_nodes  LIKE LINE OF it_result_nodes,
it_result_ctx  TYPE STANDARD TABLE OF TTET_DT_TAB_CTX ,
wa_result_ctx  LIKE LINE OF it_result_ctx,
it_error_nodes  TYPE STANDARD TABLE OF TTET_DT_TAB_ERR ,
wa_error_nodes  LIKE LINE OF it_error_nodes,
it_notes  TYPE STANDARD TABLE OF TTET_DT_NOTE_TAB ,
wa_notes  LIKE LINE OF it_notes,
it_str_rep_tab  TYPE STANDARD TABLE OF TTET_STR_REP_TAB ,
wa_str_rep_tab  LIKE LINE OF it_str_rep_tab.


"populate fields of struture and append to itab
append wa_tree_nodes to it_tree_nodes.

"populate fields of struture and append to itab
append wa_hdr_target to it_hdr_target.

"populate fields of struture and append to itab
append wa_target_ctx to it_target_ctx.

"populate fields of struture and append to itab
append wa_test_fields to it_test_fields.

"populate fields of struture and append to itab
append wa_test_values to it_test_values.

"populate fields of struture and append to itab
append wa_test_ctx to it_test_ctx.

"populate fields of struture and append to itab
append wa_test_cmp to it_test_cmp.

"populate fields of struture and append to itab
append wa_result_nodes to it_result_nodes.

"populate fields of struture and append to itab
append wa_result_ctx to it_result_ctx.

"populate fields of struture and append to itab
append wa_error_nodes to it_error_nodes.

"populate fields of struture and append to itab
append wa_notes to it_notes.

"populate fields of struture and append to itab
append wa_str_rep_tab to it_str_rep_tab.

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