File to IDOC (content conversion)

Hi,
My scenario is File to IDOC.
My input file is as
"AAA",399,"DD",20050302,100642,3289
"B01","E",20051,39.1,"AC","M","L"
"B01","L",20051,38.3,"AC","F","D"
"B01","L",20301,37.7,"AC","F","W"
"L9",50
wherein the structure should look as follows:
<root>
      <header>                  => occurence 1
            <hdata1>.....</hdata1>
            <hdatan>.....</hdatan>
            <body>               => occurance unbounded
              <data1>.....</data1>
              <datan>.....</datan>
            </body>
      </header>
      <trailer>                => occurance 1
           <data2>....</data2>
      </trailer>
</root>
Now my question is that how do we go for the content conversion in this scenario.(the problem is that header contains element data and subnode body)
Regards,
Shabz

Hi Amanda..
Thanx 4 the response.
But i have a query, since the target idoc is structured
with the heirarcy ( a header and a body inside the header, a footer ) during file conversion, if we change the structure as u said will that affect the context while the mapping takes place.
Ref: IDoc structure is
               A
_B
               C
Regards,
ShabZ
PS: I am not able to test your suggestion as my system is down

Similar Messages

  • File Adapter with Content Conversion

    Hi -
    I am trying to convert a Flat file which has data as
    firstnamelastnamecompanyName
    Now i have created a message type which has a root name as Contact and its children are FirstName,LastName,Company.
    And in the configurator i have created a file adapter with the content conversion, but being very new to XI i have never used a file adapter with content conversion.  This is what i have in my Content Conversion Parameters.Please correct my code.
    Document Name      ::   MT_Contact
    Document Namespace ::   http://venkat
    Document Offset    :: <i>i did not enter anything here</i>
    Recordset Name     ::   RootNode(i gave this name just like that,,, Should it be something from the IR??
    Recordset NameSpace:: <i>i did not enter anything here</i>
    Recordset Structure::   Contact (this is the name in my IR
    Recordset Sequence ::  Ascending
    Recordsets per Message :: Contact,* (Can someone explain what should be given here)
    Then in the bottom in the name value pairs i have given
    Contact.fieldNames   =   FirstName,LastName,Company
    Contact.fieldSeparator = #
    When i am using the above configuration the error i am getting in RWB is Error: Conversion initialization failed: Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
    Format error in 'xml.recordset' argument: incomplete structure (name,number) pairInvalid 'xml.recordsetsPerMessage' value 'Contact,*' found
    I am very new to XI and i am unable to understand what exactly each field means in the file adapter when the content coversion is used. Can someone take the pain of explaining them.
    Thank you
    Venkat

    Hi,
    Use the following to create an XML strucutre like this,
    <MT_CONTACT>
    <CONTACT>
    <FirstName> </FirstName>
    <LastName> </LastName>
    <CompanyName> </CompanyName>
    </CONTACT>
    <MT_CONTACT>
    DocumentName : MT_TEST
    DocumentNamespace : Yournamespace
    RecordserName : record
    RecordsetStructure : CONTACT,1
    In the table,
    ignoreRecordsetName  : true
    CONTACT.fieldNames : FirstName,LastName,CompanyName
    CONTACT.fieldSeparator : #
    Go through the links suggested by moorthy and also these blogs to understand content conversion better,
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    /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/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    /people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter
    Regards,
    Bhavesh

  • File sender with content conversion and ignoreRecordsetName

    Him,
    I have an scenario with a compressed file sender with content conversion.
    In my sender cc i have:
    1     AF_Modules/PayloadZipBean     Local Enterprise Bean     unzip
    2     AF_Modules/MessageTransformBean     Local Enterprise Bean     transform
    3     CallSapAdapter     Local Enterprise Bean     2
    In module configuration, I have also added:
    xml.ignoreRecordsetName  --> true
    But RecordsetName is not removed from XML
    Why?
    thanks, in advance
    Carme

    Hi,
    No need to enter anything in module configuration. Just specify following Name-Value pair in the table provided on the Content Conversion tab of your file adapter.
    Add a row with Name = ignoreRecordsetName and Value = true (Both case-sensitive)
    For details, see [this link|http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm].
    [some more here|http://www.riyaz.net/blog/index.php/2008/02/20/xipi-file-content-conversion-for-complex-structures/]
    Regards,
    Riyaz

  • Idoc to File scenario: receiver content conversion

    Hi,
    I have a Idoc to file scenario in which each segment is to be sent in a new line.
    Also, even if the segment is not present in Idoc, comma separated blank values are to be sent.
    Till now I have been fllowing this blog
    File Content Conversion for Multi Hierarchical Structure
    But in this case, blank values csv line are not created.
    When I used mapWithDefault for parent WPA12 then only 1 instance is created.
    For eg.
    WPA01
    -WPA02
    --WPA12
    WPA01
    -WPA02
    --WPA12
    There are no values in WPA12 segment
    Output
    WPA01,a,a,a,a
    WPA02,b,b,b,b
    WPA12,,,,,
    WPA01,c,c,c,c
    WPA02,d,d,d,d
    Can I make any change in the approach as in the blog to get the desired output?
    Regards,
    Anirudh.

    Hi,
    To explain more a bit..
    My requirement is to create a flat file from multiple hierarchical xml structure.
    Additionally, if the values are not present for some nodes then also I have to send the blank values in flat files. If entire segment is not present then also blank csvs needed to be sent.
    regards, Anirudh.

  • Attachment of original message in file sender adapter content conversion

    Hi,
    does anybody know how I can configure a file sender communication channel (with content conversion) so that the original file is added to the XI SOAP message as attachment? Maybe this is just a parameter in "Advanced" tab. (The content conversion itself is not an issue.)
    The result should be the "Main Document" (XML-message) and the "original document" as two attachments in the SOAP payload.
    The reason for this is that the original file should be archived with the XML message as it was before the XML content conversion of the file sender adapter took place.
    Thanks,
    Philipp

    original file is added to the XI SOAP message as attachment?
    The "Advanced" tab -> additional files added in file adapter should act as the attachment to soap receiver adapter if u select the "Keep Attachments" option in soap receiver communication channel.
    What do u want to do in FCC is a bit unclear?
    Regards,
    Prateek

  • File sender adapter: Content conversion for very deep nested structure

    Hi all
    I have a file which looks like this
    HDOCKET    9800000660980000061911062009AA123456bbWM100012349800000619
    DDOCKET_TEST001 4012YAG1 
    WZOA00000000010000000001
    WZOA00000000020000000002
    WZOB00000000030000000003
    IAAXX000001
    IAAXX000002
    C0000000000000000000100000000000000000001000000000000000000020000000000000000000300000000000000000004
    T2
    and my structure is
    Header  - 1
    Detail     - 0....Unbounded
            Bag     - 0.....Unbounded   (sub node of detail)
            Track  - 0.....Unbounded    (sub node of detail)
            Customer - 0.....Unbounded    (sub node of detail)
    Trailer    - 1
    and in the file sender adapter i mentioned the following content conversion setting
    HEADER,1,DETAIL,*,Bag,*,Track,*,Customer,*,TRAILER,*
    But when i go and see in the monitoring i received the following conversion
    <?xml version="1.0" encoding="utf-8" ?>
    <ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
    <HEADER>
      <ID>H</ID>
      <INT>DD</INT>
      <CAR>9899999660</CAR>
      <CUS>9899999619</CUS>
      <POST>11062009</POST>
      <NUMBER>AA123456bbWM10001234</NUMBER>
      <ACC>9899999619</ACC>
      </HEADER>
    <DETAIL>
      <ID>D</ID>
      <Bag>DOCKET_TEST001</Bag>
      <S>4012</S>
      <Code>YAG</Code>
      <mat>1</mat>
      <count/>
      <Mixed />
      </DETAIL>
    <Bag>
      <ID>W</ID>
      <Zone>ZOA</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>ZOA</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>ZOA</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
      </Bag>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Track>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Tracked>
    <Customer>
      <ID>C</ID>
      <OrigCustomer>00000000000000000001</OrigCustomer>
      <Field1>00000000000000000001</Field1>
      <Field2>00000000000000000002</Field2>
      <Field3>00000000000000000003</Field3>
      <Field4>00000000000000000004</Field4>
      </Customer>
    <TRAILER>
      <ID>T</ID>
      <Count>2</Count>
      </TRAILER>
      </ns:MT_REQ>
    whereas i wanted it like:
    <?xml version="1.0" encoding="utf-8" ?>
    <ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
    <HEADER>
      <ID>H</ID>
      <INT>DD</INT>
      <CAR>9899999660</CAR>
      <CUS>9899999619</CUS>
      <POST>11062009</POST>
      <NUMBER>AA123456bbWM10001234</NUMBER>
      <ACC>9899999619</ACC>
      </HEADER>
    <DETAIL>
      <ID>D</ID>
      <Bag>DD_TEST001</Bag>
      <S>4012</S>
      <Code>egg</Code>
      <mat>1</mat>
      <count/>
      <Mixed />
    <Bag>
      <ID>W</ID>
      <Zone>zzz</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>zzz</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>zzz</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
      </Bag>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Track>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Tracked>
    <Customer>
      <ID>C</ID>
      <OrigCustomer>00000000000000000001</OrigCustomer>
      <Field1>00000000000000000001</Field1>
      <Field2>00000000000000000002</Field2>
      <Field3>00000000000000000003</Field3>
      <Field4>00000000000000000004</Field4>
      </Customer>
    </DETAIL>
    <DETAIL>
      <ID>D</ID>
      <Bag>DD_TEST002</Bag>
      <S>4012</S>
      <Code>egg</Code>
      <mat>1</mat>
      <count/>
      <Mixed />
    <Bag>
      <ID>W</ID>
      <Zone>zzzzzz</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>ZOA</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>zzz</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
      </Bag>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Track>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Tracked>
    <Customer>
      <ID>C</ID>
      <OrigCustomer>00000000000000000001</OrigCustomer>
      <Field1>00000000000000000001</Field1>
      <Field2>00000000000000000002</Field2>
      <Field3>00000000000000000003</Field3>
      <Field4>00000000000000000004</Field4>
      </Customer>
    </DETAIL>
    <TRAILER>
      <ID>T</ID>
      <Count>2</Count>
      </TRAILER>
      </ns:MT_REQ>
    i.e. i need all Bag ,Track and Customer inside detail tag.
    could anyone help me in this..i've already searched SDN and got some link as useful but none of them were totally related.
    Regards
    Naina

    Naina
    Pls. check my forum link, i had the single level hierarchy XML file which I converted into nested structure & then into flat file.
    File Conversion in Rec File Adapter with subnodes
    This can give you an idea how to go ahead. Let me know in case you need any more info about this.

  • File Receiver Adapter - Content Conversion

    Dear All,
    We are using <b>DB to file Scenario</b>.We are using File Content conversion to get a File Comma Separated.
    Data is picked up from the DB and our payload before getting in to File adapter is given below.
      <?xml version="1.0" encoding="UTF-8" ?>
         <ns6:AssoInfo_MT xmlns:ns6="urn:NDB2File2DB">
         <AssoInfoList>
          <AssoInfoNode>
           <Name>ABCX</Name>
           <ID>31154</ID>
           <Salary>10000.0</Salary>
          </AssoInfoNode>
         <AssoInfoNode>
           <Name>ASDAS</Name>
           <ID>18978</ID>
           <Salary>10000.0</Salary>
         </AssoInfoNode>
         </AssoInfoList>
      </ns6:AssoInfo_MT>
    In File content conversion we are giving
         <b>AssoInfoNode.addHeaderLine = 0
            AssoInfoNode.fieldSeparator = ,
            AssoInfoNode.endSeparator = 'nl'</b>
    We are getting output as
    <b>ABCX,ASDAS</b>
    But the <b>expected</b> output is
    ABCX,31154,10000.0
    ASDAS,18978,10000.0
    What change we need to do in our File Receiver Adapter configuration.
    Regards,
    Vedavyas

    Hello,
    Test without these 2 options :
         AssoInfoNode.addHeaderLine = 0
         AssoInfoNode.endSeparator = 'nl'
    I think your problem is with the "endSeparator", it is not necessary.
    A new line is created for each new AssoInfoNode automaticaly.
    Regards,
    Chris

  • Sender File Adapter and content conversion

    Hi,
    How can we remove the last line from the file using content conversion?
    The last line should not be read from the input file.
    Like for the first line we can use Document Offset .......similarly do we have any option for the last line?

    >
    neelansha singh wrote:
    > date                       Empno         Empname
    > 19.03.2009            12345            Neel
    > 20.03.2009             34566           Neelkanth
    > EmpDes                 Japan        100
    >
    >
    > The file is like this first row i have removed using document offset.......from 2nd row till nth row the structure is as shown above and the last row has no. of fields 1 less than all other rows and also its root node is different like shown above its rootnode is EmpDes..........How to use File content conversion for this?
    do you want to avoid the last line i.e
    EmpDes                 Japan        100
    in that case the 3 options are
    1. use a adapter module and remove the last line - this is the ideal option
    2. use a OS script - will work but only if you are using the NFS option in the file adapter instead of FTP
    3. read that also using content conversion (treat it as a trailer) and ignore it during the mapping

  • Sender file adapter with content conversion  Simple XML

    Hi experts,
    I'm trying to parametrize my sender file adapter content conversion.
    I'm receiving a text file with one single line like:
    AA1;AA2; AA3;
    and I want to convert it to an XML like
    <MT_A1>
    <field1>AA1</field1>
    <field2>AA2</field2>
    <field3>AA3</field3>
    </MT_A1>
    Actually I know how to do somenthing like
    <MT_A1>
        <LINE>
              <field1>AA1</field1>
              <field2>AA2</field2>
              <field3>AA3</field3>
         <LINE>
    </MT_A1>
    What I want is remove the <LINE> tag from my XML.
    Regards
    Gonzalo
    Edited by: Gonzalo del Castillo on Nov 28, 2008 2:18 PM

    Hi
    Use this help document for receiver FCC
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    Content Conversion (Pattern/Random content in input file)
    File conversion text to xml (Few Last Post)

  • In the Flat file generated after Content Conversion, In NFS AL11 Directries Not able to See complete file

    Hi All,
    My scenario is Proxy to File  scenario.
    I used content conversion for generating flatfile in receiver side.
    In FCC i used fieldFixed Lengths, The flatfile is generated. I gave the Target Directory as AL11 directory(NFS).
    In my scenario length of Header is 622 characters.
    But am getting the file Upto 512 characters. After That I am not getting any fields in the Header, Remaining fields are cut.
    Same I checked with SFTP server with same Content Conversion.It is working good  and I am getting complete Header with 622 characters.
    Can you please suggest what should I do to get the 622 character in NFS, It is accepting only 512 characters in NFS.
    Reagrds,
    Satish

    Satish,
    In addition to Amit,
    AL11 transaction is used to display all the SAP Directories.When you double click on a directory, you will able to see all the files in the directories. But you can not view the complete content of the file from AL11 as there are some restrcitions in it. Even if you download the file from AL11 itself, the actual file won't be downloaded and you will see the file name along with the path inside the downloaded file as same as you can see it in Al11. So if you need the complete and actual file, you need to download the file from the OS level. You can take help from your basis team to download the file.
    Thanks,
    A.B

  • File adapter modules : Access to file data before content conversion

    I have a file sender channel for which content conversion in applied. The incoming file has data in comma separated values format.
    e.g.
    102366,Amol Joshi,DEPT1
    107752,XYZ PQR,DEPT2
    I want to access the the actual data in the file before content conversion takes place. Is it possible to access this data inside the adaper module? I tried creating an adapter module and put it before CallSAPAdapter,it still gets the XML after content conversion as the input data to the module.
    Any pointers?

    Hi Amol,
    I dont know if it is the right approach.
    But if u r not able to meet ur requirement u can do one work around.
    Use Message Transformation Bean to convert it once again in to CSV (flat file structure) and then proceed with ur module.
    There should be a better way than this.
    Hope we could find a better solution in the forum.
    Regards,
    Sudharshan

  • FIle Adapter Receiver - Content Conversion

    I have a xml file as below that I am trying to convert to a simple csv file. All I get is a blank csv file at the ouptput. I tried different setting for the file conversion in the reveiver file adapter. No luck yet. I could write to an output XML file with no problem, so my interface is working!
    The SAP Help doesn't provide  much info on this. Your help is highly appreciated.
    Thnaks.
    ?xml version="1.0" encoding="UTF-8" ?>
    - <ns:PlantMaintenanceMessageType xmlns:ns="http://cs.par/demo/plantmaintenance">
      <EquipmentID>10005661</EquipmentID>
      <FunctionalLocation>KB</FunctionalLocation>
      <Date />
      <Time />
      </ns:PlantMaintenanceMessageType>

    What is your root node ?
    For your content conversion you need to specify the Recordset Structure but in your case i dont find an entry for the same.
    If your XML had an extra tag like
    xml version="1.0" encoding="UTF-8" ?>
    - <ns:PlantMaintenanceMessageType xmlns:ns="http://cs.par/demo/plantmaintenance">
    <b><details></b>
    <EquipmentID>10005661</EquipmentID>
    <FunctionalLocation>KB</FunctionalLocation>
    <Date />
    <Time />
    <b></details></b></ns:PlantMaintenanceMessageType>
    then your record set structure wud be details
    and in you content conversion parameters you cud say
    details.fieldSeparator -> ,
    details.endSeparator 'nl'
    I guess you are on sp13 or above hence there even if you content conversion fails a blank file will be created (thats what i have experienced).
    Reagrds,
    ShaBZ

  • File Sender Adapter: Content Conversion :Mandatory parameter 'xml.keyfieldN

    i have a scenario where i had to pick a flat file and post it to RFC.
    on the basis of keyfields i had to pick the values
    <b>but i am getting mandatort field xml.keyfieldnamec: no value</b>
    my flat file is of type :
    E2EDL20                       0200083662685
    E2EDL24                       02090000110786293200PCE
    E2EDL24                       02090000210786301895PCE
    E2EDL20                       0200083662685
    E2EDL24                       02090000110786293200PCE
    E2EDL24                       02090000210786301895PCE
    My FCC parameters are :
    RecordSet Structure :E2ED20,,E2E24,
    RecordSet sequence :Ascending
    Keyfield Name: KG
    E2ED20.fieldNames                     KEY01,VBELN
    E2ED20.keyFieldName     KEY01
    E2ED20.keyFieldValue     'E2EEDL20'
    E2ED20.fieldFixedLengths     7,33
    E2ED20.endSeparator     'nl'
    E2ED20.processFieldNames     fromConfiguration
    E2E24.keyFieldName                     KEY02
    E2E24.keyFieldValue                     'E2EEDL24'
    E2E24.fieldNames                      KEY02,POSNR,CHARG,LFIMG,MEINS
    E2E24.fieldFixedLengths     7,29,10,4,3
    E2E24.endSeparator                     'nl'
    E2E24.processFieldNames     fromConfiguration
    KEY01,KEY02 i had 2 field added in DataType to identify :E2EEDL20,E2EEDL24.
    THx

    Hi,
    The FCC u have provided..
    RecordSet Structure :E2ED20,,E2E24,
    RecordSet sequence :Ascending
    <b>>>Keyfield Name: KG</b>
    E2ED20.fieldNames KEY01,VBELN
    <b>>>E2ED20.keyFieldName KEY01</b>
    E2ED20.keyFieldValue 'E2EEDL20'
    E2ED20.fieldFixedLengths 7,33
    E2ED20.endSeparator 'nl'
    E2ED20.processFieldNames fromConfiguration
    U have specified the keyfield two times....
    either u can remove <b>>>E2ED20.keyFieldName KEY01</b> from fcc and change ut DT to have a field KG to hold the keyvalue or
    u can remove <b>>>Keyfield Name: KG</b> so that the field specified by the <b>field.keyFieldName</b> is used to identify the keyfield...
    Regards
    Santhosh
    Remember to set the thread to solved when you have received a solution

  • File Synchronous with Content conversion

    Hi
    I am doing the scenario file-xi-rfc-file basically sysnchronous scenario..if i used the XML file as input its working fine ...but if used he CSV file as a input fle is licking up but i am not getting any response..
    Any one have any idea
    venkat

    HI SV
    follow these links to get step by step
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit - File to RFC
    /people/michal.krawczyk2/blog/2005/08/22/xi-maintain-rfc-destinations-centrally - Maintain RFC destination
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/file-rfc-file(Without%2bBPM)
    Weblog to send Response from RFC to File in Asyn Mode Using Proxy [original link is broken]
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=filetorfctofile&adv=false&sortby=cm_rnd_rankvalue
    hope this will solve your problem
    regards
    sandeep
    If helpful kindly reward points

  • File to IDOC with content conversion

    Hi
    I am trying to do a file content conversion scenario. This is a fixed length file which needs to be converted to idoc.
    I have configured IR and ID (FCC parameters added). While testing the end-end scenario we are able to see that sender adapter has successfully read the message , but we are not able to see any message in SXMB_MONI.
    Please help

    Following is the file structure
    "RecordType HeaderField2 HeaderField3"
    "RecordType LineItem2 LineItem3"
    "RecordType TrailerField2 TrailerField3"
    Following are content conversion Parameters [KeyFieldName -> RecordType]
    HeaderRow.beginSeparator -> '"'
    HeaderRow.fieldFixedLengths -> 10,20,10 (for ex)
    HeaderRow.fieldNames -> RecordType,HeaderField2,HeaderField3
    HeaderRow.keyFieldValue -> 01 (COnstant)
    HeaderRow1.endSeparator -> '"'
    Similar for line item and trailer
    Is there any way to check our input file against the content conversion parameters to make sure that they are correct
    Thanks

Maybe you are looking for