SAP COMMIT_TEXT Function Module for Transfer text creation text(s) to update
COMMIT_TEXT is a standard commit text SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Transfer text creation text(s) to update 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 commit text FM, simply by entering the name COMMIT_TEXT into the relevant SAP transaction such as SE37 or SE38.
Function Group: STXD
Program Name: SAPLSTXD
Main Program: SAPLSTXD
Appliation area:
Release date: 16-Jan-1995
Mode(Normal, Remote etc): Normal Function Module
Update:
Function COMMIT_TEXT 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 'COMMIT_TEXT'"Transfer text creation text(s) to update.
EXPORTING
* OBJECT = '*' "Text object
* NAME = '*' "Text Name
* ID = '*' "Text ID
* LANGUAGE = '*' "Text language
* SAVEMODE_DIRECT = ' ' "Indicator: Save texts immediately
* KEEP = ' ' "Indicator: Continue to keep texts in text memory
* LOCAL_CAT = ' ' "Catalog stored locally and not in memory
IMPORTING
COMMIT_COUNT = "Number of updated texts
TABLES
* T_OBJECT = "Table for text objects (RANGES)
* T_NAME = "Table for text names (RANGES)
* T_ID = "Table for text IDs (RANGES)
* T_LANGUAGE = "Table for text languages (RANGES)
IMPORTING Parameters details for COMMIT_TEXT
OBJECT - Text object
Data type: THEAD-TDOBJECTDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
NAME - Text Name
Data type: THEAD-TDNAMEDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ID - Text ID
Data type: THEAD-TDIDDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE - Text language
Data type: THEAD-TDSPRASDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SAVEMODE_DIRECT - Indicator: Save texts immediately
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
KEEP - Indicator: Continue to keep texts in text memory
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOCAL_CAT - Catalog stored locally and not in memory
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for COMMIT_TEXT
COMMIT_COUNT - Number of updated texts
Data type: SY-INDEXOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for COMMIT_TEXT
T_OBJECT - Table for text objects (RANGES)
Data type: STXDROBJOptional: Yes
Call by Reference: No ( called with pass by value option)
T_NAME - Table for text names (RANGES)
Data type: STXDRNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
T_ID - Table for text IDs (RANGES)
Data type: STXDRIDOptional: Yes
Call by Reference: No ( called with pass by value option)
T_LANGUAGE - Table for text languages (RANGES)
Data type: STXDRLANGOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for COMMIT_TEXT 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_object | TYPE THEAD-TDOBJECT, " '*' | |||
lt_t_object | TYPE STANDARD TABLE OF STXDROBJ, " | |||
lv_commit_count | TYPE SY-INDEX, " | |||
lv_name | TYPE THEAD-TDNAME, " '*' | |||
lt_t_name | TYPE STANDARD TABLE OF STXDRNAME, " | |||
lv_id | TYPE THEAD-TDID, " '*' | |||
lt_t_id | TYPE STANDARD TABLE OF STXDRID, " | |||
lv_language | TYPE THEAD-TDSPRAS, " '*' | |||
lt_t_language | TYPE STANDARD TABLE OF STXDRLANG, " | |||
lv_savemode_direct | TYPE STXDRLANG, " SPACE | |||
lv_keep | TYPE STXDRLANG, " SPACE | |||
lv_local_cat | TYPE STXDRLANG. " SPACE |
  CALL FUNCTION 'COMMIT_TEXT' "Transfer text creation text(s) to update |
EXPORTING | ||
OBJECT | = lv_object | |
NAME | = lv_name | |
ID | = lv_id | |
LANGUAGE | = lv_language | |
SAVEMODE_DIRECT | = lv_savemode_direct | |
KEEP | = lv_keep | |
LOCAL_CAT | = lv_local_cat | |
IMPORTING | ||
COMMIT_COUNT | = lv_commit_count | |
TABLES | ||
T_OBJECT | = lt_t_object | |
T_NAME | = lt_t_name | |
T_ID | = lt_t_id | |
T_LANGUAGE | = lt_t_language | |
. " COMMIT_TEXT |
ABAP code using 7.40 inline data declarations to call FM COMMIT_TEXT
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."SELECT single TDOBJECT FROM THEAD INTO @DATA(ld_object). | ||||
DATA(ld_object) | = '*'. | |||
"SELECT single INDEX FROM SY INTO @DATA(ld_commit_count). | ||||
"SELECT single TDNAME FROM THEAD INTO @DATA(ld_name). | ||||
DATA(ld_name) | = '*'. | |||
"SELECT single TDID FROM THEAD INTO @DATA(ld_id). | ||||
DATA(ld_id) | = '*'. | |||
"SELECT single TDSPRAS FROM THEAD INTO @DATA(ld_language). | ||||
DATA(ld_language) | = '*'. | |||
DATA(ld_savemode_direct) | = ' '. | |||
DATA(ld_keep) | = ' '. | |||
DATA(ld_local_cat) | = ' '. | |||
Search for further information about these or an SAP related objects