Start of Content Area

COPY_TEXTS   Locate the document in its SAP Library structure

Use this function module to copy texts. You can copy only texts that exist in the text file.

Apart from the text keys of the texts to be copied, COPY_TEXTS only needs the text keys of the target texts. You use table TEXTS to pass these values to the function module.

The system then copies the texts in blocks without first passing them to the text work areas.

After the function module is finished, you can read the result for each text in the field SUBRC of table TEXTS.

This function works much faster than the following copy procedure:

  1. Read the text you want to copy using READ_TEXT.
  2. Enter target text key in the header.
  3. Save text module under the new name using SAVE_TEXT.


Function call:




INSERT = ' '




Export parameters:


You determine the storage mode of a text module (direct, in update task) via the text object in table TTXOB. However, it may be necessary to replace storage in update task with direct storage of a text (for example, for background processing).

Possible values:

' ' Storage mode according to text object

'X' Save text module directly

Default value: SPACE


This parameter indicates that the text module is new. Usually, SAPscript reads the text file first to check whether the text module exists. If you know that the text is new before the application program calls the function module, use this parameter to prevent the system from this read process and thus improve the performance.

Possible values:

' ' Determine update mode automatically

'X' Text is new

Default value: SPACE


Import parameters:


The parameter indicates whether an error occurred during the copy process.

Possible values:

' ' no error

'X' error in copy process

This error flag only shows that an error occurred during the copy process. For more information, read the field SUBRC in table TEXTS.


Table parameters:


The table contains the texts to be copied.

For each table line, you can call a copy function. You must always specify the entire text keys of source and target texts. Generic values are not allowed.

After finishing the copy process, the field SUBRC contains for each text the return value of the copy process.

Possible values of SUBRC:

00 text copied

01 invalid target text ID

02 invalid characters in the target text name

03 invalid target text object

04 invalid storage mode for target text

05 error when reading source text header

06 error when reading target text header

07 error when writing target text header

08 error when copying text lines


Structure: ITCTC