Show TOC

EDIT_TEXTLocate this document in the navigation structure

Use

This function module calls the fullscreen editor. The text lines can be edited with the functions provided by this tool. The editor interface is set based on the interface assigned to the text object.

Usually leaving the editor with the function Save or Note of the function module SAVE_TEXT is called implicitly as long as the text is saved corresponding to the text object set in the text file. You can disable this call using parameter SAVE.

If the field TDFORMAT in the text header contains SPACE, the system calls the SAPscript Editor. Otherwise, it calls the function module EDIT_TEXT_FORMAT_xxx where xxx is the contents of the field TDFORMAT. This function module then calls the editor required for the specified text format. Which of the parameters passed with EDIT_TEXT the system evaluates, depends on this interface module and the called word processing program.

Function call:

Function call:
CALL FUNCTION 'EDIT_TEXT'
EXPORTING
        DISPLAY         = SPACE
        EDITOR_TITLE    = SPACE
        HEADER          =
        SAVE            = 'X'
        CONTROL         = SPACE
        PROGRAM         = SPACE
IMPORTING
        NEWHEADER       =
        FUNCTION        =
        RESULT          =
TABLES
        LINES           =
EXCEPTIONS
        ID              =
        LANGUAGE        =
        LINESIZE        =
        NAME            =
        OBJECT          =
        TEXTFORMAT      =
        COMMUNICATION   =
            

Export Parameter

Export Parameter

DISPLAY

This parameter determines whether the text editor is called in display mode or change mode. In display mode, the user cannot edit the text.

Possible values:

  • 'X' display mode

  • ' ' Change Mode

Default value: SPACE

EDITOR_TITLE

The title specified is displayed in the title bar of the text editor window, in addition to other headings generated by SAPscript. Thus you can set any title text in the editor. You can use this to display difficult technical text names in the title bar in decrypted form.

Reference field: TTXIT-TDTEXT

Default value: SPACE

HEADER

Enter the structure that contains the text header of the text to be edited.

Structure: THEAD

CONTROL

Use the parameter CONTROL to set certain attributes of the SAPscript Editor. The attributes are described in the fields of the structure ITCED.

Structure: ITCED

Default value: SPACE

SAVE

Use this parameter to determine whether the system calls SAVE_TEXT after saving the text in the editor. If you want to suppress this call, the application program must lateron call the function module SAVE_TEXT itself. In both cases, the changed text lines are returned to the application program.

Possible values:

  • 'X' call SAVE_TEXT

  • ' ' suppress SAVE_TEXT

Default value: 'X'

PROGRAM

Use this parameter to determine the program whose work areas the system uses to replace the values of the program symbols. If you omit this parameter, the system uses the first program called to search for the field values (SY-CPROG).

Reference field: SY-REPID

Default value: SPACE

Import Parameter

Import Parameter

NEWHEADER

Return parameter for the text header. Due to certain operations in the editor, also fields in the text header are changed.

Structure: THEAD

FUNCTION

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

Possible values:

  • ' ' no action

  • 'I' Text module was inserted

  • 'U' Text module was updated

  • 'D' Text module was deleted

RESULT

The SAPscript editor returns status information to the calling program via this parameter. This information is described by the fields of the structure ITCER.

Structure: ITCER

Table parameters

LINES

Contains the table with the lines of the text module.

Structure: TLINE

Exceptions

ID

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

LANGUAGE

In the field TDSPRAS of the header a language key is specified which is not defined in table T002.

LINESIZE

The field TDLINESIZE of the text header contains a line width less than 0 or greater than 132.

NAME

In field TDNAME of the text header the name of a text module is transferred which does not correspond to the SAPscript conventions.

Possible errors:

  • Field contains only blanks

  • Field contains the invalid characters '*' or ','.

OBJECT

The field TDOBJECT in the text header contains the name of a text object, which is not defined in table TTXOB.

TEXTFORMAT

The text lines passed to the function module are available in a format which cannot be processed in the current environment. The format is stored in the text header in the field TDTEXTTYPE.

Possible reasons for this exception can be:

  • The text format is not supported.

  • The text format cannot be processed on the current frontend since the word processor required is not installed.

  • The text format cannot be processed under batch input conditions since the word processing program involved does not have batch input capability.

  • The text format cannot be processed in the background since the word processing program involved cannot be initiated from background processes.

  • etc.

COMMUNICATION

The field TDTEXTTYPE of the text header is not empty, that is, it contains a text format which requires an external word processing program to be called. An error occurred when this word processor was called.

Possible causes:

  • The external word processor is not installed or is incorrectly installed on the frontend.

  • The word processor could not be started.

  • An error occurred during communication with the word processor.

  • An error occurred during transmission of the text data.

  • etc.

When processing texts in a non-SAPscript format, the system internally calls the function modules EDIT_TEXT_FORMAT_xxx or PRINT_TEXT_FORMAT_xxx, where xxx is the contents of field TDTEXTTYPE.

These function modules ended with the exception COMMUNICATION. SAPscript passes this message to the print program without any further analysis.