SAP TTE_DT_TREE_SAVE Function Module for Save Decision Tree
TTE_DT_TREE_SAVE is a standard tte dt tree save SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Save Decision Tree processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for tte dt tree save FM, simply by entering the name TTE_DT_TREE_SAVE into the relevant SAP transaction such as SE37 or SE38.
Function Group: CA_TTE_DT_XMLDOC
Program Name: SAPLCA_TTE_DT_XMLDOC
Main Program: SAPLCA_TTE_DT_XMLDOC
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TTE_DT_TREE_SAVE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'TTE_DT_TREE_SAVE'"Save Decision Tree.
EXPORTING
I_TREEID = "Decision Tree ID
I_TREETYPE = "Decision Tree Type
* I_VERSION = "Decision Tree Version
HDR_STAT = "Status Info
I_UPDATE = "Checkbox
* I_FILENAME = "
* I_ORDER = "Request/task
IMPORTING
E_ORDER = "Request/task
TABLES
TREE_NODES = "Decision Tree Nodes
* ERROR_NODES = "Error Nodes
* NOTES = "Notes text
* HDR_TARGET = "Target fields
* TARGET_CTX = "Target context
* TEST_FIELDS = "Field used for Tests
* TEST_VALUES = "Test Node: IsValue
* TEST_CTX = "Context Fields
* TEST_CMP = "Context Fields
* RESULT_NODES = "Results
* RESULT_CTX = "Context Fields
EXCEPTIONS
TRANSPORT_NOT_POSSIBLE = 1
IMPORTING Parameters details for TTE_DT_TREE_SAVE
I_TREEID - Decision Tree ID
Data type: TTET_DT_TREEIDOptional: No
Call by Reference: Yes
I_TREETYPE - Decision Tree Type
Data type: TTET_DT_TYPEOptional: No
Call by Reference: Yes
I_VERSION - Decision Tree Version
Data type: TTET_DT_VERSIONOptional: Yes
Call by Reference: Yes
HDR_STAT - Status Info
Data type: TTET_DT_SCR_STATOptional: No
Call by Reference: Yes
I_UPDATE - Checkbox
Data type: XFELDOptional: No
Call by Reference: Yes
I_FILENAME -
Data type: STRINGOptional: Yes
Call by Reference: Yes
I_ORDER - Request/task
Data type: TRKORROptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for TTE_DT_TREE_SAVE
E_ORDER - Request/task
Data type: TRKORROptional: No
Call by Reference: Yes
TABLES Parameters details for TTE_DT_TREE_SAVE
TREE_NODES - Decision Tree Nodes
Data type: TTET_DT_TAB_NODESOptional: No
Call by Reference: Yes
ERROR_NODES - Error Nodes
Data type: TTET_DT_TAB_ERROptional: Yes
Call by Reference: Yes
NOTES - Notes text
Data type: TTET_DT_NOTE_TABOptional: Yes
Call by Reference: Yes
HDR_TARGET - Target fields
Data type: TTET_DT_TAB_TARGETOptional: Yes
Call by Reference: Yes
TARGET_CTX - Target context
Data type: TTET_DT_TAB_CTXOptional: Yes
Call by Reference: Yes
TEST_FIELDS - Field used for Tests
Data type: TTET_DT_TAB_FLDOptional: Yes
Call by Reference: Yes
TEST_VALUES - Test Node: IsValue
Data type: TTET_DT_TAB_ISVALUEOptional: Yes
Call by Reference: Yes
TEST_CTX - Context Fields
Data type: TTET_DT_TAB_CTXOptional: Yes
Call by Reference: Yes
TEST_CMP - Context Fields
Data type: TTET_DT_TAB_COMPOptional: Yes
Call by Reference: Yes
RESULT_NODES - Results
Data type: TTET_DT_TAB_RESULTOptional: Yes
Call by Reference: Yes
RESULT_CTX - Context Fields
Data type: TTET_DT_TAB_CTXOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
TRANSPORT_NOT_POSSIBLE - Transport not possible
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for TTE_DT_TREE_SAVE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_e_order | TYPE TRKORR, " | |||
| lv_i_treeid | TYPE TTET_DT_TREEID, " | |||
| lt_tree_nodes | TYPE STANDARD TABLE OF TTET_DT_TAB_NODES, " | |||
| lv_transport_not_possible | TYPE TTET_DT_TAB_NODES, " | |||
| lt_error_nodes | TYPE STANDARD TABLE OF TTET_DT_TAB_ERR, " | |||
| lt_notes | TYPE STANDARD TABLE OF TTET_DT_NOTE_TAB, " | |||
| lt_hdr_target | TYPE STANDARD TABLE OF TTET_DT_TAB_TARGET, " | |||
| lv_i_treetype | TYPE TTET_DT_TYPE, " | |||
| lv_i_version | TYPE TTET_DT_VERSION, " | |||
| lt_target_ctx | TYPE STANDARD TABLE OF TTET_DT_TAB_CTX, " | |||
| lv_hdr_stat | TYPE TTET_DT_SCR_STAT, " | |||
| lt_test_fields | TYPE STANDARD TABLE OF TTET_DT_TAB_FLD, " | |||
| lv_i_update | TYPE XFELD, " | |||
| lt_test_values | TYPE STANDARD TABLE OF TTET_DT_TAB_ISVALUE, " | |||
| lt_test_ctx | TYPE STANDARD TABLE OF TTET_DT_TAB_CTX, " | |||
| lv_i_filename | TYPE STRING, " | |||
| lv_i_order | TYPE TRKORR, " | |||
| lt_test_cmp | TYPE STANDARD TABLE OF TTET_DT_TAB_COMP, " | |||
| lt_result_nodes | TYPE STANDARD TABLE OF TTET_DT_TAB_RESULT, " | |||
| lt_result_ctx | TYPE STANDARD TABLE OF TTET_DT_TAB_CTX. " |
|   CALL FUNCTION 'TTE_DT_TREE_SAVE' "Save Decision Tree |
| EXPORTING | ||
| I_TREEID | = lv_i_treeid | |
| I_TREETYPE | = lv_i_treetype | |
| I_VERSION | = lv_i_version | |
| HDR_STAT | = lv_hdr_stat | |
| I_UPDATE | = lv_i_update | |
| I_FILENAME | = lv_i_filename | |
| I_ORDER | = lv_i_order | |
| IMPORTING | ||
| E_ORDER | = lv_e_order | |
| TABLES | ||
| TREE_NODES | = lt_tree_nodes | |
| ERROR_NODES | = lt_error_nodes | |
| NOTES | = lt_notes | |
| HDR_TARGET | = lt_hdr_target | |
| TARGET_CTX | = lt_target_ctx | |
| TEST_FIELDS | = lt_test_fields | |
| TEST_VALUES | = lt_test_values | |
| TEST_CTX | = lt_test_ctx | |
| TEST_CMP | = lt_test_cmp | |
| RESULT_NODES | = lt_result_nodes | |
| RESULT_CTX | = lt_result_ctx | |
| EXCEPTIONS | ||
| TRANSPORT_NOT_POSSIBLE = 1 | ||
| . " TTE_DT_TREE_SAVE | ||
ABAP code using 7.40 inline data declarations to call FM TTE_DT_TREE_SAVE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.Search for further information about these or an SAP related objects