SAP EDIT_TEXT Function Module for SAPscript: Edit text in the text editor
EDIT_TEXT is a standard edit 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 SAPscript: Edit text in the text editor 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 edit text FM, simply by entering the name EDIT_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 EDIT_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 'EDIT_TEXT'"SAPscript: Edit text in the text editor.
EXPORTING
* DISPLAY = ' ' "Indicator: Display mode
* LOCAL_CAT = ' ' "Text catalog local
* EDITOR_TITLE = ' ' "Text for editor title line
HEADER = "Text header of the text to be edited
* PAGE = ' ' "
* WINDOW = ' ' "
* SAVE = 'X' "Indicator: Saving by editor
* LINE_EDITOR = ' ' "Indicator: Line editor or PC editor
* CONTROL = ' ' "Control parameter for the editor
* PROGRAM = ' ' "Program name for program symbol replacement
IMPORTING
FUNCTION = "Indicator: Editing status
NEWHEADER = "Text header (changed)
RESULT = "Editor status information
TABLES
LINES = "Lines of text being edited
EXCEPTIONS
ID = 1 LANGUAGE = 2 LINESIZE = 3 NAME = 4 OBJECT = 5 TEXTFORMAT = 6 COMMUNICATION = 7
IMPORTING Parameters details for EDIT_TEXT
DISPLAY - Indicator: Display mode
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOCAL_CAT - Text catalog local
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EDITOR_TITLE - Text for editor title line
Data type: TTXIT-TDTEXTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
HEADER - Text header of the text to be edited
Data type: THEADOptional: No
Call by Reference: No ( called with pass by value option)
PAGE -
Data type: ITCTH-TDPAGEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
WINDOW -
Data type: ITCTH-TDWINDOWDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SAVE - Indicator: Saving by editor
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
LINE_EDITOR - Indicator: Line editor or PC editor
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CONTROL - Control parameter for the editor
Data type: ITCEDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PROGRAM - Program name for program symbol replacement
Data type: SY-REPIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for EDIT_TEXT
FUNCTION - Indicator: Editing status
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NEWHEADER - Text header (changed)
Data type: THEADOptional: No
Call by Reference: No ( called with pass by value option)
RESULT - Editor status information
Data type: ITCEROptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for EDIT_TEXT
LINES - Lines of text being edited
Data type: TLINEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ID - Text ID in text headers is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language in text header invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LINESIZE - Line width in text header invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NAME - Text name in text header invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT - Text object in text header invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TEXTFORMAT - Text format cannot be processed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
COMMUNICATION - Communication error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for EDIT_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_id | TYPE STRING, " | |||
| lt_lines | TYPE STANDARD TABLE OF TLINE, " | |||
| lv_display | TYPE TLINE, " SPACE | |||
| lv_function | TYPE TLINE, " | |||
| lv_local_cat | TYPE TLINE, " SPACE | |||
| lv_language | TYPE TLINE, " | |||
| lv_newheader | TYPE THEAD, " | |||
| lv_editor_title | TYPE TTXIT-TDTEXT, " SPACE | |||
| lv_header | TYPE THEAD, " | |||
| lv_result | TYPE ITCER, " | |||
| lv_linesize | TYPE ITCER, " | |||
| lv_name | TYPE ITCER, " | |||
| lv_page | TYPE ITCTH-TDPAGE, " SPACE | |||
| lv_object | TYPE ITCTH, " | |||
| lv_window | TYPE ITCTH-TDWINDOW, " SPACE | |||
| lv_save | TYPE ITCTH, " 'X' | |||
| lv_textformat | TYPE ITCTH, " | |||
| lv_line_editor | TYPE C, " SPACE | |||
| lv_communication | TYPE C, " | |||
| lv_control | TYPE ITCED, " SPACE | |||
| lv_program | TYPE SY-REPID. " SPACE |
|   CALL FUNCTION 'EDIT_TEXT' "SAPscript: Edit text in the text editor |
| EXPORTING | ||
| DISPLAY | = lv_display | |
| LOCAL_CAT | = lv_local_cat | |
| EDITOR_TITLE | = lv_editor_title | |
| HEADER | = lv_header | |
| PAGE | = lv_page | |
| WINDOW | = lv_window | |
| SAVE | = lv_save | |
| LINE_EDITOR | = lv_line_editor | |
| CONTROL | = lv_control | |
| PROGRAM | = lv_program | |
| IMPORTING | ||
| FUNCTION | = lv_function | |
| NEWHEADER | = lv_newheader | |
| RESULT | = lv_result | |
| TABLES | ||
| LINES | = lt_lines | |
| EXCEPTIONS | ||
| ID = 1 | ||
| LANGUAGE = 2 | ||
| LINESIZE = 3 | ||
| NAME = 4 | ||
| OBJECT = 5 | ||
| TEXTFORMAT = 6 | ||
| COMMUNICATION = 7 | ||
| . " EDIT_TEXT | ||
ABAP code using 7.40 inline data declarations to call FM EDIT_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.| DATA(ld_display) | = ' '. | |||
| DATA(ld_local_cat) | = ' '. | |||
| "SELECT single TDTEXT FROM TTXIT INTO @DATA(ld_editor_title). | ||||
| DATA(ld_editor_title) | = ' '. | |||
| "SELECT single TDPAGE FROM ITCTH INTO @DATA(ld_page). | ||||
| DATA(ld_page) | = ' '. | |||
| "SELECT single TDWINDOW FROM ITCTH INTO @DATA(ld_window). | ||||
| DATA(ld_window) | = ' '. | |||
| DATA(ld_save) | = 'X'. | |||
| DATA(ld_line_editor) | = ' '. | |||
| DATA(ld_control) | = ' '. | |||
| "SELECT single REPID FROM SY INTO @DATA(ld_program). | ||||
| DATA(ld_program) | = ' '. | |||
Search for further information about these or an SAP related objects