Show TOC

EXPORT_TEXTLocate this document in the navigation structure

Use

The function module EXPORT_TEXT converts an ITF text to the required format FORMAT_TYPE and then stores it in a local file. The following conversions are available:

  • ITF text in table Start of the navigation path ITF_LINES Next navigation step Local ITF file FILE End of the navigation path

  • ITF text in table Start of the navigation path ITF_LINES Next navigation step Local RTF file FILE End of the navigation path

  • ITF text in table Start of the navigation path ITF_LINES Next navigation step Local ASCII file FILE End of the navigation path

When exporting the formats ASCII and RTF, the system resolves text includes and control structures (/: IF, /: ELSE, /: ENDIF, /: CASE, /: WHEN, /: ENDCASE) and replaces text, standard, and system symbols.

You must enter the following specifications:

You must enter the following specifications:

FORMAT_TYPE = 'ITF'

As the resulting file is preceded by header information (for more information on the form of the resulting file, see the documentation on report RSTXSITF), the parameter HEADER should be filled.

The parameters FORMATWIDTH, CODEPAGE, SSHEET, and WITH_TAB are not effective.

FORMAT_TYPE = 'RTF'

As the resulting file is preceded by information on author, creation date etc., the parameter HEADER should be filled. In any case, you must specify style and form of the text (HEADER-TDSTYLE and HEADER-TDFORM).

The line width of the resulting text can be set in FORMATWIDTH. The character set numbers from the spool administration must be specified in CODEPAGE. The character sets 1103, 1110, or 1133 can be specified for the RTF conversion. All other specifications are ignored; the character set 1133 is used instead. If the RTF text created is to be read by WinWord, character set 1133 is recommended. SSHEET and WITH_TAB are explained below.

FORMAT_TYPE = 'ASCII'

All ITF information is lost in this conversion; in principle the only formatting is New line and Tab. Some page formatting is possible by selecting a line width FORMATWIDTH. The ITF text can be converted to an ASCII file with any character set CODEPAGE (number from the spool administration).

In short, you must specify FORMAT_TYPE; the only import parameters for which entries are useful, are CODEPAGE and FORMATWIDTH.

Format conversion

Format conversion If the parameter WITH_TAB = 'X' is set, format conversion is initiated if FORMAT_TYPE = 'RTF'. In transaction SE74 (format conversion) the paragraph and character markers which are to be assigned to other Word styles must be specified beforehand.

The following are converted:

HEADER-TDSTYLE

or

i

HEADER-TDFORM

n

SSHEET

Function call:

Function call:
CALL FUNCTION 'EXPORT_TEXT'
        EXPORTING
                CODEPAGE        = SPACE
                FILE            = ?...
                FORMATWIDTH     = 72
                FORMAT_TYPE     = 'RTF'
                HEADER          = SPACE
                SSHEET          = SPACE
                WITH_TAB        = SPACE
                TAB_SUBSTITUTE  = 'X09'
        TABLES
                ITF_LINES       = ?... 
        EXCEPTIONS
                DOWNLOAD_ERROR  =
                FILE_OPEN_ERROR =
                FILE_WRITE_ERROR =
            

Export parameters:

Export parameters:

CODEPAGE

Enter the character set numbers from the spool administration.

Reference field: TCP02-CPCODEPAGE

Default value: SPACE

FILE

Name of the file which is to be created on the presentation server (with prefixed path name if required). If the path is not available or the file can not be opened to write, the corresponding exceptions are set.

Reference field: RLGRAP-FILENAME

FORMATWIDTH

Line width of target file.

Default value: 72

FORMAT_TYPE

Format of target file ('ITF', 'RTF' oder 'ASCII')

Default value: 'RTF'

HEADER

Text header of the source text.

The text header contains a description of a text module, such as short text, creator, and so on.

Structure: THEAD

SSHEET

Name of a document template (*.dfv or *.dot).

If a format conversion is to be effective, the symbolic name for which a conversion with the relevant SAPscript style or layout set was maintained in the transaction "Format conversion" (SE74) must be specified here.

In addition, you must set the WITH_TAB paramenter to 'X'.

Default value: SPACE

WITH_TAB

Possible entries are 'X' (Yes) or ' ' (No).

If WITH_TAB = 'X' is set, and the parameter SSHEET is also maintained, a conversion of paragraph and character formats is performed. Source and target formats can be a SAPscript style, a SAPscript form, or an MS Word template. Transaction SE74 (format conversion) should be used to specify the assignment between the respective paragraph and character markers and/or Word styles.

Default value: SPACE

TAB_SUBSTITUTE

Substitution value for the SAPscript tab.

This parameter is only effective for a conversion from ITF to ASCII. You define the substitution value in a character field of length 5. The first character indicates the type of replacement:

'C' initiates the replacement by a character string with a maximum length of 4.

Example

TAB_SUBSTITUTE = 'C<<>>'

"before tab <<>>after tab " in the ASCII file.

'X' substitutes the tab with one or two binary characters.

Example

TAB_SUBSTITUTE = 'X09_ _'.

The SAPscript tabulator ",," is replaced by the hex value 09.

'_' A blank substitutes the tab with 1 to 99 blanks.

Example

TAB_SUBSTITUTE = '_ 8_ _ _'.

"before tab,,after tab " in SAPscript becomes "before tab_ _ _ _ _ _ _ _after tab " in the ASCII file.

Default value: 'X09_ _'

Table parameters:

Table parameters:

ITF_LINES

SAPscript text table you want to export.

Structure: TLINE

Exceptions:

Exceptions:

FILE_OPEN_ERROR

File cannot be opened

FILE_WRITE_ERROR

File cannot be opened.

DOWNLOAD_ERROR

Other errors when downloading file.