Show TOC

CONVERT_TEXT_R2Locate this document in the navigation structure

Use

The function module converts texts from SAP R/2 text format to SAPscript format of the SAP system.

Apart form converting the format structure of the text lines, the function module considers the following attributes of R/2 texts:

  • Line attributes

  • Control statements

  • Symbols

Various incompatibilities may occur during conversion. These incompatibilities are grouped in levels. The degree of the most serious incompatibility is returned in the parameter ERRORLEVEL.

Line format

Line format

The line format of R/2 texts is similar to that of SAPscript texts. Both lines consist of a field that contains the line format and a field with the actual line contents. Conversion of line formats is described under 'Line attributes'.

A text line in R/2 can consist of up to 220 characters; in SAPscript, the line contents is limited to 132 characters. If an R/2 text line consists of more than 132 characters, the system transfers the remainder into a subsequent line with no paragraph format.

Line attributes

Line attributes

SAPscript does not distinguish between fixed and variable lines, but knows only what R/2 calls variable lines. To convert the R/2 line formats, the following rules apply:

At lines with the attributes A and F always a new SAPscript paragraph starts.

Adjacent lines with the attribute V are considered as one paragraph. If before the first V line a line with attribute F appears, then the first V line is the beginning of a new SAPscript paragraph. If the line before the V block has the attribute A, the V lines are considered as continuation of the A line and no new paragraph is started.

By default, all paragraphs receive the SAPscript standard paragraph format '*'. To specify a different paragraph format, use the parameters PARAGRAPH_AV and PARAGRAPH_F.

Control statements

Control statements

The system does not convert the following control statements, since they have no equivalents in SAPscript:

.nlf

print the next two lines on top of each other

.psz

set the number of lines per page

.lpi

define line distance

.prn

output control statement for printer

off

set left margin for lines with V attribute

.nam

determine name of spool file

.set

define value for number and chapter variable

The other R/2 control statements are converted to SAPscript statements as follows:

.ifi &symbol

/: IF &symbol(I)& EQ ' '

.ifn &symbol

/: IF &symbol& NE ' '

.abs <n>

/: PROTECT

contents of the next <n> lines from R/2 text

/: ENDPROTECT

.def &symbol=< value>

/: DEFINE &symbol&= ' <value>

.pct= <value>

/: DEFINE &pct& = '<value>'

.top <textnr>

/: TOP

/: INCLUDE <textnr>

/: ENDTOP

.top <textnr>

/: BOTTOM

/: INCLUDE <textnr>

/: ENDBOTTOM

Symbols

Symbols

Symbols On one hand, symbols are converted to the different syntax of SAPscript; on the other hand, the names of R/2 database symbols that consist of table name/segment ID and field name must be converted to the different table and field names of the SAP system.

As for the syntax, you can use SAPscript for all formatting options (offset, length, prefix text), except converting a symbol value using a table.

To assign the symbol names of R/2 database symbols to the corresponding SAP names, use the function module RS3L_CONVERT_FIELDNAME. For more information, see the documentation of this function module.

The system passes the parameters SOURCE_SYSTEM, SOURCE_RELEASE, SOURCE_OBJECT, DESTINATION_TABLE, and IGNORE_ALIASNAMES without further interpretation to this function module.

The R/2 symbols for chapter variables (p0..p3) are not transferred to SAPscript.

Function call:

CALL FUNCTION 'CONVERT_TEXT_R2'
        EXPORTING HEADER_R2     = ?...
                HEADER          = ?...
                DIRECTION       = 'IMPORT'
                PARAGRAPH_AV    = '* '
                PARAGRAPH_F     = '* '
                INCLUDE_ID      = 'ST  '
                INCLUDE_ZEROS   = 'X'
                INCLUDE_PREFIX  = SPACE
                COMMENT_LINES   = 'X'
                SOURCE_SYSTEM   = 'SAP'
                SOURCE_RELEASE  = SPACE
                SOURCE_OBJECT   = SPACE
                DESTINATION_TABLE = SPACE
                IGNORE_ALIASNAMES = SPACE
                ERROR_COMMENTS  = SPACE
        IMPORTING NEWHEADER_R2  =
                NEWHEADER       =
                NEWSTYLE        =
                ERRORLEVEL      =
        TABLES LINES_R2         = ?...
                LINES           = ?...
            

