SAP TEXT_FOR_OPERATION Function Module for Text editing for routing and BOM items
TEXT_FOR_OPERATION is a standard text for operation SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Text editing for routing and BOM items 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 text for operation FM, simply by entering the name TEXT_FOR_OPERATION into the relevant SAP transaction such as SE37 or SE38.
Function Group: C0TX
Program Name: SAPLC0TX
Main Program: SAPLC0TX
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TEXT_FOR_OPERATION 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 'TEXT_FOR_OPERATION'"Text editing for routing and BOM items.
EXPORTING
* FLG_EDIT = 'X' "Indicator: editor is to be accessed
OBJECT = "Text object for SAPscript word processing
* SHOW_FLAG = ' ' "Indicator: only display in editor
SPALTEN = "Line length in editor
* TEXTTITLE = ' ' "Title for SAPscript word processing
* VLSCH = ' ' "Key of the standard text
* VLSCH_FLAG = ' ' "Indicator: standard text key changed
* CONTROL_IMP = ' ' "
* DONT_SEND_POPUP_IMP = ' ' "
* I_FLG_LTEXT_INLINE = ' ' "
* AUTYP = "Order Category
ID = "Text ID for SAPscript word process
* INLINE_NUMBER = '1' "Number of inline lines to be edited
* LANGUAGE = SY-LANGU "Language key
* LINELENGTH = 0 "Overlapping length inline with line width
LTSCH = "Long text key (old)
LTSCH_NEU = "New long text key
* LTXT1 = ' ' "First inline
* LTXT2 = ' ' "Second inline line
IMPORTING
ACTION = "Editor action (changed, deleted, ...)
LTSCH_OUT = "New long text key
LTXT1_OUT = "Updated first inline line
LTXT2_OUT = "Updated second inline line
RESULT = "
EXCEPTIONS
KEINE_VORLAGE = 1 KEIN_EINTRAG = 2 KEIN_LANGTEXT = 3 ROW_TOO_SHORT = 4 WRONG_INLINE_NUMBER = 5
IMPORTING Parameters details for TEXT_FOR_OPERATION
FLG_EDIT - Indicator: editor is to be accessed
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJECT - Text object for SAPscript word processing
Data type: THEAD-TDOBJECTOptional: No
Call by Reference: No ( called with pass by value option)
SHOW_FLAG - Indicator: only display in editor
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SPALTEN - Line length in editor
Data type: THEAD-TDLINESIZEOptional: No
Call by Reference: No ( called with pass by value option)
TEXTTITLE - Title for SAPscript word processing
Data type: TTXIT-TDTEXTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VLSCH - Key of the standard text
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VLSCH_FLAG - Indicator: standard text key changed
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CONTROL_IMP -
Data type: ITCEDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DONT_SEND_POPUP_IMP -
Data type: XCHARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FLG_LTEXT_INLINE -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
AUTYP - Order Category
Data type: CAUFV-AUTYPOptional: Yes
Call by Reference: Yes
ID - Text ID for SAPscript word process
Data type: THEAD-TDIDOptional: No
Call by Reference: No ( called with pass by value option)
INLINE_NUMBER - Number of inline lines to be edited
Data type: THEAD-TDTXTLINESDefault: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language key
Data type: T002-SPRASDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
LINELENGTH - Overlapping length inline with line width
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
LTSCH - Long text key (old)
Data type: THEAD-TDNAMEOptional: No
Call by Reference: No ( called with pass by value option)
LTSCH_NEU - New long text key
Data type: THEAD-TDNAMEOptional: No
Call by Reference: No ( called with pass by value option)
LTXT1 - First inline
Data type: PLPO-LTXA1Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LTXT2 - Second inline line
Data type: PLPO-LTXA1Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for TEXT_FOR_OPERATION
ACTION - Editor action (changed, deleted, ...)
Data type: TTXCT-FUNCTIONOptional: No
Call by Reference: No ( called with pass by value option)
LTSCH_OUT - New long text key
Data type: THEAD-TDNAMEOptional: No
Call by Reference: No ( called with pass by value option)
LTXT1_OUT - Updated first inline line
Data type: PLPO-LTXA1Optional: No
Call by Reference: No ( called with pass by value option)
LTXT2_OUT - Updated second inline line
Data type: PLPO-LTXA1Optional: No
Call by Reference: No ( called with pass by value option)
RESULT -
Data type: ITCEROptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
KEINE_VORLAGE - No reference found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
KEIN_EINTRAG - No entry for object/ID in TXID
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
KEIN_LANGTEXT - No long text found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ROW_TOO_SHORT - Column spec./line length not permitted
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_INLINE_NUMBER - Invalid number of inline lines
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for TEXT_FOR_OPERATION 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_action | TYPE TTXCT-FUNCTION, " | |||
| lv_flg_edit | TYPE TTXCT, " 'X' | |||
| lv_keine_vorlage | TYPE TTXCT, " | |||
| lv_object | TYPE THEAD-TDOBJECT, " | |||
| lv_show_flag | TYPE THEAD, " SPACE | |||
| lv_spalten | TYPE THEAD-TDLINESIZE, " | |||
| lv_texttitle | TYPE TTXIT-TDTEXT, " SPACE | |||
| lv_vlsch | TYPE TTXIT, " SPACE | |||
| lv_vlsch_flag | TYPE TTXIT, " SPACE | |||
| lv_control_imp | TYPE ITCED, " SPACE | |||
| lv_dont_send_popup_imp | TYPE XCHAR, " SPACE | |||
| lv_i_flg_ltext_inline | TYPE XCHAR, " SPACE | |||
| lv_autyp | TYPE CAUFV-AUTYP, " | |||
| lv_id | TYPE THEAD-TDID, " | |||
| lv_ltsch_out | TYPE THEAD-TDNAME, " | |||
| lv_kein_eintrag | TYPE THEAD, " | |||
| lv_ltxt1_out | TYPE PLPO-LTXA1, " | |||
| lv_inline_number | TYPE THEAD-TDTXTLINES, " '1' | |||
| lv_kein_langtext | TYPE THEAD, " | |||
| lv_language | TYPE T002-SPRAS, " SY-LANGU | |||
| lv_ltxt2_out | TYPE PLPO-LTXA1, " | |||
| lv_row_too_short | TYPE PLPO, " | |||
| lv_result | TYPE ITCER, " | |||
| lv_linelength | TYPE ITCER, " 0 | |||
| lv_wrong_inline_number | TYPE ITCER, " | |||
| lv_ltsch | TYPE THEAD-TDNAME, " | |||
| lv_ltsch_neu | TYPE THEAD-TDNAME, " | |||
| lv_ltxt1 | TYPE PLPO-LTXA1, " SPACE | |||
| lv_ltxt2 | TYPE PLPO-LTXA1. " SPACE |
|   CALL FUNCTION 'TEXT_FOR_OPERATION' "Text editing for routing and BOM items |
| EXPORTING | ||
| FLG_EDIT | = lv_flg_edit | |
| OBJECT | = lv_object | |
| SHOW_FLAG | = lv_show_flag | |
| SPALTEN | = lv_spalten | |
| TEXTTITLE | = lv_texttitle | |
| VLSCH | = lv_vlsch | |
| VLSCH_FLAG | = lv_vlsch_flag | |
| CONTROL_IMP | = lv_control_imp | |
| DONT_SEND_POPUP_IMP | = lv_dont_send_popup_imp | |
| I_FLG_LTEXT_INLINE | = lv_i_flg_ltext_inline | |
| AUTYP | = lv_autyp | |
| ID | = lv_id | |
| INLINE_NUMBER | = lv_inline_number | |
| LANGUAGE | = lv_language | |
| LINELENGTH | = lv_linelength | |
| LTSCH | = lv_ltsch | |
| LTSCH_NEU | = lv_ltsch_neu | |
| LTXT1 | = lv_ltxt1 | |
| LTXT2 | = lv_ltxt2 | |
| IMPORTING | ||
| ACTION | = lv_action | |
| LTSCH_OUT | = lv_ltsch_out | |
| LTXT1_OUT | = lv_ltxt1_out | |
| LTXT2_OUT | = lv_ltxt2_out | |
| RESULT | = lv_result | |
| EXCEPTIONS | ||
| KEINE_VORLAGE = 1 | ||
| KEIN_EINTRAG = 2 | ||
| KEIN_LANGTEXT = 3 | ||
| ROW_TOO_SHORT = 4 | ||
| WRONG_INLINE_NUMBER = 5 | ||
| . " TEXT_FOR_OPERATION | ||
ABAP code using 7.40 inline data declarations to call FM TEXT_FOR_OPERATION
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 FUNCTION FROM TTXCT INTO @DATA(ld_action). | ||||
| DATA(ld_flg_edit) | = 'X'. | |||
| "SELECT single TDOBJECT FROM THEAD INTO @DATA(ld_object). | ||||
| DATA(ld_show_flag) | = ' '. | |||
| "SELECT single TDLINESIZE FROM THEAD INTO @DATA(ld_spalten). | ||||
| "SELECT single TDTEXT FROM TTXIT INTO @DATA(ld_texttitle). | ||||
| DATA(ld_texttitle) | = ' '. | |||
| DATA(ld_vlsch) | = ' '. | |||
| DATA(ld_vlsch_flag) | = ' '. | |||
| DATA(ld_control_imp) | = ' '. | |||
| DATA(ld_dont_send_popup_imp) | = ' '. | |||
| DATA(ld_i_flg_ltext_inline) | = ' '. | |||
| "SELECT single AUTYP FROM CAUFV INTO @DATA(ld_autyp). | ||||
| "SELECT single TDID FROM THEAD INTO @DATA(ld_id). | ||||
| "SELECT single TDNAME FROM THEAD INTO @DATA(ld_ltsch_out). | ||||
| "SELECT single LTXA1 FROM PLPO INTO @DATA(ld_ltxt1_out). | ||||
| "SELECT single TDTXTLINES FROM THEAD INTO @DATA(ld_inline_number). | ||||
| DATA(ld_inline_number) | = '1'. | |||
| "SELECT single SPRAS FROM T002 INTO @DATA(ld_language). | ||||
| DATA(ld_language) | = SY-LANGU. | |||
| "SELECT single LTXA1 FROM PLPO INTO @DATA(ld_ltxt2_out). | ||||
| "SELECT single TDNAME FROM THEAD INTO @DATA(ld_ltsch). | ||||
| "SELECT single TDNAME FROM THEAD INTO @DATA(ld_ltsch_neu). | ||||
| "SELECT single LTXA1 FROM PLPO INTO @DATA(ld_ltxt1). | ||||
| DATA(ld_ltxt1) | = ' '. | |||
| "SELECT single LTXA1 FROM PLPO INTO @DATA(ld_ltxt2). | ||||
| DATA(ld_ltxt2) | = ' '. | |||
Search for further information about these or an SAP related objects