We have discussed Simple File Adapter Configuration as well as File Content Conversion for a simple structure CSV file. In this article we will understand how to deal with File Adapter when file structure is a bit complex. For example if it has different number of columns of information on different rows.
Let us take an example of a simple sales order. Assume that sales order is received in form of a text file. The first row has header information like customer details and order details; whereas the remaining rows have order items details. Every field has different lengths and there are no field separators. The adjoining figure shows such a file with minimal fields.
Sender File Adapter Configuration with Content Conversion
The figure below shows a typical configuration of the sender file adapter. Specify File Content Conversion as message protocol. Document Name and Namespace correspond to the message type from the Integration Repository. Recordset Name defines the root node under which rest of the XML will be created. If left blank, it defaults to ‘Recordset’. If you do not want this extra node to be inserted, you can set the parameter ignoreRecordsetName to true (Thanks Mike for this input). See this link for exhaustive list of available parameters.

Specify the name and occurrence of each sub-node in Recordset Structure. In this case, OrderHeader node occurs once while OrderItem node can occur any number of times. Key Field Name and Key Field Type help in differentiating different substructures. In this case Key =1 implies OrderHeader node while Key = 2 implies OrderItem node.
Different parameters are given below –
- <node>.fieldFixedLengths – comma-separated ordered list of field lengths in the particular node
- <node>.endSeparator – identifies end of record
- <node>.fieldNames – comma-separated ordered list of field names in the particular node
- <node>.keyFieldValue – Value of the key field
- <node>.keyFieldInStructure – ‘ignore’ (without quotes) indicates that the Key field should not be generated in the resulting XML whereas ‘add’ (without quotes) indicates that it should be added.
For a detailed list of parameters visit this page.
Receiver File Adapter Configuration with Content Conversion
Assume that we want to construct a text file in the similar format from the XML. The generated file should be something like the one shown in the figure on right.
The figure below shows the typical configuration for the receiver file adapter using file content conversion. Specify the comma-separated list of root node and substructures under the Recordset Structure as shown. Then define the parameters as per the requirement.

Most common parameters are <node>.fieldSeparator or <node>.fieldFixedLengths, <node>.endSeparator, <node>.fieldNames. For a detailed list of available parameters please refer this page.
Thus we have learned how to configure the SAP XI file adapter on sender and receiver side. We have also covered the File Content Conversion when dealing with simple structures as well as with advanced or complex structures.









Hi Riyaz,
I’ve a scenario in which the structure is like below:
Header
Item (Unique Value)
Detail (occurs 0 to n)
Cost (occurs 0 to n)
Trailer
In this way I’ve multiple entries for Item, Detail & Cost which are supposed to update a single customized IDoc with all the 3 segments. In File Content Conversion I’ve given the sequence as Item (1), Detail (2), Cost (3), however the rows of Detail and Cost are occurring randomly due to which we are getting wrong data posted in the IDoc.
Kindly let me know how do I rectify this.
have a single line payload , ie all header , details and trailer records comes in one line ,w/o any end separation.
Please help me in FCC for such kind , i tried Feild.endSeparotor as ’0′ (null), but it did not work.
The Payload is
HUREC1.001036BGI10360006768100000000020120313I19287400010010000T000004
The current FCC am using is able to read only the Headerpart ie HUREC1.001036
the actual case is the incoming file will not have any end separator , but for the purpose of making it work i introduced few endseparotors .
Still its unable to identify any endseparator , ie i tried using # as end separaor , buts its unable to identify it.
Wanted to know , is there any possiblity to read the single line payload with the end separators.
Now the possibility from the client side is they can giv the file as
HUREC1.001036|BGI10360006768100000000020120313|I19287400010010000|T000004
ie they can giv the file with ‘ | ‘pipe symbol as end separation, like above
i use endseparator as ” 0x7C” – hex part for pipe symbol , still its not able to recognise , as it all comes in one line . Appreciate any help on this
Hi Riyaz ,
Firstly greetings to the knowledge you share . Below is the requirement i have in the FCC for sender file adapter later to map to idoc with custom message developed .The flat file is completely as one record as below
Header – (once )………………………………………. Flat file example :
Field 1 ——————————————->order line no 1 plant material 1 code 1 quantity 1
…………………………………………………………….. order line no 2 plant material 2 code 2 quantity 2
Field 2 (plant vlaue shuld come………………………………………………|
Line – repeats (0-unbounded) | | |
field 1 (line no 1)————————————————-| | |
field 2(material1)—————————————————————————–| |
field 3 (quant 1)—————————————————————————————————–|
field 1 (line no 2)————————————————-| | |
field 2(material2)—————————————————————————–| |
field 3 (quant 2)—————————————————————————————————–|
So i need to read the data intermittently and map them in the line items ignoring the order and plant data in every line apart from the first line. The order and plant remains the same in the flat file only line items keep changing .
Hope my question is clear & Thanks in advance .
Regards
Nagesh
hi Riyaz,
Can you please let me know if we can use Document Offset in content conversion using modules.. i need to use them in a JMS channel. I tried xml.documentOffset, but it doesn’t seem to work.
Regards,
Ninu