Start of Content Area

EXPORT_TEXT   Locate the document in its SAP Library structure

The function module EXPORT_TEXT converts an ITF text into the desired format FORMAT_TYPE and then saves it in a local file:

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:

FORMAT_TYPE = 'ITF'

Since the result file is provided with text header information (for more details on this file type, see documentation of report RSTXSITF), you should fill the parameter HEADER.

The parameters FORMATWIDTH, CODEPAGE, SSHEET, and WITH_TAB have no effect.

FORMAT_TYPE = 'RTF'

Since the result file is provided with information on author, creation date, and so on, you should fill the HEADER parameter. In any case, you must specify style and form of the text (HEADER-TDSTYLE and HEADER-TDFORM).

In FORMATWIDTH, specify the line width of the result text. In CODEPAGE, you must enter the characters set numbers from the spool administration. For RTF conversion, you can choose between the character sets 1103, 1110, or 1133. The system ignores all other assignments and uses the character set 1133 instead. If you want to read the created RTF text using WinWord, we recommend the character set 1133. SSHEET and WITH_TAB are explained in 'Format conversion' below.

FORMAT_TYPE = 'ASCII'

All ITF information is lost with this conversion; the only formats are newline and tab. By choosing the line width FORMATWIDTH accordingly, you can achieve a certain page formatting. You can convert the ITF text into an ASCII text of any character set CODEPAGE (number form spool administration).

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

Format conversion

If you set the parameter WITH_TAB = 'X', the system triggers a format conversion for FORMAT_TYPE = 'RTF'. Beforehand, you must use transaction SE74 (Format conversion) to specify which character and paragraph names or Word templates to match which other character and paragraph names or Word templates.

The system converts

HEADER-TDSTYLE

   

or

in

SSHEET

HEADER-TDFORM

   

 

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:

CODEPAGE

Specify the character set numbers from the spool administration.

Reference field: TCP02-CPCODEPAGE

Default value: SPACE

FILE

Name of the file you want to create on the presentation server (if necessary, with leading directory name). If the directory does not exist or if the system cannot open the file for writing, it triggers the respective exceptions.

Reference field: RLGRAP-FILENAME

FORMATWIDTH

Line width of the target file.

Default value: 72

FORMAT_TYPE

Format of the target file ('ITF', 'RTF', or '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 template (*.dfv or *.dot).

To trigger a format conversion, you must enter the symbolic name for which you maintained a conversion to the respective SAPscript style or form in transaction SE74.

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

Default value: SPACE

WITH_TAB

If WITH_TAB = 'X' and the parameter SSHEET is filled, the system converts character and paragraph formats. Source and target formats can be a SAPscript style, a SAPscript form, or an MS Word template. Using transaction SE74 (Format conversion), you must specify which character or paragraph names or Word templates match.

Default value: SPACE

TAB_SUBSTITUTE

Substitution value for the SAPscript tab.

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

'C' substitutes the tab with a character string of up to four characters.

Example

TAB_SUBSTITUTE = 'C<<>>'

"before tab,,after tab " in SAPscript becomes

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

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

Example

TAB_SUBSTITUTE = 'X09_ _'.

The SAPscript tab ",," becomes the hexadecimal 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:

ITF_LINES

SAPscript text table you want to export.

Structure: TLINE

 

Exceptions:

FILE_OPEN_ERROR

File cannot be opened.

FILE_WRITE_ERROR

File cannot be written.

DOWNLOAD_ERROR

Other errors when downloading file.