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

Function TEXT_FOR_HEADER 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_HEADER'"Long text processing for text with inline (ex.: header).
EXPORTING
* ID = ' ' "Text ID for SAPscript word processing
* TEXTTITLE = ' ' "Heading for SAPscript editor
* CONTROL_IMP = ' ' "
* AUTYP = 00 "
KTEXT = "Inline
* LANGUAGE = SY-LANGU "Language key
* LINELENGTH = 0 "Overlap length inline with long text line
LTSCH = "Old long text key
LTSCH_NEU = "New long text key
* OBJECT = 'ROUTING' "Text object type for SAPscript word processing
* SHOW_FLAG = ' ' "Indicator: display only
SPALTEN = "Line length in SAPscript editor
IMPORTING
ACTION = "Editor action (changed, deleted, ...)
KTEXT_OUT = "Inline after text editing
LTSCH_OUT = "Long text key after word processing
RESULT = "
EXCEPTIONS
KEIN_EINTRAG = 1 KEIN_LANGTEXT = 2 ROW_TOO_SHORT = 3
IMPORTING Parameters details for TEXT_FOR_HEADER
ID - Text ID for SAPscript word processing
Data type: THEAD-TDIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEXTTITLE - Heading for SAPscript editor
Data type: TTXIT-TDTEXTDefault: 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)
AUTYP -
Data type: AUFK-AUTYPDefault: 00
Optional: Yes
Call by Reference: Yes
KTEXT - Inline
Data type: PLKO-KTEXTOptional: No
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 - Overlap length inline with long text line
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
LTSCH - Old long text key
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LTSCH_NEU - New long text key
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT - Text object type for SAPscript word processing
Data type: THEAD-TDOBJECTDefault: 'ROUTING'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SHOW_FLAG - Indicator: display only
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SPALTEN - Line length in SAPscript editor
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for TEXT_FOR_HEADER
ACTION - Editor action (changed, deleted, ...)
Data type: TTXCT-FUNCTIONOptional: No
Call by Reference: No ( called with pass by value option)
KTEXT_OUT - Inline after text editing
Data type: PLKO-KTEXTOptional: No
Call by Reference: No ( called with pass by value option)
LTSCH_OUT - Long text key after word processing
Data type:Optional: 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
KEIN_EINTRAG - OBJECT and ID not in table 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 - Line length is smaller than inline/overlay
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for TEXT_FOR_HEADER 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 THEAD-TDID, " SPACE | |||
| lv_action | TYPE TTXCT-FUNCTION, " | |||
| lv_kein_eintrag | TYPE TTXCT, " | |||
| lv_texttitle | TYPE TTXIT-TDTEXT, " SPACE | |||
| lv_control_imp | TYPE ITCED, " SPACE | |||
| lv_autyp | TYPE AUFK-AUTYP, " 00 | |||
| lv_ktext | TYPE PLKO-KTEXT, " | |||
| lv_ktext_out | TYPE PLKO-KTEXT, " | |||
| lv_kein_langtext | TYPE PLKO, " | |||
| lv_language | TYPE T002-SPRAS, " SY-LANGU | |||
| lv_ltsch_out | TYPE T002, " | |||
| lv_row_too_short | TYPE T002, " | |||
| lv_result | TYPE ITCER, " | |||
| lv_linelength | TYPE ITCER, " 0 | |||
| lv_ltsch | TYPE ITCER, " | |||
| lv_ltsch_neu | TYPE ITCER, " | |||
| lv_object | TYPE THEAD-TDOBJECT, " 'ROUTING' | |||
| lv_show_flag | TYPE THEAD, " SPACE | |||
| lv_spalten | TYPE THEAD. " |
|   CALL FUNCTION 'TEXT_FOR_HEADER' "Long text processing for text with inline (ex.: header) |
| EXPORTING | ||
| ID | = lv_id | |
| TEXTTITLE | = lv_texttitle | |
| CONTROL_IMP | = lv_control_imp | |
| AUTYP | = lv_autyp | |
| KTEXT | = lv_ktext | |
| LANGUAGE | = lv_language | |
| LINELENGTH | = lv_linelength | |
| LTSCH | = lv_ltsch | |
| LTSCH_NEU | = lv_ltsch_neu | |
| OBJECT | = lv_object | |
| SHOW_FLAG | = lv_show_flag | |
| SPALTEN | = lv_spalten | |
| IMPORTING | ||
| ACTION | = lv_action | |
| KTEXT_OUT | = lv_ktext_out | |
| LTSCH_OUT | = lv_ltsch_out | |
| RESULT | = lv_result | |
| EXCEPTIONS | ||
| KEIN_EINTRAG = 1 | ||
| KEIN_LANGTEXT = 2 | ||
| ROW_TOO_SHORT = 3 | ||
| . " TEXT_FOR_HEADER | ||
ABAP code using 7.40 inline data declarations to call FM TEXT_FOR_HEADER
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 TDID FROM THEAD INTO @DATA(ld_id). | ||||
| DATA(ld_id) | = ' '. | |||
| "SELECT single FUNCTION FROM TTXCT INTO @DATA(ld_action). | ||||
| "SELECT single TDTEXT FROM TTXIT INTO @DATA(ld_texttitle). | ||||
| DATA(ld_texttitle) | = ' '. | |||
| DATA(ld_control_imp) | = ' '. | |||
| "SELECT single AUTYP FROM AUFK INTO @DATA(ld_autyp). | ||||
| DATA(ld_autyp) | = 00. | |||
| "SELECT single KTEXT FROM PLKO INTO @DATA(ld_ktext). | ||||
| "SELECT single KTEXT FROM PLKO INTO @DATA(ld_ktext_out). | ||||
| "SELECT single SPRAS FROM T002 INTO @DATA(ld_language). | ||||
| DATA(ld_language) | = SY-LANGU. | |||
| "SELECT single TDOBJECT FROM THEAD INTO @DATA(ld_object). | ||||
| DATA(ld_object) | = 'ROUTING'. | |||
| DATA(ld_show_flag) | = ' '. | |||
Search for further information about these or an SAP related objects