Show TOC

CONVERT_OTF_MEMORYLocate this document in the navigation structure

Use

The parameter DEVICE=OTF_MEM with the function OPEN_FORM allows SAPscript word processing to be output to a buffer instead of creating a spool request, for example. In this case, the text is formatted internally for the pseudo device SCREEN and the result stored in the buffer.

The buffer is read with the function module CONVERT_OTF_MEMORY and returned using table parameter LINES. The format of the text in this table is determined by the parameter FORMAT. The maximum line width used in the field LINES-TDLINE in the table LINES is controlled by the parameter MAX_LINEWIDTH.

The only value supported at present for the FORMAT parameter is 'ASCII'.

In the case of the ASCII format, the LINES table contains the text to be output (without any control characters) in the field LINES-TDLINE, adjusted to the specified maximum line width. The field LINES-TDFORMAT contains the indicator for a SAPscript extended line with a line break (/=) when a new line is be started. Lines which only contain the extended line tag (=) in this field are continuations of the previous line. Line breaks are not shown in the ASCII format.

The text returned for the ASCII format can be regarded as a SAPscript text if the field LINES-TDFORMAT is interpreted as a SAPscript tag column. The text can also be regarded as a "RAW text" if the field LINES-TDFORMAT is ignored and each line of the table LINES (field LINES-TDLINE) interpreted as a text line.

Function call:

CALL FUNCTION 'CONVERT_OTF_MEMORY'
EXPORTING FORMAT = 'ASCII'
MAX_LINEWIDTH = 132
IMPORTING BIN_FILESIZE = 
TABLES LINES = ?...
EXCEPTIONS MEMORY_EMPTY =
ERR_MAX_LINEWIDTH =
ERR_FORMAT =
ERR_CONV_NOT_POSSIBLE =
            

Export parameters:

FORMAT

Defines the format into which the SAPscript OTF output is to be converted. It is currently only possible to convert to ASCII format.

Default value: 'ASCII'

MAX_LINEWIDTH

Enter the maximum line width a converted text line may have in table LINES.

The maximum line width must be between 2 and 132.

Default value: 132

Import parameter:

BIN_FILESIZE

For binary format: Number of bytes in LINES

Table parameters:

LINES

The table returns the converted text lines.

Structure: TLINE

Exceptions:

MEMORY_EMPTY

The memory was empty.

Possible causes:

  • During formatting, an error occurred and the memory was not filled.

  • When reading the memory, an error occurred.

ERR_MAX_LINEWIDTH

The line width specified in parameter MAX_LINEWIDTH is not between 2 and 132.

ERR_FORMAT

The parameter FORMAT contains a target format into which SAPscript cannot convert the OTF output.

ERR_CONV_NOT_POSSIBLE

During conversion of the text from SAPscript OTF format into the specified target format, an error occurred. The conversion process is canceled.