File Content Conversion : Sender Channel

Hi
  I am trying to do content conversion in the Sender Channel from a flat file to a XML.
My Target XML(message structure) looks like
<H1>
  <H2>
      <D>Detail Record</D>
      <L1>line</L1>
      <L1>line</L1>
  </H2>
  <H2>
      <D>Detail Record</D>
      <L1>line</L1>
      <L1>line</L1>
  </H2>
</H1>
Here the element <H2> is only needed to group <D> and the following <L1> elements of each new occurrence of <D>.
Now my problem is that the element <H2> is not getting created.
and the message after content conversion is looking as follows
<H1>
      <D>Detail Record</D>
      <L1>line</L1>
      <L1>line</L1>
      <D>Detail Record</D>
      <L1>line</L1>
      <L1>line</L1>
</H1>        
What should I do to get the desired result.

@Yes Bhavesh you  are right.
Hi Jai,
       I am trying the other way round.i.e from flat file to a XML message.As I said I was trying to do it for Sender Channel where is the after content conversion I want a XML file.The example is a what I framed out of my actual problem.
if flat file is as follows ,
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
DetailRecord1
Line1
Line2
Line3
DetailRecord2
Line4
Line5
then the XML must look like
<H1>
<H2>
<D>DetailRecord1</D>
<L1>Line1</L1>
<L1>Line2</L1>
<L1>Line3</L1>
</H2>
<H2>
<D>DetailRecord2</D>
<L1>Line4</L1>
<L1>Line5</L1>
</H2>
</H1>
I identify the different types records in the flat file
as follows,
Record starting with "Detail" is considered as <D> element
Record starting with "Line"  is considered as <L> element.
Hope I did clarify.

