Start of Content Area

Background documentation Converting File Content in the Receiver Adapter  Locate the document in its SAP Library structure

If you have selected File Content Conversion under Message Protocol, you can convert a table in XML format to pure text format in this mode. The expected XML structure contains the structure as nodes filled with any number of elements without additional subnodes.

The expected document structure usually looks like this:

<root>...

   <nameA>

         <value1>value</value1>

         <value2>value</value2>

         <value3>value</value3>

   </nameA>

   <nameB>

         <value4>value</value4>

   </nameB>

...

</root>...

You can use any element names you like. There can be any number of different substructures under the root element, which can be mapped to different CSV structures.

File Structure

The specifications described below are used to construct a text file from the XML document.

·        Recordset Structure

Enter the substructures using the pattern NameA,NameB,....

Note

If you want to convert all substructures using the same parameters, you only have to specify one structure. The specifications are automatically applied to all substructures.

If you specify more than one structure, the list must contain all the structures occurring in the document. The list must be complete, otherwise a processing error will be triggered at runtime.

Set the parameters for all the specified recordset structures NameA, NameB, and so on in the following table:

Parameters for the Recordset Structure

Parameter Name

Meaning

NameA.addHeaderLine

Specify whether the text file will have a header line with column names. The following values are permitted:

·        0 – No header line

·        1 – Header line with column names from the XML document

·        2 – As for 1, followed by a blank line

·        3 – Header line is stored as NameA.headerLine in the configuration and is applied

·        4 – As for 3, followed by a blank line

Note

This specification is only permitted if exactly one structure is defined.

NameA.headerLine

Specify the header line that is generated in the text file if NameA.addHeaderLine has the value 3 or 4. This specification is mandatory in this case.

NameA.fieldFixedLengths

Specify a character string containing a list of fixed column widths that are separated by commas and determine the number and the length of columns generated in the text file.

If you do not make any specification for NameA.fieldSeparator, the specification NameA.fieldFixedLengths is mandatory.

NameA.fixedLengthTooShortHandling

Specify how you want the system to respond when column widths in the actual document exceed those defined in NameA.fieldFixedLengths. The following values are permitted:

·        Error

Error means that processing of the document is terminated.

·        Cut

Cut means that a value is shortened to the maximum permitted length.

·        Ignore

Ignore means that the system applies the value completely, regardless of it being too long. Subsequent columns are moved correspondingly.

NameA.fieldSeparator

If you specify a character string here, it is added as a separator to all columns except the last. You can also specify this string in addition to NameA.fieldFixedLengths.

If you made no specification for NameA.fieldFixedLengths, this is the only specification to identify the individual columns in a row.

If you made a specification for NameA.fieldFixedLengths, the length of the separator is not taken into account.

Note

You must specify at least either NameA.fieldFixedLengths or NameA.fieldSeparator.

If you have only specified NameA.fieldSeparator, the structures of the XML document can have differing numbers of elements that are added to each other separately in the text file by the value from NameA.fieldSeparator. If you specify NameA.fieldFixedLengths this is not possible since the number of columns is defined when the column widths are given.

NameA.endSeparator

If you enter a character string here, the system adds it to the last column as a closing character. You can also make this specification in addition to NameA.fieldFixedLengths. To include a line break following the closing character, you must explicitly define it by attaching ´nl´ (including the quotation marks) to the string.

The default value is a line break (no explicit separator after the last column; instead the structures are arranged line-by-line).

NameA.beginSeparator

If you specify a character string here, the system places it before the first column. You can also make this specification in addition to NameA.fieldFixedLengths.

The default value is an empty character string (no separator before the first column).

 

 

 

Note

Special Characters in the String for Separators:

In all strings for separators (NameA.fieldSeparator, NameA.beginSeparator, and NameA.endSeparator), you can specify non-printable ASCII characters. These characters can each be inserted individually in the strings in the form ´0xHH´ (including the quotation marks), where HH represents the character coded as a hexadecimal value. A line break can be entered using the character ´nl´ (including the quotation marks); nl stands for new line. The special character ´0´ is not a separator character.

 

Note

Fixed Column Width of the Text Document:

NameA.absoluteRowWidth=<noOfColumns>

If the separators do not contain any line breaks, the text document is generated as a single line of text. To restrict the width of the text, use this parameter. <noOfColumns> represents the maximum number of columns in this case. This parameter also functions together with the specification of a line break for xml.endSeparator.

This value requires NameA.addHeaderLine=0 to be specified.

 

 

 

 

End of Content Area