Export parameters:

HEADER_R2

You must enter the text header of the R/2 text.

Structure: TEXTH

HEADER

You must enter the text header of the SAPscript text.

Structure: THEAD

DIRECTION

Specify the conversion direction. At present, the SAP system supports only conversions from R/2 texts to the SAPscript format, that is, the value IMPORT.

Default value: 'IMPORT'

PARAGRAPH_AV

Enter the paragraph format you want to use at the beginning of an R/2 line block with the attributes A or V. If you leave the field empty or if it contains blanks, the system uses the standard paragraph format '*'.

Reference field: TLINE-TDFORMAT

Default value: '*'

PARAGRAPH_F

Enter the paragraph format you want to use for each R/2 line with the line attribute F. If you leave the field empty or if it contains blanks, the system uses the standard paragraph format '*'.

Reference field: TLINE-TDFORMAT

Default value: '*'

INCLUDE_ID

If standard texts are included in R/2 texts, these lines are converted by a SAPscript INCLUDE command. Use this parameter to specify the ID of the SAPscript text. The default value is 'ST'.

Reference field: THEAD-TDID

Default value 'ST'

INCLUDE_ZEROS

When texts are converted from the SAP R/2 System, the numbers of the standard texts included are transferred with 8 characters. Leading zeros are therefore converted as well.

This parameter can be used to determine whether the leading zeros in the standard text number are converted.

Possible values:

  • 'X' include leading zeroes

  • ' ' delete leading zeroes

  • Default value: 'X'

Example

The standard text 33 is included in the R/2 text. The relevant text line appears as follows:

S 00000033

This text line is represented in SAPscript by the INCLUDE command.

/: INCLUDE '00000033' OBJECT 'TEXT' ID 'ST'

If the parameter INCLUDE_ZEROS has the value SPACE, the INCLUDE command generated appears as follows:

/: INCLUDE '33' OBJECT 'TEXT' ID 'ST'

INCLUDE_PREFIX

If R/2 standard texts are included in the text modules which are to be transferred, a prefix can be specified here which is placed before the text number in the INCLUDE command:

Default value: SPACE

Example

INCLUDE_PREFIX = 'R2_'

R/2 line: S 00001234

SAPscript line: /: INCLUDE 'R2_00001234'....

COMMENT_LINES

The parameter determines how to treat R/2 command lines that SAPscript no longer supports.

Possible values:

  • 'X' include lines as comment lines

  • ' ' Do not transfer lines

  • Default value: 'X'

SOURCE_SYSTEM

Enter the name of the system from which the text module originates. It will generally always be 'SAP' (default value).

  • Default value: 'SAP'

The function module CONVERT_TEXT_R2 forwards this parameter directly to the parameter SOURCE_SYSTEM of the function module RS3L_CONVERT_FIELDNAME called internally, which carries out the conversion of the field name. Further information can be found in the parameter documentation there.

SOURCE_RELEASE

Here you can specify the Release of the R/2 text module which is to be converted. The specification is required to convert database symbols of the R/2 text.

  • Default value: SPACE

The function module CONVERT_TEXT_R2 forwards this parameter directly to the parameter with the same name of the function module RS3L_CONVERT_FIELDNAME called internally, which carries out the conversion of the field name. Further information can be found in the parameter documentation there.

SOURCE_OBJECT

Migration object within which the conversion of the field name is carried out.

  • Default value: SPACE

The function module CONVERT_TEXT_R2 forwards this parameter directly to the parameter BMIG_OBJECT of the function module RS3L_CONVERT_FIELDNAME called internally, which carries out the conversion of the field name. Further information can be found in the parameter documentation there.

DESTINATION_TABLE

The parameter specifies the R/3 table to which the text being converted belongs.

  • Default value: SPACE

