Start of Content Area

TEXT_CONTROL_REPLACE   Locate the document in its SAP Library structure

The system interprets the statement lines IF, ELSE, ELSEIF, ENDIF, CASE, WHEN, OTHERS, ENDCASE in the transferred text table LINES and returns the resulting text into 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

Use this parameter to determine whether to delete any comment lines from the text lines.

Possible values:

'X' delete comment lines

' ' keep comment lines

Default value: 'X'

 

Import parameters:

NEWHEADER

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

Structure: THEAD

CHANGED

The parameter indicates whether the system interpreted control statements and thus changed the contents of the text table.

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