Start of Content Area

INIT_TEXT   Locate the document in its SAP Library structure

For each text module you want to process using SAPscript, you must provide two work areas from within the application program: one for the text header and one for the lines table. You must initialize these work areas whenever you create a new text or the system terminated a function module READ_TEXT or READ_TEXT_INLINE with an exception.

You can reuse the work areas if the previously edited text is stored or if you no longer need it.

You must fully specify the text module in the fields OBJECT, NAME, ID, and LANGUAGE. Generic entries are not allowed.

After calling INIT_TEXT, the header contains initial values and the lines table is empty.

 

Function call:

 

CALL FUNCTION 'INIT_TEXT'

EXPORTING ID = ?...

LANGUAGE = ?...

NAME = ?...

OBJECT = ?...

IMPORTING HEADER =

TABLES LINES = ?...

EXCEPTIONS ID =

LANGUAGE =

NAME =

OBJECT =

 

Export parameters:

OBJECT

Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.

Reference field: THEAD-TDOBJECT

NAME

Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.

Reference field: THEAD-TDNAME

ID

Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.

Reference field: THEAD-TDID

LANGUAGE

Enter the language key of the text module. The system accepts only languages that are defined in table T002.

Reference field: THEAD-TDSPRAS

 

Import parameters:

HEADER

This parameter returns the initialized text header.

Structure: THEAD

 

Table parameters:

LINES

All lines of the specified text lines table are deleted.

Structure: TLINE

 

Exceptions:

ID

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.

LANGUAGE

The parameter LANGUAGE contains a language key that is not defined in table T002.

NAME

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

Possible errors:

  • Field contains only blanks
  • Field contains the invalid characters '*' or '.'

OBJECT

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