Start of Content Area

 SAVE_TEXT   Locate the document in its SAP Library structure

SAVE_TEXT writes a text module back to the text file or the text memory, depending on the storage mode of the corresponding text object.

You can use this module either to change existing texts or to create new texts. If you know for sure that the text is new, use the parameter INSERT to indicate this. The system then does not have to read the text first, which improves the performance of the function module.

If the lines table passed with the function module is empty, the system deletes the text from the text file.


Function call:




                 HEADER          = ?...

                 INSERT          = SPACE

                 SAVEMODE_DIRECT = SPACE

                 OWNER_SPECIFIED = SPACE

     IMPORTING   FUNCTION        =

                 NEWHEADER       =

     TABLES      LINES           = ?...

     EXCEPTIONS  ID              =

                 LANGUAGE        =

                 NAME            =

                 OBJECT          =


Export parameters:



Specify the client under which to store the text. If you omit this parameter, the system uses the current client as default.

Reference field:  SY-MANDT

Default value:     SY-MANDT


Enter the structure that contains the text header of the text you want to save.

Structure:    THEAD


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



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



When creating a new text, the parameter indicates whether the creation information in the text header is filled in automatically by SAPscript, or whether to use the data passed in the header. The parameter concerns the fields TDFUSER, TDFDATE, TDFTIME, and TDFRELES in the text header.

Possible values:

'  '         Information taken from SAPscript

'X'   Information taken from header

If you use this parameter, but one of the required fields is initial, this field is filled by SAPscript.

You use this parameter if you use a program to insert text under a certain owner or a certain release information, which do not correspond to the current environment (for example, a migration program for transferring texts from the R/2 system to SAPscript).

Default value:     SPACE


Import parameters:



The parameter returns the processing status of the text module for the current call.

Possible values:

'  '         no action

'I'          text module was created

'U'   text module was modified

'D'   text module was deleted





Table parameters:



The table contains the text lines of the text to be saved.

Structure:    TLINE





The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.


The parameter LANGUAGE contains a language key that does not exist in table T002.


The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.

Possible errors:

         The field contains only blanks.

         The field contains the invalid characters ‘*’ or ‘,’.



The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.






End of Content Area