Show TOC

COPY_TEXTSLocate this document in the navigation structure

Use

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

The function COPY_TEXTS requires the text keys of the texts to be copied and 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 text key for target text in header

  3. Save text module under the new name using SAVE_TEXT.

Function call:

CALL FUNCTION 'COPY_TEXTS'
        EXPORTING SAVEMODE_DIRECT = ' '
                INSERT          = ' '
        IMPORTING ERROR         = 
                TABLES TEXTS    = ?...
            

Export parameters:

SAVEMODE_DIRECT

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:

  • ' ' Save mode according to text object

  • 'X' Save text module immediately

  • Default value: SPACE

INSERT

This parameter indicates that the text module is new. Normally SAPscript reads the text file to check whether the text module is new. If this is already known in the calling program, the test read can be suppressed by the parameter and the performance therefore improved.

Possible values:

  • ' ' Determine update mode automatically

  • 'X' Text is new

  • Default value: SPACE

Import parameter:

ERROR

This parameter indicates whether an error occurred during copying.

Possible values:

  • ' ' No error

  • 'X' Error copying

This error flag only indicates that an error occurred copying a text. Further information can be obtained from the field SUBRC in table TEXTS.

Table parameters:

TEXTS

This table contains the texts to be copied.

A copy function can be called per table line. The complete text key of the source text and target text must be specified. Generic entries 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 was copied

  • 01 Invalid ID of target text

  • 02 Invalid characters in target text name

  • 03 Invalid object for target text

  • 04 Invalid save mode for target text

  • 05 Error reading source text header

  • 06 Error reading target text header

  • 07 Error writing target text header

  • 08 Error copying text lines

Structure: ITCTC