Symptom:
How can the conversion of character and paragraph formats between SAPscript texts or between a SAPscript text and an RTF file be carried out as of Release 3.0?
Other termsSAPscript, paragraph format, character format, conversion, RTF, RTF file
Reason and PrerequisitesAdditional documentation
Solution
Format conversion
Format conversion enables you to allocate paragraph and character formats in source and target text to each other and to rename them when the formatted texts are being converted. To start processing, call up transaction SE74 (format conversion). You will find this transaction as a menu option everywhere in the word processing environment in the system.
Caution:
In Releases 2.1 and 2.2, format conversion was still controlled via tables TTDCF and TTDCW. If you have already worked with the older format conversion, you should change to the new Release 3.0 procedure. To do this, start report RSTXDUMS once and once only. This report gives all of the old conversions a new form so that they can be edited using transaction SE74 (format conversion).
1. Style sheets and document templates
a) Word 5.5 for DOS or OS/2
Character and paragraph styles (formats) can be defined in what is known as a style sheet (*.sty). They are identified by means of a "key code" (a two-digit key), and some of them by means of predefined descriptions such as "structure 1".
b) Winword 2.0
In the "document template" (*.dot), "styles" can be defined for paragraph formats. The names of these styles can now (unlike in Word 5.5) be more than two characters long.
c) Winword 6.0 or higher
In addition to the features available in 2. 0, it is also possible to determine styles for font styles (character formats) in Word 6.0.
2. Styles and layout sets in SAPscript
Paragraph and character formats are defined in styles and layout sets. To ensure that a text can be output in formatted form, you must assign it a layout set. Sometimes, the text may already have been given a style as well. In this case, the formats that exist in the style are used, otherwise the formats of the layout set are used. The format tags are two-digit keys.
3. Maintenance of format conversions
a) Import of RTF files
When RTF files are imported, the styles of a document template must be represented as the character and paragraph formats of a SAPscript style or layout set. The maintenance of these conversions is split into paragraph formats (screen after initial screen) and character formats. Exactly one paragraph style can be linked with exactly one SAPscript paragraph tag; on the other hand, one character style can be linked with up to four SAPscript character tags.
Example: The style "Combi" might contain the character formatting for bold and italics. The SAPscript style might contain only the formats "ZB" (Bold) and "ZI" (Italics). In conversion maintenance, you should in this case define a conversion from Combi to ZB and ZI.
Please note the special RTF descriptions that correspond to the standard Word descriptions (for example, "heading 1", "annotation text" etc.) and also the RTF notation of foreign characters, such as French accents or German 'umlauts'! The following characters should never be used in the names of styles: '\', '{', '}' and ';'. In both cases, import a stylesheet first:
If you have already imported a style sheet (see point 3. c)), the styles will be listed as source formats. However, the SAPscript character or paragraph formats are always proposed as possible entries for the target format.
If a SAPscript paragraph is not assigned to a paragraph format, the SAPscript default paragraph ("* " ) is used. If a target format is not defined for a character style, this style is not processed.
b) Export of RTF files
If you export a SAPscript text without specifying a document template, a document template is generated from the style and layout set information. There are two possibilities when you specify a document template:
- A style sheet prototype (see point 3.c)) exists in the system
The resulting RTF file is given this style sheet as a leader. This means that the original Winword styles described in this style sheet are used for formatting. In format conversion, you will see a list of all paragraph or characterformats from the style or layout set. In the field 'Target format', enter the name of the required style. A possible entries function with all styles from the style sheet is available to help you here.
- A style sheet prototype does not exist in the system
Here, you merely rename and enter values for the formats in format conversion. A style sheet is generated with format definitions from the style or layout set for the RTF file. Here, only the names of the styles can differ from the original tags and, for example, different SAPscript formats can be linked with one single Word style.
In the column 'Source format', you will see a complete list of all paragraph or character formats from the style or layout set. In the column 'Target format', enter the name that this format is to have in the Word text.
You may have used outline paragraphs in SAPscript. To inform Word that a paragraph is, say, a header of level 2, make sure that the description "Heading 2" is in the RTF file for this format (you can find the standard RTF descriptions under the menu option Environment -> RTF descriptions). Enter "heading 2" in the field 'Target format' in paragraph format conversion.
The column 'dominant' is used to analyze the formats. Below is a short example of what this means.
You have, say, two character formats: Z1 and Z2 (Z1 means bold, Z2 underlined). In Word, however, you do not want to have any more characters underlined, but want to use a uniform format "highlighted" instead. In this case, enter the following in format conversion: ------------------------------------------
| Source format | Target format | dominant |
-----------------------------------------------
| Z1 | highlighted | X |
| Z2 | highlighted | |
-----------------------------------------------
a) Word document templates (prototypes)
RTF descriptions of Word document templates already in R/3 are intended for the conversion of SAPscript formats into the formats of an existing document. For example, Word uses the document template abc.dot. This template should also be used for texts converted from SAPscript. To do this, you must store a Word text linked with the document template abc.dot as an RTF file, for example, as xyz.rtf. In format conversion itself, enter the name abc.dot and then carry out the action "Import" (function key). In the subsequent screen, you must enter the name of the RTF file (in our case xyz.rtf). Once the transfer has taken place, the style sheet part of the RTF file is now available for format conversions.
b) Format conversion in SAPscript texts
Situation: Text ABC was formatted up to now with STYLE1 and LAYOUTSET1. Now, it should only be assigned LAYOUTSET2.
In the format conversion of SAPscript texts, the relevant paragraph and character formats are compared against each other. In the above case, the formats in STYLE1 are compared against the formats in LAYOUT2. Just an for the import of RTF files, up to four target formats can be assigned to one character format.
This format conversion between SAPscript texts can be started in the editor under the menu option "Format -> Convert..." or via the function module "EXCHANGE_ITF".
4. Transport of conversions and style sheet prototypes
Conversions and style sheet prototypes are stored in client 00 as SAPscript text, language D, and can be transported using the mechanisms provided for SAPscript objects. To do this, create a transport request in client 00 (either manually or by using report RSTXTRAN) and release the transport.
Caution:
Format conversions and style sheet prototypes are client-independent!
a) Transport of format conversions
Format conversions are SAPscript texts with the text object STYLESHEET and the text ID ABB.
The text name is 34 characters long:
Character 1: Type of source format:
S for style, F for layout set or D for document template
Characters 2 to 17: Source format name (as specified in the initial screen of format conversion)
Character 18: Type of target format:
S for style, F for layout set or D for document template
Characters 19 to 34: Target format name (as specified in the initial screen of format conversion)
These texts are stored in client 00, language D.
The entry in the transport request should look as follows:
R3TR | TEXT | ,,,
Example:
You want to transport the format conversion of layout set ABC into the document template xyz.dot into another system. You create a transport request with the following entry:
R3TR | TEXT | STYLESHEET,FABC-------------Dxyz. dot,ABB,D
(the minus signs in this example stand for blanks in the text name)
Alternatively, you can also execute report RSTXTRAN, and then choose the texts that you want to transport.
b) Transport of style sheet prototypes
Style sheet prototypes are SAPscript texts with the text object STYLESHEET and the text ID RTF. They are also stored in client 00, language D. The text name corresponds to the prototype name.
Example: You want to transport the style sheet prototype "xyz.dot" into another system. The entry in the transport request looks as follows:
R3TR | TEXT | STYLESHEET,xyz.dot,RTF,D