Skip to Content

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:

image

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.

image

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,

image

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.

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Former Member
    How often does a message have

    Header,01,Header3,Header4,Header5,Header6,Header7
    Body1,Body2,Body3,02,Body5,Body6
    BodyA,BodyB,BodyC,02,BodyE,BodyF
    03,Trailer2

    Is that a standard structure? I’ve no clue about XI but the way you wrote the blog it tends to imply that the structure there is common, so was just wondering how common?

    Craig

    (0) 
    1. Shabarish Vijayakumar Post author
      Hi Craig,

      In usual scenarios we encounter files with structure as something like below,

      01,Header2,Header3,Header4,Header5,Header6,Header7
      02,Body1,Body2,Body3,Body4,Body5
      02,BodyA,BodyB,BodyC,BodyD,BodyE
      03,Trailer

      wherein the key fields occur at the start of each record. But there might be situations where the key field might not be the first field (as shown in this weblog where i have mentioned that the structure shown is contrary to the normal file structures we encounter ) and thus this post addresses this issue.

      ~~ShaBZ~~

      (0) 
  2. Former Member
    Hi Shabrish,

    i had a doubt. The data type that you have shown here is i suppose the sender DT.

    In that case wont MONI throw an error in mapping when one of your xml tag is being replaced by “keyfield”?

    I think according to your blog the DT Sender Structure should be:

    DT_pickfile
    Header
    field1
    keyfield
    field2
    field3
    field4
    .
    .
    .
    .
    so on…..

    Awaiting your response on this.

    Thanks
    Dhwani

    (0) 

Leave a Reply