Similar Messages

  • File content conversion sender adapter

    Hi Friends,
    I am doing File to IDoc scenario.
    I am using File Content Conversion for File Adapter.
    My structure look like this
    MT_File
    HEADER1 1..1
    --header1
    -- header2
    HEADER2 1..1
      --header3
    DETAILS 1..unbounded
    --details1
    --details2
    --details3
    TRAILER1 1..1
      -- trailer1
    TRAILER2 1..1
      -- trailer2
    ----trailer3
    In File Content conversion parameeters..
    Document Name :MT_File
    Document Namespace :urn:test:FileFcctoIdoc
    RecordSet name :
    RecordsetStructure :HEADER1,1,HEADER2,1,DETAILS,*,TRAILER1,1,TRAILER2,1
    RecordSet Structure: Ascending
    RecordSet Per message : *
    Key Field Name :header1,header3,details1,trailer1,trailer3
    ignoreRecordsetName     : true
    HEADER1.fieldNames      :header1,header2
    HEADER1.keyFieldValue      : H1
    HEADER1.fieldFixedLengths  :5,10
    HEADER1.endSeparator   :'nl'
    HEADER2.fieldNames             :header3
    HEADER2.keyFieldValue         : *D
    HEADER2.fieldFixedLengths     :5
    HEADER2.endSeparator         :'nl'
    DETAILS.fieldNames               :details1,details2,details3
    DETAILS.keyFieldValue         : 3
    DETAILS.fieldFixedLengths     :5,5,5
    DETAILS.endSeparator         :'nl'
    TRAILER1.fieldNames               :trailer1
    TRAILER1.keyFieldValue         : *S
    TRAILER1.fieldFixedLengths     :5
    TRAILER1.endSeparator         :'nl'
    TRAILER2.fieldNames               :trailer2,trailer3
    TRAILER2.keyFieldValue         :SE    TRAILER2.fieldFixedLengths    :5,5
    TRAILER2.endSeparator         :'nl'
    File is :
    H1hh1hhhhhhhhh2
    *Ddd*
    Xddd1dddd2dddd3
    Xddd4dddd5dddd6
    Xddd7dddd8dddd9
    *Sss*
    SEKss2
    in RWB, Channel CC_FILE_Sender_FccDemo: Empty document found. Proceed without sending message
    I think the problem is in FCC paramters..
    Could please have a look and correct me
    Regards
    Ram

    Ram,
    The problem which i can see is your key field values in your test file. Remember you should have the key field value in each new line at the same place.
    For example you have given your text file as shown below...
    File Given By You is :
    >H1hh1hhhhhhhhh2
    >*Ddd *
    >Xddd1dddd2dddd3
    >Xddd4dddd5dddd6
    >Xddd7dddd8dddd9
    >*Sss *
    >SEKss2
    Compair the above file with the below one..
    >H1hh1hhhhhhhhh2
    >*Ddd *
    >Xddd1dddd2dddd3
    >Xddd4dddd5dddd3
    >Xddd7dddd8dddd3
    > *Sss *
    >SEKss2
    If you notice, for details I have given key field value 3 in each line & at same place.
    One more thing just use the KeyFieldName only one ( just follow the same blog which I have given, to understand how to use the KeyFieldName )
    e.g.
    Document Name :MT_File
    Document Namespace :urn:test:FileFcctoIdoc
    RecordSet name :
    RecordsetStructure :HEADER1,1,HEADER2,1,DETAILS,*,TRAILER1,1,TRAILER2,1
    RecordSet Structure: Ascending
    RecordSet Per message : *
    Key Field Name : KF
    Regards,
    Sarvesh

  • File content conversion - sender adapter for Header and detail records

    Hi Experts,
                     I am receiving a field of fixed length content format.(Header)The first line of the file will follow the structure X having some fields and (DetailRecord)subsequent lines in the file will follow structure Y having somes fields.There is no record identifier for Header and Detail records.In one file first line is Header records and remaining subsequent line is DetailRecord.What are the parameters we have to set for sender file content conversion parameters as i donot have any key field and key field value.And in one file we have only one header records ( first line) and n number of detail records from 2nd line onwards.
    Thanks
    Deepak

    Hi
    Refer the below fourm link,
    Flat file whitout id
    Regards
    Ramg.

  • File Content Conversion Receiver Channel

    Hi,
    I have a complex structure like:
    <Header>
    </Header>
    <Item>
      <SubItem>
        <Info>
        </Info>
      </Subitem>
    </Item
    <Item>
      <SubItem>
        <Info>
        </Info>
      </Subitem>
    </Item
    When I follow the instructions for File Content conversion I cannot separate the Item / SubItem and Info segments into separate lines in my flat file.
    The result is:
    Header
    Item Subitem Info
    Item Subitem Info
    I want
    Header
    Item
    Subitem
    Info
    Item
    Subitem
    Info
    How can i establish the correct result?
    Best regards
    Ron.

    Hi,
    I specified the following
    Name                                                                   value
    Header.addHeaderLine                 0
    Header.fieldSeparator                   ;
    Header.endSeparator                   'nl'
    Item.addHeaderLine                     0
    Item.fieldSeparator                       ;
    Item.endSeparator                       'nl'
    Subitem.addHeaderLine               0
    Subitem.fieldSeparator                 ;
    Subitem.endSeparator                  'nl'
    Info.addHeaderLine                       0
    Info.fieldSeparator                        ;
    Info.endSeparator                         'nl'
    Best Regards
    Ron

  • Problem with Sender File Content Conversion Communication Channel

    Hi All,
    I am using XI 3.0--SP 16.
    I have configured a Sender communication channel with File Content Converison which takes up a Fixed length text file and converts to XML.
    My scenario is that I have some 'n' files, out of which one file has error in content conversion.
    In a normal scenario I would expect other files to get processed, but they are not.
    I can correct the error or even discard the error file. But I am unable to understand why XI is not processing the rest of the good files.
    Thanks in advance.
    Regards.,
    Sudharshan

    Hi,
    @Renjith
    The QOS is EO, thats why I am wondering why it is not picking the rest of the good ones
    Regards,
    Sudharshan

  • .csv file Vs .txt file Content conversion sender file channel

    Hi Experts,
                     I have a file with filename say input.csv.I want to do content conversion for these .CSV file.Is it same like we have to do for .txt file say input.txt.
    when i open my .csv file in notepad, i get multiple rows with each field separated by ';'.what are the content conversion parameters we have to define for .csv file and can we mention input.csv as the file name as a source file name.
    Thanks
    Deepak

    Hi,
    Use the following parameters for Sender file channel in case of reading .csv file
    Recordset Structure.fieldSeparator -
    Recordset Structure.endSeparator -
    'nl'
    Recordset Structure.fieldNames -
    provide field names separated with ,
    Regards
    Seshagiri

  • Strange Problem with File Content Conversion (Sender)

    Hi,
    I have a strange problem. I have a sender file adapter with content conversion (csv -> xml). The adapter produces the following error during the processing...
    - 2006-02-06 16:34:00 CET: Error: Conversion of part of file content of 'OE_Extractor_47_ISW112_SC-Ireland.csv' to XML format failed around position 1202: IOException: Stream closed
    After the 4th or 5th try the adapter processes the file correctly.
    Why does it works after several tries and not at the first time? (The file is not changed during the adapter is trying to convert it)
    Thanks
    Thomas

    I found the problem, something was wrong with the ftp server

  • File Content Conversion Sender. Enclosured info

    Hi experts,
    I have to read a plain file like this:
    x
    x
    x
    x
    x
    <START-OF-FILE>
    a;b;c;d;
    a;b;c;d;
    a;b;c;d;
    <END-OF-FILE>
    x
    x
    x
    x
    x
    Where 'x' means unuseful and unformatted lines, and 'a','b','c','d' are the fields to be parsed to xml.
    I wonder whether there is a way, using FCC in the file sender adapter, to gather only the lines enclosured between '<START-OF-FILE>' and '<END-OF-FILE>'. There is no key field I can use.
    Many thanks in advance,
    Paco

    Hi Francisco,
    I think u need to write a UDF to achieve the requirement.
    And, I think there is a possibility to do it using content conversion.
    Use set NameA.fieldFixedLengths for the unused data in the file.
    use NameA.fieldContentFormatting - Enter trim to remove all the leading and subsequent blanks for a value found. This is the default.
    If there is any field length restriction use NameA.fieldFixedLengths.
    NameA.fieldSeparator & NameA.endSeparator shoulf be used.
    NameA.additionalLastFields
    If the inbound structure has more fields than specified in the configuration then the XML outbound structure is created as follows:
    ○       ignore
    Outbound structure only contains the fields in the inbound structure
    ○       error
    Conversion is terminated due to the incomplete inbound structure. An error message is displayed.
    The default value is ignore. If you have defined the NameA.fieldFixedLengths parameter, the default value is error.
    I hope this info will help you.
    Refer the below link:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    Regards,

  • File Content Conversion (Sender) endSeparator Problem

    Hi
    i have a flat file like this:
    fieldA;fieldB;fieldC;fieldA;fieldB;fieldC;fieldA ...
    recordset structure: FIELDS,1
    recordset per msg: *
    parameters:
    FIELDS.fieldNames = fieldA,fieldB,fieldC
    FIELDS.fieldSeparator = ;
    FIELDS.endSeparator = ;
    if i change the endSeparator to 'nl' and then changeing the input file to this:
    fieldA;fieldB;fieldC
    fieldA;fieldB;fieldC
    fieldA ...
    it works. i already tried to use another endSeparator like this:
    fieldA;fieldB;fieldC:fieldA;fieldB;fieldC:fieldA ...
    but it doesn't work. it seems like the adapter is only using 'nl' endSeparator, no matter whats the parameters say.
    the error in adapter monitoring:
    Error: Conversion of complete file content to XML format failed around position 0 with java.lang.Exception: ERROR converting document line no. 1 according to structure 'FIELDS':java.lang.Exception: ERROR in configuration: more elements in file csv structure than field names specified!
    i already tried to use hex separators and found the following thread (best matching tread):
    anyone has an idea? Thanks a lot.
    Regards
    J.
    Message was edited by: Jörg Pieper
    Message was edited by: Jörg Pieper

    Hi
    this doesn't work
    Regards
    J.

  • File Content Conversion: Sender Problem

    Hi,
    I'm getting a very typical error in my Sender Communciation channel.
    Channel CC_FILE_SENDER_2: Empty document found. Proceed without sending message
    I've gone through a few threads and I know that the problem is with the Key Field and using * in the Recordset Structure but I cannot solve it. If I use * in the Recordset structure it fails,when I use a specific number it works. Any ideas
    Here is my Communication Channel details
    Document Name: MT_SENDER
    Document namespace: http:\\sender
    Recordset Structure: FileHeaderRecord1,1,FileHeaderRecord2,1,FileHeaderRecord3,1,FileDetailRecord,*,FileTrailerRecord1,1
    Recordset Sequence: Ascending
    Key Field Name: RType
    And the configuration:
    FileHeaderRecord1.fieldNames:             RType,Filler,Code,Filler2
    FileHeaderRecord1.fieldFixedLengths:  10,31,6,69
    FileHeaderRecord1.keyFieldValue:         V 
    FileHeaderRecord2.fieldNames:            RType,Filler
    FileHeaderRecord2.fieldFixedLengths:  3,113
    FileHeaderRecord2.keyFieldValue:        HDR1
    FileHeaderRecord2.fieldNames:            RType,Filler,Date,File,Filler2,Num,Filler3
    FileHeaderRecord3.fieldFixedLengths: 3,2,5,6,21,3,76
    FileHeaderRecord3.keyFieldValue:        UH1
    FileDetailRecord.fieldNames:                 RType,Filler,TCode,Filler1,Amount,Filler2,ZGC,Filler3,Date,Filler4
    FileDetailRecord.fieldFixedLengths:       14,1,2,18,11,18,9,28,5,10
    FileDetailRecord.keyFieldValue:             9
    FileTrailerRecord1.fieldNames:              RType,Filler,TCode,Filler1,Date
    FileTrailerRecord1.fieldFixedLengths:   14,1,2,12,5
    FileTrailerRecord1.keyFieldValue:          UT1
    ignoreRecordsetName:                           true
    This is a copy of my file....
    VPR456SCL1                               852086                                                                               
    HDR1 SED456RD  345344500428            F     04 094520428     BS   09452                                                       
    UHL1 09452ESBCL1    00000000         004                                                                               
    85208681123787085              000000000000500FREW RTYU POSWS123704375                            09452                     
    85208681123787085              000000000000600FREW RTYU POSWS123705307                            09452                     
    85208681123787085              000000000000600FREW RTYU POSWS123705671                            09452

    Hi,
    problem is in your keyfield value,
    FileHeaderRecord1.fieldNames:             RType,Filler,Code,Filler2
    FileHeaderRecord1.fieldFixedLengths:  10,31,6,69
    FileHeaderRecord1.keyFieldValue:         V
    keyfield name is RType and it is given a fixedlength of 10 characters, but your keyfieldvalue is "V
    " which is not 10 char long that is the reason your adapter is failing to pick it.
    same for all the other recordsets, the fieldvalue shd match the fixed length given.
    Eg:- give keyfieldvalue like this "V         ". it will work.

  • File Content Conversion - Sender File Adapter - Record Delimeter ~

    The inbound file has file has ~ as record delimeter. I am using the FCC at sender file adapter to covert this file into XML. Somehow, the file adapter is not able to interpret "~" as my record delimeter even thoough I specified "record.endSeparator = ~" in FCC.
    Would someone help me with a solution?

    Raju,
    You can also try to use the '0x7E' as endSeperator condition.
    I am not sure if the HTML tag will work but this should do the trick. This should be the HEX corresponding entry
    char       description        hex               char code       html
    " ~ "         "Tilde"               "0x7e"         "~"                      &!tilde; (without !)
    greets.
    in adition to this see SAP help
    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/655453b48a4ddfe10000000a1553f7/frameset.htm
    Special Characters in Strings for Separators
    In all strings for separators (NameA.fieldSeparator, NameA.beginSeparator, 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 encoded as a hexadecimal value.
    Please also ensure that the "recordSet Structure" also need to be configured Correctly
    for example:
    Header,1,Detail,*
    Header.fieldSeperator  --> %parameter%
    Detail.fieldSeperator --> %parameter%
    Detail.endSeparator --> '0x7e'
    Greets

  • File content conversion:move files to a new directory

    hi all,
              I have a file content conversion sender and receiver scenario.Now my doubt is: XI is running on sap27 server.Input file is being created by an ABAP program in r/3 and file being put in sap29 server.
    In source directory if i am giving the sap29 path it is not working.Is there any way that i can write a OS command to move files from 29 to 27 before message processing ??
    Any other option available??
    thanks,
    Nisheeta

    hi,
          Yes the basis people have shared the folder and they have mapped the sap29 folder into sap27 using I:\ drive
    But the files are not getting picked....am i giving the source directory wrong??
    I am giving I:\Folder_Name
    suggestions needed
    thanks,
    Nisheeta

  • Remove of quotes"' in the sender file adapter -- file content conversion

    HI Guys,
    MY source file is comma seprated file (,) in the file i had quotes" " for the data like
    "5000543","0.00","03/04/2009",
    is there any way i can remove the quotes in file content conversion
    Please help me on this
    Regards
    Srinivas

    Srinivas,
    This should not be a big deal, because your fields are separated by a comma. So you need to keep in mind like you are doing the content conversion for a csv file.
    See this blogs for some information:
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    In the second blog 1345 there are parameters for content conversion. So similarly mention your conversion parameters in your sender communication channel. So after converting to xml your input fields have values like:
    field1:  "5000543"
    field2:  "0.00"
    field3: "03/04/2009"
    So all your field values has with "". Now you can use either standard replace funciton or a udf as given above and then it will remove the quotes and then you can map according to your requirements. If you think sometimes you can get quotes and sometime not in the file then you can use function like startswith or endswith along with exists and can map accordingly.
    Regards,
    ---Satish

  • File Content Conversion in Sender File

    how to convert a fixed length flat file without end seperator sent to XI to a xml form?
    Pleasegive me the idea of Sender Adapter configuration details (esp endSeperator)

    Hi,
    For file content convertion if there are fixed lenth then no need to give the feildseperator,just give the fixed lenths for all the feild in FCC.
    check below links for FCC
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    Regards,
    Phani.
    Reward Points If Helpful

  • Problem with Sender Adapter File Content Conversion

    Hi all!
    I have a question about file content conversion in sender file adapter.
    I have file like:
    {field1
    field2
    field3
    field4
    $
    {field5
    field6
    field7
    field8
    And i need to get file like:
    <dealings>
    <deal>
    <field1>{field1</field1>
    <field2>field2</field2>
    <field3>field3</field3>
    <field4>field4</field4>
    <field5>-}*</field5>
    </deal>
    <deal>
    <field1>{field5</field1>
    <field2>field6</field2>
    <field3>field7</field3>
    <field4>field8</field4>
    <field5>-}*</field5>
    </deal>
    </dealings>
    I put content conversion parameters:
    deal.fieldSeparator = $
    deal.fieldNames = field1,field2,field3,field4,field5
    And i get a file like:
    <ns:mt_swift_file>
    <dealings>
    <deal>
    <field1>{field1</field1>
    </deal>
    <deal>
    <field1>field2</field1>
    </deal>
    <deal>
    <field1>field3</field1>
    </deal>
    <deal>
    <field1>field4</field1>
    </deal>
    <deal>
    <field1>-}*</field1>
    </deal>
    <deal>
    <field1/>
    </deal>
    <deal>
    <field1>{field5</field1>
    </deal>
    <deal>
    <field1>field6</field1>
    </deal>
    <deal>
    <field1>field7</field1>
    </deal>
    <deal>
    <field1>field8</field1>
    </deal>
    <deal>
    <field1>-}*</field1>
    </deal>
    </dealings>
    </ns:mt_swift_file>
    What i do wrong?
    As i understand, XI put string to a separate tag after symbol 'nl', but how can i get structure without unnecessary tags?

    Hi,
    Check some links for FCC
    Introduction to simple(File-XI-File)scenario and complete walk through for starters(Part1)
    Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)
    File Receiver with Content Conversion
    Content Conversion (Pattern/Random content in input file)
    NAB the TAB (File Adapter)
    Introduction to simple(File-XI-File)scenario and complete walk through for starters(Part1)
    Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)
    How to send a flat file with various field lengths and variable substructures to XI 3.0
    Content Conversion (Pattern/Random content in input file)
    NAB the TAB (File Adapter)
    File Content Conversion for Unequal Number of Columns
    Content Conversion ( The Key Field Problem )
    The specified item was not found.
    File Receiver with Content Conversion
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    Regards,
    Phani

Maybe you are looking for