In this weblog we would see how to address the issue of Content Conversion (Sender File Adapter) in case of an input file with the structure as follows;
Header,01,Header3,Header4,Header5,Header6,Header7
Body1,Body2,Body3,02,Body5,Body6
BodyA,BodyB,BodyC,02,BodyE,BodyF
03,Trailer2
You would note that the key field ( namely 01 for the Header, 02 for the Body and 03 for the Trailer ) occur at different places in the file quite contrary to input files that we normally see in daily transactions.
Before we start I would request you to go through the following weblogs on Content Conversion;
1. Content Conversion (Pattern/Random content in input file)
2. File Content Conversion for Unequal Number of Columns
3. The specified item was not found.
The screen shot of the data type is shown below:
Lets go to the configuration part of the file adapter. In the screen shot below you would notice that the
Key Field Name
is mentioned as
keyfield</b> and this is referred in the as the Header and Trailer occurs once in the file while the Body has multiple occurrences.
The complete Content Conversion is as follows;
Header.fieldSeparator - ,
Header.fieldNames - field1,keyfield,field3,field4,field5,field6,field7
Header.keyFieldValue - 01
Body.fieldSeparator - ,
Body.fieldNames - field1,field2,field3,keyfield,field5,field6
Body.keyFieldValue - 02
Trailer.fieldSeparator - ,
Trailer.fieldNames - keyfield,field2
Trailer.keyFieldValue - 03
ignoreRecordsetName - true
The generated XML source for this scenario in SXMB_MONI - > INBOUND MESSAGE -> PAYLOAD is the screen shot below,
I believe this weblog along with others on Content Conversion would provide a better understanding on this topic for the beginners who are novice to the world of SAP XI.