SAP Function CONVERT_TEXT - Text Conversion: Convert Text Formats

Parameter Reference Type Length Default Optional Text
CODEPAGE TCP02-CPCODEPAGE N 4 '0000' X Source or target character set (depending on DIRECTION)
DIRECTION C C 0 'EXPORT' X 'IMPORT' (<--) or 'EXPORT' (-->)
FORMATWIDTH ITCTK-TDLINESIZE N 3 72 X Line width in results table (only for EXPORT)
FORMAT_TYPE C C 0 'RTF' X 'RTF' or 'ASCII'
HEADER THEAD u 375 SPACE X Text header of original text
LF_SUBSTITUTE C C 0 SPACE X Replacement text for line feed
MASK_BRACKETS TDBOOL C 1 'X' X Mask special characters <..> during import
REPLACE_SAPCHARS TDBOOL C 1 'X' X Evaluate SAP characters during export
REPLACE_SYMBOLS TDBOOL C 1 'X' X Evaluate symbols during export
SSHEET C C 0 SPACE X Print format; only effective for print format conversion
TABLETYPE C C 0 'ASC' X Type of foreign format table: 'BIN' or 'ASC'
TAB_SUBSTITUTE C C 0 SPACE X Replacement for tab
WITH_TAB TDBOOL C 1 SPACE X Print format conversion; 'X' = yes or ' ' = no
WORD_LANGU SPRAS C 1 SY-LANGU X Only for RTF conversion: System language from Word

Parameter Reference Type Length Text
FORMATWIDTH_E ITCTK-TDLINESIZE N 3 Actual format width at export
NEWHEADER THEAD u 375 Text header of SAPscript resulting text
WITH_TAB_E 0

Parameter Reference Length Optional Text
FOREIGN TLINE 134 External text table
ITF_LINES TLINE 134 SAPscript ITF table
LINKS_TO_CONVERT HELP_LINKA 9 X Not implemented

Exception Text
NOT_SUPPORTED


The function module CONVERT_TEXT provides the followingformat conversion options:
INCLUDE STXD_PF_CONVERT_TEXT OBJECT DOKU ID TX
INCLUDE STXD_PP_NEWHEADER OBJECT DOKU ID TX

Description
Here the character set numbers from the spool administration must bespecified.
This parameter can contain the values of the following formats:
'RTF': interchange format (RichTextFormat) from MS Word
'ASCII': self-explanatory
INCLUDE STXD_PP_HEADER OBJECT DOKU ID TX

Description
Replacement value for the line break.
This parameter only affects DIRECTION = 'EXPORT' and TABLETYPE = 'BIN'.If its value remains initial, function module WS_QUERY is calledinternally in order to determine the replacement value for theoperating system on the frontend.

Value range
For LF_SUBSTITUTE there is a character field of length 4. The linebreak can be replaced by a one or two binary character.
Example:
In Windows a line break is implemented using Hex 0D Hex 0A. HereLF_SUBSTITUTE = '0D0A'.
In motive Hex 0A is the line feed. You would specify LF_SUBSTITUTE as'0A '.

Default
SPACE

Description
Name of a document template (*.dfv or *.dot).
If a format conversion is to be effective, the symbolic name for whicha conversion with the relevant SAPscript style or layout set wasmaintained in the transaction "Format conversion" (SE74) must bespecified here.
In addition, the parameter WITH_TAB must be set to 'X'.

Description

  • DIRECTION = 'IMPORT'

  • In this case the parameter TABLETYPE describes the type of the tableFOREIGN. If this table was obtained for example by uploading a localfile in binary format, and all the lines except the last are thereforefilled to the end and Carriage Returns or Linefeeds possibly contained,TABLETYPE = 'BIN' must be selected. If the table is a normal linetable, TABLETYPE = 'ASC' should be set.
    • DIRECTION = 'EXPORT'

    • The parameter TABLETYPE again describes the type of the table FOREIGN.If you want to create a file type structure with full use of the linewidth in FOREIGN and division of the logical lines (FORMATWIDTH) byCarriage Return and Linefeed, TABLETYPE = 'BIN' must be chosen. Anormal ABAP line table is obtained with TABLETYPE = 'ASC'.

      Value range
      'ASC' or 'BIN'

      Default
      'ASC'
      INCLUDE 'STXD_PP_TAB_SUBSTITUTE' OBJECT DOKU ID TX
      INCLUDE STXD_PP_WITH_TAB OBJECT DOKU ID TX

990560Output of formatted long texts on EH&S reports
26526Conversion of SAPscript texts, Release 3.0
391261SAPscript: Special character "&" and "<" in the PC editor