Show TOC

TEXT_SYMBOL_REPLACELocate this document in the navigation structure

Use

The function module replaces the symbols contained in the text lines with their respective values. The text is not formatted for printing, but the symbols are replaced in the ITF format. Symbols that occur on comment or raw lines remain unchanged, as well as symbols enclosed by the character formats <(> and <)>.

The system interprets DEFINE statements in text lines and changes the values of text symbols accordingly. It also executes the control statements SET DATE MASK, SET TIME MASK, SET SIGN LEFT, and SET SIGN RIGHT.

Function call:

CALL FUNCTION 'TEXT_SYMBOL_REPLACE'
        EXPORTING
                ENDLINE         = 99999
                HEADER          =
                INIT            = ' '
                OPTION_DIALOG   = ' '
                PROGRAM         = SPACE
                REPLACE_PROGRAM = 'X'
                REPLACE_STANDARD = 'X'
                REPLACE_SYSTEM  = 'X'
                REPLACE_TEXT    = 'X'
                STARTLINE       = 1
        IMPORTING
                CHANGED         =
                NEWHEADER       =
        TABLES
                LINES           =
            

Export parameters:

ENDLINE

Here you can specify the index of the last text line on which you want to use the required function. If no value or an invalid value is specified, the last line of the text table is generally used.

Reference field: SY-TABIX

Default value: 99999

HEADER

Enter the index of the last text line on which to execute the function module.

Structure: THEAD

INIT

Use INIT to specify whether you want to initialize the symbol administration of SAPscript before replacing.

Possible values:

  • 'X' Initialize

  • ' ' do not initialize

Default value: ' '

OPTION_DIALOG

The parameter determines whether to display a dialog box before replacing, where the user can select the symbol types to be replaced.

Possible values:

  • 'X' Display dialog box

  • ' ' do not display dialog box

Default value: ' '

PROGRAM

Use this parameter to determine the program whose work areas the system uses to replace the values of the program symbols. If you omit this parameter, the system uses the first program called to search for the field values (SY-CPROG). This applies only for the current call of the function module.

Reference field: SY-REPID

Default value: SPACE

REPLACE_PROGRAM

This parameter can be used to define whether program symbols should be expanded during replacement.

Possible values:

  • 'X' Replace program symbols

  • ' ' do not replace program symbols

Default value: 'X'

REPLACE_STANDARD

This parameter can be used to define whether standard symbols should be expanded during replacement.

Possible values:

  • 'X' Replace standard symbols

  • ' ' do not replace standard symbols

Default value: 'X'

REPLACE_SYSTEM

This parameter can be used to define whether system symbols should be expanded during replacement. The system symbols &PAGE& and &NEXTPAGE& are not replaced, since the text is not formatted for printing.

Possible values:

  • 'X' Replace system symbols

  • ' ' do not replace system symbols

Default value: 'X'

REPLACE_TEXT

This parameter can be used to define whether text symbols should be expanded during replacement.

Possible values:

  • 'X' Replace text symbols

  • ' ' do not replace text symbols

Default value: 'X'

STARTLINE

Here you can specify the index of the table line from which the required function is to be effective. If no value or an invalid value is specified, the first line of the text table is used.

Reference field: SY-TABIX

Default value: 1

Import parameter:

CHANGED

The parameter indicates whether the symbols were replaced with their respective values, thus changing the contents of the text table.

Possible values:

  • 'X' symbols replaced

  • ' ' symbols not replaced

NEWHEADER

The parameter returns the text header with the fields changed according to the executed actions.

Structure: THEAD

Table parameters:

LINES

The table contains the text lines, in which to replace the SAPscript symbols.

Structure: TLINE