Java Mapping Or Adapter Module for MultiLevel File Content Conversion ??

Hi Experts,
Hi All,
As we all know file content conversion cannot parse more than three level even if we use FCC paramenters or MessageTransform Bean /StrictXmlToPlain Bean.
Currently i am facing an scenario where i can expect an content coversion with four or five levels.
for ex.
Target Message Looks like
Header(0..1)
       |_____X
       |_____Y
       |_____Detail(0.n)
             |____A
             |____B
             |____SubDetail(0.n)
                    |_____Trailer(0.n)
                            |______rec1
                            |______rec2
                            |______rec3(0..n)
                                   |______Subrec1
                                   |______Subrec2
So my question how can i do the FixedLength/CSV in the target system ???
Shall i do java mapping ? if yes then any code example relevant to this type of scenario
Shall i do adapter module development ?if yes then any code example relevant to this type of scenario
Thanks In Advance
Ronit Mishra

Target Message Looks like
Header(0..1)----
Level 1
       |_____X
       |_____Y
       |_____Detail(0.n)----
Level 2
             |____A
             |____B
             |____SubDetail(0.n)----
Level 3
                    |_____Trailer(0.n)----
Level 4
                            |______rec1
                            |______rec2
                            |______rec3(0..n)----
Level 5
                                   |______Subrec1
                                   |______Subrec2