The function module CONVERT_TEXT_R2 forwards this parameter directly to the parameter R3_TABLE of the function module RS3L_CONVERT_FIELDNAME called internally, which carries out the conversion of the field name. Further information can be found in the parameter documentation there.

IGNORE_ALIASNAMES

Use the parameter to control the alias name check during the conversion.

Possible values:

  • 'X' ignore check

  • ' ' execute check

  • Default value: SPACE

The function module CONVERT_TEXT_R2 forwards this parameter directly to the parameter with the same name of the function module RS3L_CONVERT_FIELDNAME called internally, which carries out the conversion of the field name. Further information can be found in the parameter documentation there.

ERROR_COMMENTS

Use the parameter to define whether to include certain errors, which occur during the conversion, as comments into the SAPscript text. The messages generally refer to an error which was found when the subsequent text line was converted.

Possible values:

  • 'X' Show error messages as comments

  • ' ' Do not show error messages

The origin of the message is specified in each message line by a prefix. Further information can be found in the documentation there.

  • CTR2 error message from text conversion routine

  • RS3L error message from field name conversion

If for an error no error text exists, the system displays after the prefix the character chain '?..'.

Default value: SPACE

Import parameter:

NEWHEADER_R2

Changed header of the R/2 text.

Since at present only the conversion R/2 to SAPscript is supported, the system places the text header specified in the parameter HEADER_R2 without changes into this parameter.

Structure: TEXTH

NEWHEADER

The parameter returns the text header with the fields changed according to the executed actions.

Structure: THEAD

NEWSTYLE

Not filled at present.

Reference field: THEAD-TDSTYLE

ERRORLEVEL

When converting R/2 texts to SAPscript format, several problems may occur. The highest error level of these problems is specified by this parameter:

  • ERRORLEVEL = 0:

    No particular differences were identified.

  • ERRORLEVEL = 1:

    Small differences were determined which primarily involve the formatting. The actual text contents were converted without changes.

    Characters for hyphenation points were removed

    Words separated by a line break were joined (only for lines with the attribute A or V)

    The internal call to function module RS3L_CONVERT_FIELDNAME returned error level 1 when converting a field name.

  • ERRORLEVEL = 2:

    The conversion of text elements was carried out, but it cannot be ensured that they can be interpreted appropriately in the SAP System.

    The converted text contained symbols, for which the system cannot ensure that they can be replaced by the respective values in the SAP system:

    symbols that refer to table fields *)

    symbols which refer to segment fields *)

    symbols converted using the R/2 table 164V

    *) These errors can only occur in the absence of function module RS3L_CONVERT_FIELDNAME.

    The internal call to function module RS3L_CONVERT_FIELDNAME returned error level 2 when converting a field name.

  • ERRORLEVEL = 3:

    The R/2 text contained functions which are no longer or not yet supported by SAPscript.

    R/2 commands: .nlf, .psz, .lpi, .prn, .off, .nam

    Conversion of the values of symbols via a table &symbol(Txxxx) Chapter counters:

    Chapter counters: &p0... &p3

    The internal call to function module RS3L_CONVERT_FIELDNAME returned error level 3 when converting a field name.

  • ERRORLEVEL = 4:

    Conversion error

    Command line was truncated:

    The line length of the SAPscript text module is shorter than a command which is to be converted. The rest of this line had to be truncated. This command is not interpreted or is not interpreted correctly by SAPscript.

    Invalid reference to standard text

    The R/2 text contains a line with the line format S whose line contents do not represent a valid text number.

    The internal call to function module RS3L_CONVERT_FIELDNAME returned error level 4 or higher when converting a field name.

The internal call to function module RS3L_CONVERT_FIELDNAME generated one of the exceptions DOUBLE_TUMLE, DOUBLE TUMLA or INTERNAL_ERROR when converting a field name.

Note

The meaning of the error levels in relation to the function module RS3L_CONVERT-FIELDNAME can be checked in the documentation of this function module.

Reference field: SY-SUBRC

Table parameters:

LINES_R2

The table contains the text lines of the text in R/2 format.

Structure: TEXTL

LINES

The table contains the text lines of the text in the SAPscript format.

Structure: TLINE