Start of Content Area

CONVERT_OTF_MEMORY   Locate the document in its SAP Library structure

If you use the function module OPEN_FORM with the parameter DEVICE=OTF_MEM, the system outputs the SAPscript text into a buffer instead of creating a spool request. The system then formats the text internally for the pseudo device SCREEN and stores the result in the buffer.

To read the buffer, use function module CONVERT_OTF_MEMORY, which returns the contents in the table parameter LINES. The parameter FORMAT determines the format of the text in this table. The maximum line width used in the table in the field LINES-TDLINE is controlled by the parameter MAX_LINEWIDTH.

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

With format ASCII, the table LINES contains in the field LINES-TDLINE the text to be output (without any control characters), formatted according to the specified maximum line width. The field LINES-TDFORMAT contains the flag for a SAPscript long line with line feed (/=), if you want to indicate the beginning of the line. Lines that contain only the long line flag (=) in this field, are continuation lines of the previous line. In the ASCII format, page breaks are not indicated.

You can use the text returned with format ASCII as SAPscript text by interpreting the field LINES-TDFORMAT as SAPscript format column. Or, you can use the text as RAW text by ignoring the field LINES-TDFORMAT and interpreting each line of the table LINES (field LINES-TDLINE) as one 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

Define the format into which you want to convert the SAPscript OTF output. At present, you can use only the 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 parameters:

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 reasons:

  • 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.