Similar Messages

  • Adapter Module for Sender File Adapter to access a Flat file

    Hi,
    We have a scenario where the source is a flat file.I want to develop an Adapter Module to make a small change to every line in the Flat file.
    Now how do we read a flat file in the Adapter Module?Coz the flat file will be converted to XML file by the Standard Adapter Module of the File adapter.
    Please help me out with this.
    Thank you,
    Anu.

    Hi Anu,
    If you are not using Content Conversion option Standard Adapter Module does not convert the Flat file to XML .
    You can directly access the payload as it is in flat file in the Adapter Module and make changes.
    Use the Standard classes ModuleData & moduleContext to fetch the Payload.
    chk this :
    Customized Sender Adapter Module
    XI: Read data from PDF file in Sender Adapter
    regards
    Ganga

  • Regarding Adapter Module for Duplicate file handling at Sender side

    Hi All
    my requirement is to develop a adapter module . Source is FTP  target is R/3  .source Commuincation cahnnel is File sender .
    want to handle duplicate files
    can any one provide  me what are all the steps being used for the same .
    any step-via -step doc will be helpful for me ......and adapetr module will be written in NetWeaver Developer studio or which s/W ????
    also where to put the ejb or import the ejb s...
    Pls help
    Regards
    Priya

    Hi Priya,
    YES YOU NEED SAP NetWeaver Developer studio to develop Adapter Modules,or you can use any othe IDEs like Eclipse ....many documents available in sdn ,how to develop AM,refer below link it explaines clearly
    let me know which version of XI u working on,if it PI7.1 jar files different.
    http://wiki.sdn.sap.com/wiki/display/stage/AdapterModuleToReadExcelFilewithMultipleRowsandMultiple+Columns
    Regards,
    Raj

  • Nested structur for receiver file content conversion

    Hello all,
    i have the following problem to set up a nested XML-structure to an flatfile.
    XML-Structure:
    LtcRecords (root)
       Header
       Deduction
       Trailer
    Now i want to convert the Header,Deduction and Trailer values to an flatfile.
    I tried it with a lot of possibilies. But without an result.
    Recordset Structur: LtcRecords
    LtcRecords.fieldNames: Header,Deduction,Trailer
    Header.fieldFixedLengths: 1,10,5
    Header.fieldNames:id,group_id,location_id
    Deduction.fieldFixedLengths: 1,10,3
    Deduction.fieldNames:id,group_id,product_code
    Trailer.fieldFixedLengths: 1,10,5,3
    Trailer.fieldNames:id,group_id,location_id,product_code
    I hope somebody can help me with my wrong settings.
    Many thanks
    ilka
    Attachments:
    Source:
    <?xml version="1.0" encoding="utf-8" ?>
    <ns1:mt_Metlife0>
         <LtcRecords>
              <Header>
                     <id>A</id>
                    <group_id>0000700015</group_id>
                     <location_id>00002</location_id>
                </Header>
              <Deduction>
                     <id>D</id>
                     <group_id>0000700015</group_id>
                     <product_code>GPC</product_code>
                </Deduction>
              <Trailer>
                     <id>Z</id>
                     <group_id>0000700015</group_id>
                     <location_id>00002</location_id>
                     <product_code>GPC</product_code>
                </Trailer>
         </LtcRecords>
         <LtcRecords>
              <Header>
                     <id>A</id>
                     <group_id>0000700013</group_id>
                     <location_id>00005</location_id>
                </Header>
              <Deduction>
                     <id>D</id>
                     <group_id>0000700013</group_id>
                     <product_code>GPC</product_code>
                </Deduction>
              <Trailer>
                     <id>Z</id>
                     <group_id>0000700013</group_id>
                     <location_id>00005</location_id>
                     <product_code>GPC</product_code>
                </Trailer>
          </LtcRecords>
    </ns1:mt_Metlife0>
    Target:
    A000070001500002
    D0000700015GPC
    Z000070001500002GPC
    A000070001300005
    D0000700013GPC
    Z000070001300005GPC

    Hi
    I tried the same scenario successfully.
    I had given the same input xml and got same output as u want.
    The settings of my File Adapter is as follows:
    Recordset Structure: LtcRecords,Header,Deduction,Trailer
    Header.fieldFixedLengths: 1,10,5
    Header.fieldNames:id,group_id,location_id
    Deduction.fieldFixedLengths: 1,10,3
    Deduction.fieldNames:id,group_id,product_code
    Trailer.fieldFixedLengths: 1,10,5,3
    Trailer.fieldNames:id,group_id,location_id,product_code
    LtcRecord.fieldSeparator:'nl'
    File Type: Text
    File Encoding:UTF-8
    Try with these settings u will definately get the output.
    Regards
    Arpit Seth

  • MalformedInputException Error in Adapter module for SFTP channel

    Dear All,
    I am using MessageTransformBean in adapter module for Plain to XML conversion. The channel works fine in all the cases but when I recieve     "  ì " or few more special characters in the file my channel does not pick file and show below error.
    Error: com.aedaptive.adapter.sftp.SFTPException : Aborting processing: com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
    I am using below parameter value in adapter module.
    Transform.Class : com.sap.aii.messaging.adapter.Conversion
    Transform.ContentType : text/xml;charset=ISO-8859-1
    Please help me if any of you have faces such error in your developments.
    Avanish

    Hi Grzegorg,
    I have tried using UTF-8 encoding in my channel but this doesn't work. Communication cahnnel is still giving same problem.
    Error: com.aedaptive.adapter.sftp.SFTPException : Aborting processing: com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
    The file which we are trying to process have character  Ì and as far as my serach is concerned i think this belongs to charset ISO-8859-1.
    Any more suggestion Guys to solve this problem.
    Thanks and Regards
    Avanish

  • 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.

  • Using XSLT mapping to avoid File content conversion

    Hi all,
    Can we avoid FCC by using XSLT mapping? I have a scenario in which I have to avoid FCC in the adapter and save the file in a excel/csv format. I have been through the different blogs and forums in SDN.
    I have been through Michal Krawczyk's Blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2803. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Got a bit confused whether that blog serves my purpose. Expecting your valid inputs.
    Thanks and regards,
    Harikumar. S

    Hi,
    There are multiple ways in which you can avoid Content Conversion in the Sender / Receiver File adapters.
    I think there was a heated discussion already regarding this in one of your earlier threads,
    Read/Write csv files without file converter
    Basically, if you want to avoid content conversion on the sender file adapter,
    1. Write an Adapter Module. or,
    2. Use a Java Mapping.
    If you want to avoid content conversion on the receiver File adapter,
    1,. Use a Adapter Modules or,
    2. Use Java Or XSLTmapping ( XSLT can be used if the input to the mapping is XML and output needs to be say a Excel File etc).
    Regards
    Bhavesh

  • File Content Conversion in Reciever Adapater for multiple element

    Hi folks,
    My Source file structure  is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:file_sender_mt xmlns:ns0="urn:filetofiledemo">
       <recordset>
          <data1>
             <name1>a</name1>
             <age1>b</age1>
          </data1>
          <data>
             <name>c</name>
             <city>d</city>
             <age>e</age>
          </data>
       </recordset>
    </ns0:file_sender_mt>
    in my file reciever adapter i am uisn file content conversion and these are the parameters that i have given
    reordesetStructure -->
    recordset,data1,data,FileNameNode
    Name                                value
    recordset.fieldSeparator            '0x09'       
    data1.fieldSeparator                '0x09'
    data.fieldSeparator                 '0x09'
    data.endSeparator                   '0x09'
    '0x09' is the hex vale for tab
    My o/p file is coming as
    a     b
    c     d     e
    the desired o/p is 
    a     b     c       d     e
    Any idea on this
    Thanks
    Amit

    Hi Amit,
    You can try using this approach.
    You can create two data types.
    The input data type is of the input file format.
    The output data type can have all the five tags (Name1, Age1, Name, City and age) under one header tag(data1), instead of two tags(Data1, data) in the input file.
    Then in the receiver channel u can define the reordesetStructure -->
    recordset,data1,FileNameNode
    This will produce the output data in one line.
    Regards
    Neetu

  • Required help for Identifying diff. items in file content conversion.

    Hi All,
    I've to use a file content conversion parameters for a .txt file in which there are two objects. One is a header and the other is a item detail.
    How do we get or mark the difference between both so that XI recognizes the particular line is a Header and the other is a Item detail
    Thanks in Advance.
    Regards,
    Sree.

    Hi
    Make use of a field which is common to header and item line which will always hold different values for header and item. Or otherwise if possible, add an extra field in the header and item lines, say 'Key' and use it in the 'Key Field Name' parameter in the adapter configuration. See this for details - [File Content Conversion for Complex Structures|http://www.riyaz.net/blog/index.php/2008/02/20/xipi-file-content-conversion-for-complex-structures/].
    Regards,
    Riyaz

  • File Content Conversion - documentation, especially for all parameters?

    Hi,
    Can anyone point me to do for the File Content Conversion documentation?  especailyl for all the parapters for record set structures?  I've found some articles, posts here and there, but nothing that just lists them all.
    I'm try to parse a flatfile thats simply looks like this:
    abc
    d
    e
    Into a single recordset with 3 structures..
    the first struct has 3 fields, 1 char each
    then 2nd structure has 1 field
    then the 3rd structure has 1 field
    however, no matter what I try, the engine always seems to try to parse the 2nd line as the first structure type.. thus complaining line 2 can't be converted to the first strucuture format...

    Here are couple of weblogs
    For Sender
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    /people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter
    /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/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    SAP Help for sender
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    For Receiver:
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    SAP Help for receiver
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    regards
    SKM

  • Sorting the file in file content conversion.

    Hi all,
    we have a file(xml)-pi-file(flat file) scenario,
    where we need to sort the output file by employee id field.
    Where can we achieve the sorting of file by particular field.
    Do we have any option in Mapping(Functions) ??
    Any option is Reciever File Adapter??
    Reciever File content conversion??
    Any inputs will be of gr8 help.
    Regards.
    santosh.

    Hello,
    Where can we achieve the sorting of file by particular field.
    Do we have any option in Mapping(Functions) ??
    Yes, there is a function in message mapping called sort and sortByKey, these can be found under node functions. To sort the ID, you can use this code
    ID --> removeContext --> sort:(ascending or descending) --> ID
    Use sortByKey to sort the additional details of the flatfile according to ID number e.g.
    ID --> removeContext --> sortByKey:(ascending or descending) --> IDDetails
    Details --> removeContext --> /
    Any option is Reciever File Adapter??
    Reciever File content conversion??
    The receiver file adapter with FCC only converts the structure that is defined in your target message type into, say for example a text file. You have to do the manipulations in the message mapping.
    Hope this helps,
    Mark

  • Adapter Module for File Adapter

    I have a scenario where I have 2 related files (text file and a pdf file) for the message. I need to enhance the payload (content conversion from text file) with the size of the pdf file. I have developed a adapter module for this and it is working fine if there is 1 set of text and pdf file. But if there are more than 1 set of files, it is processing the first set and giving the below error for other files.
    "Error: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback."
    Regards
    Yogesh

    check this thread :
    BaseTransactionRolledbackLocalException in custom adapter module
    Exceptions in Recievr Communication Channel with Adapter Module

  • Adapter Module for receiver IDOC adapter?

    Hi,
    I have a scenario where i need to do some custom logging in the receiver adapters. For all receiver file adapters, i have written an adapter module which fulfills this custom requirement but how will i do this in the receiver IDOC adapter as its on the ABAP stack? I cannot write a java adapter module for this.
    Is there anyway by which i can write a ABAP adapter mosule and deploy it in the IDOC adapter? Or any other way to achive it. the scenario is such that i need to do the logging before the idoc is posted into R/3 system by the idoc adapter.
    Please advice.
    Regards,
    Yash

    Hi Chirag,
    Yes i have seen that the module tab is disabled for idoc adapter. I have a fin interface where i need to split a incoming file into an idoc and a file. For this purpose i need to log how many records are received by each adapter and the sum of the line items for audit perspose.
    any othr way to do it apart from doing it in message mapping. The req is to do in the adapter engine.

  • Developing adapter modules for PI 7.0 using NWDS 7.3

    Hello all,
        Did someone have already developed adapter modules for PI 7.0 using NWDS 7.3? I can´t find the EJB libraries for Java 1.4.
        I'm able to develop mapping programs, but I'm not sure if it is possible to create EJB projects.
    Thanks,
    Marcos

    Hi Marcos,
    I haven't tried developing adapter modules in NWDS 7.3 for PI 7.0 myself, but according to the documentation from SAP it is possible to develop J2EE 1.4 compliant applications i.e. EJB 2.1 components, which is used by SAP PI 7.0.
    [http://help.sap.com/saphelp_nw73/helpdata/en/48/fc1e73a0ad2637e10000000a42189d/frameset.htm]
    Because of this backwards-compatibility I would expect that the EJB libraries for J2EE 1.4 should be available directly in NWDS 7.3 somewhere.
    Best regards,
    Jacob

  • Need Help in Creating adapter module for SFTP Sender in NWDS

    Hi experts,
    I have a scenario where i should write an adapter module for SFTP sender in NWDS.. need your help in achieving this..

    Hello,
    >>i have followed the procedure of FTP but, adapter is not picking the file
    Make sure u have written proper expression to pick file.
    >>do we have any different adapter parameters for SFTP... the input file is .csv..
    I don't think there are any specific parameters needed for SFTP (but in case u are reading file name in AM then u might have to adjust SFTP namespace)
    Thanks
    Amit Srivastava

Maybe you are looking for