You are on page 1of 4

CONVERTING XML IN THE RECEIVER FILE/FTP ADAPTER TO TEXT FORMAT

PDF download from SAP Help Portal: http://help.sap.com/saphelp_nwpi71/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm Created on December 12, 2013
The documentation may have changed since you downloaded the PDF. You can always find the latest information on SAP Help Portal.

Note This PDF document contains the selected topic and its subtopics (max. 150) in the selected structure. Subtopics from other structures are not included.

2013 SAP AG or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Please see www.sap.com/corporateen/legal/copyright/index.epx#trademark for additional trademark information and notices.

PUBLIC 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 1 of 4

TABLE OF CONTENT
1 Converting XML in the Receiver File/FTP Adapter to Text Format

PUBLIC 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 2 of 4

Converting XML in the Receiver File/FTP Adapter to Text Format


Use
You can convert a table in XML format to pure text format.

Prerequisites
In the receiver file/FTP adapter, you have selected File Content Conversion as the Message Protocol. 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>...

Procedure
1. You can use any element names you like. 2. There can be any number of different substructures under the root element, which can be mapped to different CSV structures. Defining File Structure Parameters 3. Under Recordset Structure, enter the substructures using the pattern NameA,NameB,....
If you want to convert all substructures using the same parameters, you only have to specify one structure. The entries 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.

Defining Parameters for Recordset Structures 4. Set the parameters for all the specified recordset structures NameA, NameB,... in the following table: 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 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 entry 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 entries for NameA.fieldSeparator, the entry 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 Document processing is cancelled. Cut The value is cut to the maximum permitted length. Ignore The value is accepted even though its length exceeds the permitted value. Subsequent columns are moved accordingly. NameA.fieldSeparator Enter a string. It is added as a separator in all columns apart from the last. You can specify this string in addition to NameA.fieldFixedLengths. If you made no entry for NameA.fieldFixedLengths, this is the only entry to identify the individual columns in a row. If you made an entry for NameA.fieldFixedLengths, the length of the separator is not added to this length.

PUBLIC 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 3 of 4

You must make an entry for at least 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 one after the other in the text file, each separated 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 make this entry 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 make this entry in addition to NameA.fieldFixedLengths. The default value is an empty character string (no separator before the first column). Defining Special Characters in Strings for Separators 5. You can specify non-printable ASCII characters in all strings for separators (NameA.fieldSeparator, NameA.beginSeparator, and NameA.endSeparator). Insert these characters individually in the strings in the form 0xHH (including quotation marks). HH represents the character encoded as a hexadecimal value. Add a line break using the character nl (including the quotation marks); nl stands for new line. The special character 0 is not a separator character. Defining a Fixed Column Width of the Text Document 6. If the separators do not contain any line breaks, the text document is generated as a single line text. If you want to restrict the text width, use the parameter NameA.absoluteRowWidth=<noOfColumns>. <noOfColumns> specifies the maximum number of columns.
You can set this parameter together with the specification of a line break for xml.endSeparator. This value requires NameA.addHeaderLine=0 to be specified.

PUBLIC 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 4 of 4

You might also like