Convert IDOC to flat file - How to guide

Hello,
I have found the how to guide for converting IDOCs to FlatFiles via ABAP Mapping.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
What is not clear to me. This sounds like I do not need a message type for the flat file with a full implemented structure corresponding to the source IDOC.
Is this right?
Or it is really necessary to create a mess.type with data type for rebuilding the IDOC structure in the flat file!
Can anyone help?
Best regards
Dirk

Dirk,
Well, am not exactly sure if my reasoning is technically correct, but here it goes,
Java Mapping and ABAP mapping takes the Input Source as an InputStream and return the output also as Streams. These streams are not validated against the source and the target strucutres.
In the case of XSL, the only requirement is that theinput / output should be a well formed XML  content.
Graphical Mapping produces a Java code internally and I guess the code has a validation check against the source / target schema.
Regards,
Bhavesh

Similar Messages

  • How to convert IDOC to flat file in XI

    Hello SDNers
    I have a scenario IDOC --> XI  --> Flat file. My question is how to conver IDOC to flat file. At least there are two ways to do that:
    1) Define a flat structure in PI that reflects the IDOC structure, then using content conversion to convert the flat structure to flat file in hte receiver communication channel.
    2) There is a [document |https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a] talking about using a generic ABAP mapping to map any IDOC to flat file.
    For the option 1, I don't want that way, because I would need to define a flat structure in PI for each IDOC which is too much effort. (I would have dozens of IDOC scenarios)
    The second one is very attractive. However the document is not complete to follow. Basically it does not explain how the inbound flat structure looks like. I guess the generic ABAP mapping is used to map any IDOC_XML structure to a flat structure, then in the file receiver communication channel to convert the flat structure to flat file format. But the document does not mention how the flat structure looks like. Has somebody tried this scenario? If yes, can you please let me know the steps to do in ESR (IR) and ID? Basically what structure the IDOC_XML should be mapped to using the generic ABAP mapping class?
    Or somebody has other ideas on how to convert IDOC to flat file?
    Thank you so much
    Eric

    > 1) You are saying that for Java mapping and abap mapping, the target data type (messag type) is just a dummy one, the real (XML) message the receiver will recieve is the one (stream) produced by the java or abap mapping. Is that correct?
    Definitely yes!
    >
    > 2) For the abap mapping option, I would define a dummy target data type. Do I need to do any content conversion in the receiver adapter (communication channel)?
    None wat so ever.The output of your Java Mapping will be the Native Idoc Format.
    >
    > 3) I tried with a dummy target data type as mentioned in my second post, can you see any clue in the error message what is wrong?
    Dats one thing I cant help much. Just make sure that the ABAP report is valid and take the help of a ABAP'er to debug what is going wrong. Not much of a ABAP guy, can read ABAP code, but cant write one myself
    Try to test the program standalone to see how it works. Maybe take some Idoc XML file as input and then dump the output to a .txt file and so on.
    Regards
    Bhavesh
    PS : All this is from what I have read of this guide. I have not convert Idoc XML to Native Idoc but have used this guide to convert Native Idoc to Idoc XML .

  • How To Convert IDOC to FLAT File ?

    Dear Expert,
            My requirement is to convert the IDOC to FLAT File using XI. How can i do this. I have gone thru the Guide How to convert IDOC to Flat file using ABAP mapping but it does not talk about what are all the stpes i need to do in IR & ID.
    I am ready to use ABAP mapping since i am an ABAPER.
             Is it recommended to use ABAP mapping since we expect daily 500 IDOCs to be converted to a flat file & transfer this flat file to some FTP location.
             Can anybody tell me the stpes how to do this in XI. The steps i am expecting like how to define the Data Type / Message type / Mapping etc & how to configure the channel ?
             The Flat file i want to convert should look like the way IDOC file gets created in FILE FTP port in SAP.
    Regards,
    Umesh

    I think there is some confusion... Let me explian my problem once again.
    I want to convert the Shipment IDOC as it is the moment the shipment documents gets created in R/3. I dont want to collect many IDOCs & make as single file. For each IDOC it should create a Flat File.
    Secondly if i have to MAP the whole IDOC the graphical mapping is too difficult.
    So instead of that can i use ABAP/XSLT/JAVA whichever is easy. ?
    Since i am ABAPER i can use ABAP mapping.
    The Output file should look like as below.
    EDI_DC40  9000000000011785526620 3012  OILSHI01                                                    OILSH1                                           SAPP01    LS  SAPCLNT900                                                                                A000000018LS  WBIMQSI                                                                                20071031161506                                                                                20071031161506     
    E2OILSH001                    90000000000117855260000010000000250 1011537344 1101                1 300X1 TRKGMKG 0202KG KG X        ZTLF  X XX 000   BLX X        X60002200710310000002007103100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000        E2OILSA                       9000000000011785526000002000001031011537344000001SP          0000201496000000000000000000                                           00                                        00 V                                                                                E2OILSA                       9000000000011785526000003000001031011537344000002SP          0000201496000000000000000000                                           00                                        00 S
    E2OILSV                       900000000001178552600000400000103MH04CG6052        LPBW50D62401033       000020149601KG KGM   35200.00000             17200.00000             18000.00000                               0.000          0.000          0.000          DLLPGB220071031000000 00000000000000000000000000000000000                    0000XX    6000AAAA0.00000                 0.00000                 17200.00000             35200.00000             18000.00000             MH04CG6052 new bulk tender approved rs                                          LPG Bulk Lorry - WR                     Refinery TPP                                                                                BABA TRANSLINES                     kg        kg        0.000             0.00           0.00                                                                                E2OILSC                       9000000000011785526000005000004041  001                                                 18000.000000           18000.000000           35200.000000           0.000000               0.000000                  KG                                                                                E2OILSQ001                    9000000000011785526000006000005050011  MH04CG6052MH04CG60521J          05041089055000                        00000118000.0000000  KG 18000.000000           18000.000000           6000V04 18000.000      KGM18000.000      KGM00000000  V        0.000000                  0.000000               0.000000                  0.000000                           0.000000               0.000000               0.000000               0.000000                          0001                                                                                E2OILS2                       9000000000011785526000007000004040001000001000200020000.000000               0.000000               0.000000               0.000000               0.000000               0.000000               0.000000               0.000000               0.000000               XX0000000000000000000000000000 XX0504108905J5000              PUNE LPG BOTTLING PLANT            START     0001 1END       0001 10.000000               0.000000               0.000000               0.000000               0.000000               0.000000
    Pl. Help me its Urgent.
    Regards,
    Umesh

  • Create IDoc from flat file - How to do the message mapping

    Hi everybody,
    I want to create an IDoc from a flat file.
    The file structure looks like this:
    MT_XYZ
    - Node001       0...1
      - Leaf001
    - Node002       0...unbounded
       - Node003    0...1
          - Leaf002
          - Leaf003
       - Node004    0...1
          - Leaf004
       - Node005    0...1
          - Leaf005
    I have created a mapping and all the other stuff to set up the IDoc adapter.
    Now when I try to test the interface the IDoc is created properly but obviously no information from the nodes "Node003" to "Node005" is inserted in the IDoc. Only the information kept in the elements (leafs) of "Node001" are inserted.
    All IDoc segments and their "Segment" elements are linked to the root node of the file structure "MT_XYZ". I tried to link some IDoc segments only to "Node002" but then this segment is not created.
    So how can I set up the message mapping in a way that the information from "Node003" to "Node005" is transported to the IDoc? Can anyone help me here?
    Thanks in advance for all answers!
    Regards,
    Torben
    Edited by: Torben Hönemann on Dec 14, 2009 4:26 AM

    Hi Torben,
    >>I want to create an IDoc from a flat file.
    So you are using File content Conversion on the sender side. Right?
    >>no information from the nodes "Node003" to "Node005" is inserted in the IDoc.
    Are these information available in the source XML (you can check in transaction SXMB_MONI-> Input Payload).. There is a limitation in File Content Conversion of File adapter and it is that I can make an XML structure of 3 level.. Since these nodes details are in level 4 and 5 they should be missing in Source XML structure itself (after content conversion of File adapter). check that
    >>So how can I set up the message mapping in a way that the information from "Node003" to "Node005" is transported to the IDoc? Can anyone help me here?
    So you need to take an alternate approach where you do File Content Conversion and make 3 level structure.. then using a mapping convert this three level structure to your 5 level one and then try to map with the idoc.
    Check this blog for an idea
    http://www.riyaz.net/blog/xipi-file-content-conversion-for-complex-structures/
    http://www.riyaz.net/blog/xipi-convert-flat-file-to-deeply-nested-xml-structures-using-only-graphical-mapping/
    Regards
    Suraj

  • What are the advantages of idoc compare to flat file. how data is secure

    what are the advantages of idoc compare to flat file. how data is secure in idocs compare to flat file

    Hi Ramana,
    In simple words, Main advantage with idoc over flat file is security....
    I will explain you some scenario here U got a flat file with all the data...Now u r having the flat file if you want u can modify the data in it, or somehow any one can modify the data in it  if they were able to access this file. That means u maintained the file in the presentation server
    One level of higher security to the above level is maintaining the flat file in application server, at point also even though lot of people r not having the access to that file, super user who is  having  the access may modify the data or delete the data from it rite....
    so in both of those levels u don't have 100% security...
    So there come to the picture of idocs, Idocs simply data carriers, those r generated by a program but not manually...data will be divided into number of segments based upon ur program. So manually its not so easy to modify the data in these idocs. If any changes to be made in the data then u have to modify the data in the application and then u have to update the idoc or you have to generate the new idoc with that corresponding data. so in this case not even super user can manipulate the data directly in the idoc....
    I think u got my point what I mean to say.....
    If you find it useful mark the points
    ~~Guduri

  • IDOC to flat File----Problem in File Content Conversion at receiver

    hi experts,
    I am doing a IDOC to flat file secnario.
    My requirment is IDOCXI-Flat file
    Format of flat file is like:--
    Every segment in the IDOC will be converted into a single line of file(without any delimiter). So number of lines in flat file will be equal to number of segments in IDOC.
    I am facing problem in File Content conversion. 
    Please help me out..
    Thanks
    Jaideep

    Check this doc...
    [How To...Convert an IDoc-XML structure to a flat file and vice versa in XI 3.0 |https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a]

  • IDOC to flat file and vice versa

    Dear community,
    we should send IDOCs to flat files and read plain files and map them to IDOCs.
    Is there any comfortable way to do this without doing a huge content conversion for
    IDOCs? Exist a SAP standard for such process?
    We receive the IDOC as normal IDOC. Would it be more easy to save the IDOCs
    directly as flat file on ERP file system??
    System PI 7.11
    IDOCS: WHSCON, WHSORD and WMMBXY
    Regards
    Chris
    Edited by: Christian Riekenberg on Feb 1, 2012 2:41 PM

    Hey folks!
    We have a PI 7.31 SPS5 Java-only installation here and are using the module IDOCFlatToXmlConvertor. For single IDocs with one line for the EDC_DC40 header and the others for the IDoc payload the conversion works. But when we want to process multiple IDocs from the same type within one file, we see this error in the log:
    Module Exception 'com.sap.aii.af.idoc.exception.IDOCModuleException: No data segments for DOCNUM = ' found, cause: <null>
    Are there any requirements how the multiple IDocs have to be structured within the file?
    Best regards
    Heinrich
    Update:
    I found out that the module wants each record to contain the corresponding DOCNUM to find the matching records. The non-SAP sender system normally does not set this value. Is there a way to "convince" the module to convert the IDocs nevertheless?

  • IDOC to flat file without XML conversion

    Hi,
    I want to implement a scenario like this:
    IDOC --> XI --> flat file
    The flat file has to have the IDOC structure as you have when you write an IDOC to the R/3 file port. But we want to have this process running through XI.
    When you use the IDOC Adapter the IDOC is converted to XML first, which is time consuming. So this I want to skip this step.
    So is it possible to receive the IDOC directly in XI without converting it to XML? How should this process be designed.
    Ron

    Ron
    Looks like you need IDOC tunneling. It is possible by making a configuration parameter.
    You can find more information in http://help.sap.com/saphelp_nw04/helpdata/en/ab/bdb13b00ae793be10000000a11402f/content.htm
    While you try it, I will try to simulate this requirement in our system and let you know the result.
    KK

  • Conversion of multiple xml idocs to flat file

    Hi,
    I did ABAP mapping to convert xml idoc to flat file by using the reference how to do abap mapping in xi3.0.pdf
    It is working for only one idoc at a time.
    If I have multiple idocs in a single xml file, the above code is not working.
    Please let me know what cchange to be done to work out for this.
    Hope am clear.
    Regards,
    Anil.

    Look For the Occurances of target Field node...It should be 1 to unbounded

  • IDoc - SFTP (Flat File) file name

    Dear Experts,
           Thanks for helping me so far, please find below my new request :
           We have IDoc - SFTP (flat file) scenario in which I have did ESR by pass scenario and used standard module to convert IDoc xml to flat file.
           But now user is asking to have the naming convention of the receiver flat file as SHPMNT05_<IDoc number>_<Reference number>.idoc.
           Could you please let me know how this can be approachable. Many thanks in advance for your valuable inputs. Awaiting your replies.
    Thanks
    Ravi..

    Thank you very much Botha,
    In the thread Idoc to file problem with DynamicConfiguration please find below my doubts.
    1. I am using receiver SFTP adapter and IDoc to flat file module configuration as key 1, so how it will works.
    2. What are the Parameter name and Paremeter value for the module mentioned in the blog :
    Module Configurations:
    1  key.0      write http://sap.com/xi/XI/System/File FileName
    1  value.0   message.interface
    Which is the parameter and which is the value in the above blog.
    Waiting for your response.
    Thanks
    Ravi

  • IDoc to Flat File in SAP PI 7.11

    Hi Experts,
    I am working on PI 7.11 and I have scenario from Idoc to Flat File.
    Idoc is posted from source side R/3 system.My requirement is "With out Converting the Idoc structure to XML Structure  i want to send the data to Target system i.e. File system.
    But the structure of the target structure is different from source structure.
    My questions are:
    1). Is it Possible to send the data to Target system without converting Idoc structure in to xml format through our PI 7.11 ?
    2). If possible please provide me the way that executes in the Interface is?
    Could you please provide the Inputs.
    Best regards,
    satya.T
    Edited by: satyatanuku on May 24, 2010 3:26 PM
    <Moved from Trial, Preview~ forum>
    Edited by: Prateek Raj Srivastava on May 25, 2010 1:02 PM

    Hello Folks ,
    I am also facing the same scenario please provide me any options to achieve this scenario .
    I am searched in Forums of SDN but no inputs or blogs available.
    Let me know i am having one solution is it right or wrong ?
    we have to achieve this IDOC Tunneling .... is it right  friends ?
    Still inputs required....
    Regards,
    Ravi.

  • R/3 46C(IDOC) -- XI -- Flat file scenario

    Hi
    Is there anyone who could give me information on a R/3 46C(IDOC) --> XI --> Flat file scenario?
    Many thanks!
    br
    Göran

    Hi Manish
    We are using a standard IDOC called PROACT.PROACT01
    (We are using transaction sa38(Report RSMIPROACT) in R/3 to send our IDOC.)
    First we create the technical and business systems in SLD
    Second we transfer these to the repository.(I think the only thing you need to do is to update the SLD cache to get them there - Design : Integration builder --> Environment --> clear SLD cache)
    Then we just use the configuration wizard(Configuration : Integration builder --> Tools --> configuration wizard) to map everything together - defining sender and receiver etc(You get the configuration wizard tool by patching XI to patch level 4 or 5).
    I assume that you have made all the configurations accordingly to the XI configuration guide which you can download from the service marketplace.
    This is just a hint but maybe it can give you a start.
    br
    Göran

  • Idoc to flat file using Integration process does not show up at all

    Hello All,
    I created a scenario IDOC to Flat File using Integration Process and one without IntegrationProcess. I am able to execute the one without Integration Process easily.
    However when I send the IDOC from SAP then the Integration Process scenario just does not work.
    I Checked SXMB_MONI  There is no entry for the Integration Process.I can see entry for other without Integration Process.
    SXI_CACHE : I can see my Integration Process active
    SWEQADM :  I have activated the Event Queue and Background job
    SWF_XI_ADM_BPE :  ALL BPE is showing green status.
    All syntax check on IP are fine.
    There is no Basis Help for me so  there could be some additional basis steps which need to be configured.  Has anyone faced such an issue with Integration Process?
    Regards
    Prashanta

    Hope this might help you. when u configure an IDoc as Sender with BPM this is how you proceed.
    <b>1<b>. let us split the scenario into two</b>.</b>
    a. <b>Sender to BPM</b> ( Integration Process).
    b. <b>BPM to Receiver</b>.
    <b>2. First let us configure the first Sender to BPM.</b>
    a. Sender Agreement( <b>Not required</b> ).
    b. Receiver Agreement( <b>NOT Required</b>).
    c. Receiver Determination( Sender Service, Outbound Interface, Receiver Service(<b>Integration Process</b>).
    d. Interface Determination( Inbound Interface(Sender Abstract Interface), Message Mapping(NOT Required if your using transformation stepin Integration Process)).
    <b>3. Now let us configure the Second BPM to Receiver.</b>
    a. Sender Agreement( <b>NOT Required</b>)
    b. Receiver Agreement( Sender Service(<b>Integration process</b>), Receiver Abstarct Interface,Receiver service, Inbound Interface).
    c. Receiver Determination( Sender Service(Integration Process), Receiver Abstarct Interface,Receiver Service).
    d. Interface Determination( Inbound Interface, Message Mapping(<b>NOT Required</b>)).
    So Finally we have <b>One Receiver Agreement</b>, <b>Two Receiver Determinations</b>, <b>Two Interface Determinations</b>.
    Please let me know if you have any more queries.
    Regards
    Gopi

  • Idoc to flat file mapping using XSLT

    Hi,
    i am using XSLT mapping. my requirement is mapping between idoc and flat file(xml to text). as i do not want to use FCC, i have opted for xslt mapping. please let me know any article which would be helpful for this.
    regards,
    Meenakshi

    Hi Meenakshi,
    Two things:
    1. Achieving this functionality  using XSLT is very difficult.
    2. Secondly you may not be able to find a direct document to convert IDoc-XML to flat file using XSLT in sdn. Try google.
    I found one link like that may be you can get some idea from there
    http://www.stylusstudio.com/SSDN/default.asp?action=9&read=6453&fid=48
    Also if you have a XSLT editor like XMLSPY or stylus studio then creating your specific XSLT will b much more simpler
    Regards
    Suraj

  • PO Idoc in Flat File format

    Hi all,
    I am able to generate the PO Idoc in Flat file format using standrad FM IDOC_OUTPUT_ORDERS. but the Flat file appearing is not in a appropriate format.
    I'm looking to generate the Flat file in such a way that there will be only one line for each Idoc Segment.( with Line termination).
    How to Achieve this.
    Regards,
    S Anand

    Resolved.
    we can use CG3Y transaction.
    Regards,
    S Anand

Maybe you are looking for

  • My I Mac keeps freezing, and shutting down apps.

    Hello, I have an I Mac, it keeps freezing, and when I open my applications it will shut them completley. (i.e Chrome keeps shutting down by itself, Skype dissapeared and Gimp is just a question (?) mark now ) I tried restarting the computer on safe m

  • IPod touch 2g freezes at start up ipod logo and does not connect to itunes

    Hey, so my iPod touch 2g freezes at start up ipod logo when in the charger. Then when off the charger after a couple minutes it goes black. when i connect it to my computer does not connect to itunes so i can not restore it. please help!!!

  • Help!  I have converted a file from pdf to docx.  Now, how do I edit the document??

    So, How can I move my newly transformed docx into Word so I can edit it???

  • Merged Clips Audio Issue

    Trying this again, having a major problem since update working with merged clips.  I merge all my video and audio clips in a pre-workflow project in premiere pro.  Just got my footage back from the shoot, labeled and sync'd in the project. Because Pr

  • Purchase group Processing Time - Types,

    Hi All, I am looking into the different time taken for the purchase department to process their acitvities. I could list a few times lke 1)  PurchasING  processing time ( T code - OMDT) 2)  Pur Req to PO Conversion time (path  : SPRO-IMG-MM-PURCHASIN