Show TOC

TEXT_CONTROL_REPLACELocate this document in the navigation structure

Use

The command lines IF, ELSE, ELSEIF, ENDIF, CASE, WHEN, OTHERS, ENDCASE in the transferred text table LINES are interpreted and the resulting text replaced in the table.

Function call:

CALL FUNCTION 'TEXT_CONTROL_REPLACE'
        EXPORTING
                HEADER          = ?...
                PROGRAM         = SPACE
                REPLACE_COMMENT = 'X'
        IMPORTING
                NEWHEADER       = 
                CHANGED         = 
        TABLES
                LINES           = ?...
            

Export parameters:

HEADER

The parameter contains the header of the text module whose control statements you want the system to interpret.

Structure: THEAD

PROGRAM

When interpreting control statements, SAPscript must determine the values of program symbols. To do this, it must know which active program contains the work areas for the values to be passed.

If you omit the parameter, the system searches for the field values in the program that was called first (SY-CPROG).

If you enter a program name, the system replaces the program symbols with the values from this program. This applies only for the current call of the function module.

Reference field: SY-REPID

Default value: SPACE

REPLACE_COMMENT

This parameter can be used to define whether comment lines in the text lines should be removed.

Possible values:

  • 'X' Remove comment lines

  • ' ' keep comment lines

Default value: 'X'

Import parameter:

NEWHEADER

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

Structure: THEAD

CHANGED

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

Possible values:

  • 'X' statements interpreted

  • ' ' no statements found

Table parameters:

LINES

The table contains the text lines in which to resolve the SAPscript statements.

Structure: TLINE