SAP TEXT_SYMBOL_REPLACE Function Module for SAPscript: Replace symbols with value
TEXT_SYMBOL_REPLACE is a standard text symbol replace 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: Replace symbols with value 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 symbol replace FM, simply by entering the name TEXT_SYMBOL_REPLACE into the relevant SAP transaction such as SE37 or SE38.
Function Group: STXE
Program Name: SAPLSTXE
Main Program: SAPLSTXE
Appliation area:
Release date: 16-Jan-1995
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TEXT_SYMBOL_REPLACE 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_SYMBOL_REPLACE'"SAPscript: Replace symbols with value.
EXPORTING
* ENDLINE = 99999 "End line for symbol replacement
* STARTLINE = 1 "Initial line for symbol replacement
HEADER = "Text header
* INIT = ' ' "Initialization of symbol admin.
* OPTION_DIALOG = ' ' "Execute dialog
* PROGRAM = ' ' "Program name for program symbol replacement
* REPLACE_PROGRAM = 'X' "Replace program symbols
* REPLACE_STANDARD = 'X' "Replace standard symbols
* REPLACE_SYSTEM = 'X' "Replace system symbols
* REPLACE_TEXT = 'X' "Replace text symbols
IMPORTING
CHANGED = "Symbols were replaced
NEWHEADER = "Text header (new)
TABLES
LINES = "Text lines
IMPORTING Parameters details for TEXT_SYMBOL_REPLACE
ENDLINE - End line for symbol replacement
Data type: SY-TABIXDefault: 99999
Optional: Yes
Call by Reference: No ( called with pass by value option)
STARTLINE - Initial line for symbol replacement
Data type: SY-TABIXDefault: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
HEADER - Text header
Data type: THEADOptional: No
Call by Reference: No ( called with pass by value option)
INIT - Initialization of symbol admin.
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
OPTION_DIALOG - Execute dialog
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
PROGRAM - Program name for program symbol replacement
Data type: SYST-REPIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
REPLACE_PROGRAM - Replace program symbols
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
REPLACE_STANDARD - Replace standard symbols
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
REPLACE_SYSTEM - Replace system symbols
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
REPLACE_TEXT - Replace text symbols
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for TEXT_SYMBOL_REPLACE
CHANGED - Symbols were replaced
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NEWHEADER - Text header (new)
Data type: THEADOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for TEXT_SYMBOL_REPLACE
LINES - Text lines
Data type: TLINEOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for TEXT_SYMBOL_REPLACE 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: | ||||
| lt_lines | TYPE STANDARD TABLE OF TLINE, " | |||
| lv_changed | TYPE TLINE, " | |||
| lv_endline | TYPE SY-TABIX, " 99999 | |||
| lv_startline | TYPE SY-TABIX, " 1 | |||
| lv_header | TYPE THEAD, " | |||
| lv_newheader | TYPE THEAD, " | |||
| lv_init | TYPE THEAD, " ' ' | |||
| lv_option_dialog | TYPE THEAD, " ' ' | |||
| lv_program | TYPE SYST-REPID, " SPACE | |||
| lv_replace_program | TYPE SYST, " 'X' | |||
| lv_replace_standard | TYPE SYST, " 'X' | |||
| lv_replace_system | TYPE SYST, " 'X' | |||
| lv_replace_text | TYPE SYST. " 'X' |
|   CALL FUNCTION 'TEXT_SYMBOL_REPLACE' "SAPscript: Replace symbols with value |
| EXPORTING | ||
| ENDLINE | = lv_endline | |
| STARTLINE | = lv_startline | |
| HEADER | = lv_header | |
| INIT | = lv_init | |
| OPTION_DIALOG | = lv_option_dialog | |
| PROGRAM | = lv_program | |
| REPLACE_PROGRAM | = lv_replace_program | |
| REPLACE_STANDARD | = lv_replace_standard | |
| REPLACE_SYSTEM | = lv_replace_system | |
| REPLACE_TEXT | = lv_replace_text | |
| IMPORTING | ||
| CHANGED | = lv_changed | |
| NEWHEADER | = lv_newheader | |
| TABLES | ||
| LINES | = lt_lines | |
| . " TEXT_SYMBOL_REPLACE | ||
ABAP code using 7.40 inline data declarations to call FM TEXT_SYMBOL_REPLACE
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 TABIX FROM SY INTO @DATA(ld_endline). | ||||
| DATA(ld_endline) | = 99999. | |||
| "SELECT single TABIX FROM SY INTO @DATA(ld_startline). | ||||
| DATA(ld_startline) | = 1. | |||
| DATA(ld_init) | = ' '. | |||
| DATA(ld_option_dialog) | = ' '. | |||
| "SELECT single REPID FROM SYST INTO @DATA(ld_program). | ||||
| DATA(ld_program) | = ' '. | |||
| DATA(ld_replace_program) | = 'X'. | |||
| DATA(ld_replace_standard) | = 'X'. | |||
| DATA(ld_replace_system) | = 'X'. | |||
| DATA(ld_replace_text) | = 'X'. | |||
Search for further information about these or an SAP related objects