IDOC to Flat File and XML ( Need both the Output)

Hi ,
My Scenario is IDOC to File .
I need o/p in 2 format . ie,    1) Flat File 2 ) XML file
I have a plan to go with Interface determination , 2 IM and what shd be the condition ?
or Else  2 Receiver detmination  but condition ?
How to slove this ?
Need the Output from Idoc in 2 format ( Flat file and XML file )
Any Blog , Thread ...Tips...etc
Regards,
Jude

Hi Jude,
Do like this:
1. Create two inbound Service Interface (with the same target Message Type)
2. Create separate Operation mapping with the above service interfaces as target (with the same source service interface)
3. Create Interface Determination and include these two operation mapping (without any condition)
4. Create 2 receiver agreement (with two separate communication channel) for each of the target service Inetrface. In one channel use content conversion and the other one will give you normal XML output
Regards
Suraj

Similar Messages

  • 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

  • IDOC to Flat file and Flat file to IDOC

    Hello Experts,
      I have the following requirement in my current project:
    Third Party Sender sends the data in the in the below XML format via HTTP:
    <?xml version="1.0"?>
    <fxEnvelope>
      <header>
        <message>
          <exchangeID></exchangeID>
          <messageID></messageID>
          <subject></subject>
          <payloadType>IDOC</payloadType>
        </message>
        <from>
          <orgID></orgID>
          <locationID></locationID>
          <messageID></messageID>
        </from>
        <to>
          <orgID></orgID>
          <locationID></locationID>
        </to>
      </header>
      <body>
        <Opaque>
          <DataType></DataType>
          <DataStream></DataStream>
        </Opaque>
      </body>
    </fxEnvelope>
    In the above XML, the Tag <DataStream> is a string which contains the IDOC flat file.
    Now, the scenario is HTTP to IDOC, where the sender sends the above XML payload and PI needs to convert <DataStream> to IDOC XML and pass it on to the receiver R/3.
    But the challange i am facing is converting this <DataStream> tag which contains the IDOC flat file to IDOC XML using a Mapping program.Since both adapters are running on ABAP stack i can not go for Adapter Modules available(We are using PI 7.10).
    Looking for some guidance on the same.
    Thanks in advance.
    Cheers,
    Manasa.

    There are 2 options for you
    In either case, you might need a java mapping to convert the DataStream into String. Use a file adpater to write this string to IDOC-File.
    1) Option1: Write the content of DataStream into IDOC-Flatfile.(java mapping) Pick it from PI to convert IDOC-flat file inot IDOC-XML (using std features of PI) & send it to ECC.
    2) Option2: Write the Content of DataStream to IDOC-Flatfile (accessible to ECC system). Configure WE21 to pick the file from a file port.
    If the datastream was IDOC-XML, then it would have been simpler, it will be a direct communcation from PI to ECC (using java mapping & IDOC adapter).
    Regards,
    Siva Maranani

  • Inbound IDOC Format (Flat File)

    Hi,
    I'm using SAP CRM Middleware for communication between CRM and Legacy System.
    I have configured Outbound IDOCs and I see something like this:
    EDI_DC40  2200000000000000023700 3012  CRMXIF_PARTNER_SAVE_M01                                     CRMXIF_PARTNER_SAVE_M
    E201CRMXIF_PARTNER_COMPLEX000 220000000000000002300000100000001CRMXIF_PARTNER_COMPLEX
    E201CRMXIF_PARTNER_HEADER000  220000000000000002300000200000102CRMXIF_PARTNER_HEADER         BusinessPartner                 U
    E201CRMXIF_PARTNER_KEYS000    220000000000000002300000300000203CRMXIF_PARTNER_KEYS           0000000014488DDB8AD891249EE10080010A6CA883
    The questions are:
    I need to know how do the following information must be filled in an Inbound IDOC:
    The first characters I understand that corresponds to the Structure name, IDOC Number, IDOC Line...
    So I need how do fields like IDOC number must be filled in an Inbound IDOC
    Thanx in advance..
    BTW. I'm expecting IDOCs as flat files so I need to explain to the Legacy Technician how to fill this fields.

    Hi,
    Go to transaction WE30 and give the IDoc basictype name CRMXIF_PARTNER_REL_SAVE_M01 and press the view-button (or press F7 key).
    This information you will need.
    The records are builded using the following structure:
    1st record contains control record information and follows the structure of table EDIDC.
    Starting at where "220" is given (this is the CLIENT), it is followed by the IDoc number field DOCNUM (16 digits) and so on. Not all fields must be filled, only those that are used for inbound messaging. Keep here in mind: Less fields filled will probably work better (because SAP will add its own details on arrival of the IDoc).
    All following records follow the structure of table EDID4 upto the field: HLEVEL (Hierarchy level, identical to the level found in WE30).
    Thereafter it is followed by the name of the segment (including spaces) and after this it will follow the exact structure of the segment.
    To view a sample, just generate a dummy (test) IDoc and use transaction WE19 to fill in the fields after changing to the correct IDoc type.
    Hope this helps you out.
    Regards,
    Rob.

  • XML-IDoc to flat file (Release 4.0 and 3.0)

    Hello experts,
    I implemented the guide "[How to Convert an IDoc-XML structure to a flat file and vice versa in XI 3.0|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a]". Now I get a flat file, but it is IDoc-Version V3 (for Release 4.0). Is it possible to create another mapping which creates a Relase 3.0 IDoc instead as shown in transaction WE61 with version 2?
    Best regards,
    David

    Hello all,
    thank you for your answers. But again, it's not about IDoc types!
    Please go to transaction WE61 the last selection on the screen is version (1 for SAP Release 2.0, 2 for SAP Release 3.0 and 3 for SAP Relase 4.0). What the ABAP class from the guide creates is a V3 IDoc for SAP Release 4.0. If you choose the HTML view, you will see, that the versions are different, although the IDoc type is exactly the same. We create Version 3 and we need Version 2.
    Best regards,
    David

  • Convert IDOC XML structure to flat file - and now?

    Hi,
    we are working with input message ORDERS05 and want to convert it to flat file.
    So we used the implementation description from "how to convert an IDOC-XML structure to a flat file....".
    Looks like this is a standard procedure described here fitting for all IDOCs.
    We followed the guide, making XI ready for Abap-Mapping, implemented the Abap class like described, added an interface mapping with source ORDERS05 to a mess.type dummy destination, added with type Abap-class the class implemented from the guide and completed the Int.Dir. implementation.
    For comparism purpose we have two systems as receiver, one with a standard flat file with regular graph.mapping in XI, one with the Abap mapping.
    Result:
    Error description in SXMB_MONI:
    Didn´t expect something like that! The IDOC was delivered successfully to the other simple flat file receiver.
    Any idea what we made wrong (we are on SP17) or if there is a standard mistake you can do when following the guide?
    Best regards
    Dirk

    Hi,
    I've got the same problem. He the solution in my case:
    The problem is:
    My IDOC has no element <STDMES>, but the method IF_MAPPING~EXECUTE from the 'HOW-TO Guide' does not check this situation:
    el_element = idocument->find_from_name('STDMES').
    ls_edidc-stdmes = el_element->get_value().
    thows the exception.
    Solution:
    make shure that the field STDMESis set or change the method to:
    el_element = idocument->find_from_name('STDMES').
    if not el_element is initial.
        ls_edidc-stdmes = el_element->get_value().
    endif.
    Best regards
    Dieter

  • How to read an IDOC flat file and send it to XI

    Hi,
    I'm looking for a way to read a complicated Idoc structured flat file sent to XI by a legacy system and then pushing that data to and R/3 system. Can anyone recommend a good technique?
    Thanks,
    Steeve

    hi steven....
    this shud help u...
    for FileXIIDoc
    File->XI->IDOC (how to start?)
    also check this blog for specifying adapter specific identifiers in this scenario
    These are steps to follow:
    STEPS IN DESIGN
    1. Import idoc from the SAP System (SAP02) through imported objects.
    2. Create Data Type, Message Type, Message Interface for the Outbound File.
    3. Create Message Mapping with file Message and idoc (Matmas04)
    5.Create Interface mapping between File Interface and the idoc.
    Steps to be followed in Creation of Technical and Business System
    Technical System
    In SLD, click on technical landscape->New Technical System->WebAS ABAP.
    Business System.
    1.Goto Business Landscape->New Business System->Name the business system.
    2. Choose the technical system that needs to be attached->WebAS ABAP->Technical System Name.
    Preconfiguration steps for transfer of data to IDOCS
    1.Create a RFC Destination in SM59 of XI Server of type.
    2.In transaction IDX1 ,create a port for the client of XI server.
    3. The port has to be displayed in the idx2 transaction and we should be able to view the idoc’s which we imported through integration repository.
    Steps in Configuration
    1. Goto service without party, right click->Assign a business system.
    2. Choose the business system to be added.
    3. Create a File Sender Service with communication channel for the same.
    4. Create an idoc receiver channel under the business system. Mention the RFC Destination and the port created for the same.
    5. Mention the logical Name in the Service->Adapter Specific Parameters of both the File Sender Service as well as the business system.
    6. Make the Sender Agreement for theFile Sender with communication channel.
    7.Create the Receiver Determination and Interface Determination for the business system.
    8.Create the Receiver Agreement for the Business system.
    TCODES for File>XI>IDoc
    SM59-rfc destination on recving side
    IDX1-port on recving side
    IDX2-load metadata
    Bus. service adapter specific Identifiers-->Logical sys name (check this blog:/people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system )
    we05-IDoc status records
    BD54-Create Partner Number
    We20-Create Partner Profile
    and also go thru this blog...
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    hope it helps....
    regards...
    vishal
    /people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system

  • Flat File and IDoc

    Hi,
      Is it possible to read a flat file and create the sale order through IDoc.  Can i do this by DOC_INBOUND_FROM_FILE without XI?? What file format should i pass??
    Regards,
    Kit

    Hi  ,
    you can create Sales order through IDoc. IDOC_INPUT_ORDERS
    At a high level, the IDOC processing executes in the following manner:
    1.     Interpret IDOC header segments and captures organizational, customer master and purchase
                   order header details. Performs user exits for each segment to process customizations to data
                     processing.
    2.     Interprets item level segments and captures item level details like material information. Again,
                   it performs user exits for each segment.
    3.     Sums up the order data and determines the posting criterion viz. creating order with reference
                      etc.
    4.     Builds up batch data communication sequence (BDC) with respect to the required screen
                  sequence of posting a sales order.
    5.     While building up the BDC data, system performs user exit to process customizations to BDC
                    data.
    6.     Calls transactions VA01 using the BDC data.
    7.     If the processing fails, an appropriate workitem is generated for workflow processing.
    if you give me brief i can help you out more.
    if helpful REWARD points
    Thank you .
    Regards
    Ramana

  • 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

  • How to read flat file and convert to xml throught OSB

    Hi ,
    Can somebody help how to read flat file and convert to xml in OSB.
    appreciate ur help.
    Thanks & Regards ,
    Siva K Divi

    if you're using the oepe with osb plugin (will be installed when you install the osb locally) and then in your osb project > rightmouseclick > new > MFL.
    that's it
    maybe you're trying to create it within an oepe installation which doesnt have the osb plugin ?

  • MessageTransformBean in sender JMS Adapter flat file to xml conversion

    Hi All,
    The scenario is MQ (Flat File )  --->PI -
    >Idoc
    The flat file structure is
    112233
    AABBCC
    The expected XML Structure after using MessageTransformBean in the sender JMS adapter  is
    <Record>
    <Row>
    <f1>11</f1>
    <f2>22</f2>
    <f3>33</f3>
    </Row>
    <Row>
    <f1>AA</f1>
    <f2>BB</f2>
    <f3>CC</f3>
    </Row>
    </Record>
    But I am getting 2 SEPARATE xml messages each with only one Row in it like the following
    1st XML:
    <Record>
    <Row>
    <f1>11</f1>
    <f2>22</f2>
    <f3>33</f3>
    </Row>
    </Record>
    2nd XML:
    <Record>
    <Row>
    <f1>AA</f1>
    <f2>BB</f2>
    <f3>CC</f3>
    </Row>
    </Record>
    I would like to have one xml message with all rows in it.It seems the MessageTransformBean is not recognizing the end of line in the flat file.Do i need to use endSeparator explicitly.
    I followed the "How to use Content Conversion in JMS Adapter " and configured the adapter,still no luck..
    Any Help greatly Appreciated
    Thanks,
    C

    Hi Chirag,
    The parameter name sequence changes alphabetically by itself when I save and activate it eventhough I enter as it is in the document.How to stop changing this sequence or put it the order as required in the Module Processor.
    Currently my sequence is
    Transform.Class
    Transform.ContentType
    xml.conversionType
    xml.documentName
    xml.documentNamespace
    xml.fieldFixedLengths
    xml.fieldNames
    xml.processFieldNames
    xml.structureTitle
    Let me know how to change the sequence ,if that is the issue.
    Thanks,
    C

  • Idoc to flat file conversion: problem with mapping

    Dear experts,
    I have the following scenario: SAP (idoc) -> XI -> 3rd party
    The idoc has s structure like this:
    . ZSCX001 (idoc name)
    ... IDOC
    ..... ORDERHEADER
    ....... ORDERLINE
    ......... DELIVERY LINE
    ......... DELIVERY LINE
    ..... ORDERHEADER
    ....... ORDERLINE
    ......... DELIVERY LINE
    ......... DELIVERY LINE
    etc
    The flat file has this structure:
    . FILENAME
    ... RECORD
    ..... FIELD1
    ..... FIELD2
    ... RECORD
    ..... FIELD1
    ..... FIELD2
    etc
    Now, per IDOC I need to create 1 file. For each delivery-line in the IDOC I need to create 1 record in the outputfile (flat file).
    In message mappings, I did the following:
    - messages-tab: Occurrence of the Idoc and inbound message type for flatfile: both 1
    - design-tab: I linked IDOC to the FILENAME (so for each Idoc I create 1 flat file)
    - design-tab: I linked the tag "Delivery line" to "RECORD" (I expected 1 record per delivery line)
    When I test it, I only get 1 resulting record in the flat file, even if I test with 3 ORDERHEADER->ORDERLINE->DELIVERY LINE segments.
    Can anybody tell me what I am doing wrong?
    Thanks in advance,
    William

    Hi,
    First make sure occurence of Record is 0..unbounded.
    Second use the blow mapping rule..
    Delivery line --->RemoveContext ---> RECORD
    Regards,
    Sarvesh

  • URGENT : Program to convert flat file to XML file.

    Hello,
           Good Morning. I want an urgent program to convert a flat file seperated by '/' to an XML file format and store that in the the application server. If any one has done such a developement, could you please send me the code.
    The flat file format is as below :
    72/070414/114147/11973//100-//EA/00000000///04198//RRT0/RC23///////353825001511172/72/070414/123620/11973//1000//EA/00000000///04198//RRT0/RC23///////354762008125236/72/070414/125411/13814//1000//EA/00000000///04198//INV/ID06///////90000000002697/72/070414/140820/11973//1000//EA/00000000///04198//RRT0/RC23///////353057002479718/72/070414/145438/13814//1000//EA/00000000///04198//INV/ID06///////90000000002739/72/070414/145438/11973//1000-//EA/00000000///04198//INV/ID06///////353057002479718/72/070414/150008/13814//1000
    It needs to be filtered by removing the '/' and also grouped based on two fields namely store number and transaction number.  The sample XML output required is as below :
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <MT_POLL07 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../MT_POLL07.xsd">
      <MessageHeader>
        <File>
          <Name>C:/kai/perl/storemaster_home/stores/09100/inbound/POLL07.DOS</Name>
          <CreatedDate>Wed Feb  7 13:09:15 2007</CreatedDate>
          <TotalRecordNo>19</TotalRecordNo>
        </File>
      </MessageHeader>
      <Transaction>
        <TransactionHeader>
          <TRANSACTION>20070414001559</TRANSACTION>
          <STORE_NO>09100</STORE_NO>
          <BOFTTP>72</BOFTTP>
        </TransactionHeader>
        <Item>
          <BOFTDT>070414</BOFTDT>
          <BOFTTM>114147</BOFTTM>
          <BOFSKU>11973</BOFSKU>
          <BOFUPC></BOFUPC>
          <BOFQTY>100</BOFQTY>
          <BOFQTN>-</BOFQTN>
          <BOFCST>0</BOFCST>
          <BOFCSN>+</BOFCSN>
          <BOFUM>EA</BOFUM>
          <BOFHRF>00000000</BOFHRF>
          <BOFSRF></BOFSRF>
          <BOFVND></BOFVND>
          <BOFLOC>04198</BOFLOC>
          <BOFEQT></BOFEQT>
          <BOFEQN>+</BOFEQN>
          <BOFRTP>RRT0</BOFRTP>
          <BOFREA>RC23</BOFREA>
          <BOFCID></BOFCID>
          <BOFAUT></BOFAUT>
          <BOFCUR></BOFCUR>
          <BOFPTP></BOFPTP>
          <BOFUPT></BOFUPT>
          <BOFUMR></BOFUMR>
          <BOFSRN>353825001511172</BOFSRN>
          <GMNUMBER>1</GMNUMBER>
        </Item>
        <Item>
          <BOFTDT>070414</BOFTDT>
          <BOFTTM>123620</BOFTTM>
          <BOFSKU>11973</BOFSKU>
          <BOFUPC></BOFUPC>
          <BOFQTY>1000</BOFQTY>
          <BOFQTN>+</BOFQTN>
          <BOFCST>0</BOFCST>
          <BOFCSN>+</BOFCSN>
          <BOFUM>EA</BOFUM>
          <BOFHRF>00000000</BOFHRF>
          <BOFSRF></BOFSRF>
          <BOFVND></BOFVND>
          <BOFLOC>04198</BOFLOC>
          <BOFEQT></BOFEQT>
          <BOFEQN>+</BOFEQN>
          <BOFRTP>RRT0</BOFRTP>
          <BOFREA>RC23</BOFREA>
          <BOFCID></BOFCID>
          <BOFAUT></BOFAUT>
          <BOFCUR></BOFCUR>
          <BOFPTP></BOFPTP>
          <BOFUPT></BOFUPT>
          <BOFUMR></BOFUMR>
          <BOFSRN>354762008125236</BOFSRN>
          <GMNUMBER>2</GMNUMBER>
        </Item>
      </Transaction>
    </MT_POLL07>
    Please send me the code : It is urgent. Thanks in advace. Points to be rewarded.

    hi !
    Check with this thread discuss the same
    http://www.sap-img.com/abap/sample-xml-source-code-for-sap.htm
    Flat file to XML
    CONVERTION OF FLAT FILE TO XML : NO OUT PUT FOUND
    Converting Idoc flat file representation to XML
    how to convert flat file into IDOC-XML
    Regds
    Abhishek

  • Convert the flat file to xml format.

    hi,
    I need to write a interface program in the R/3  to pull the flat file data from the unix application server and do some manipulation and place back into the unix application server in XML format, From the unix box XML file taken by the XI server.
    pls give me some idea to convert the flat file to XML format, through any function module or any other logic is there...
    with regards,
    Thambee.

    Hi Thambe
    in addition to the above posts
    Program to convert flat file to XML file.
    please download tool from this link:
    http://www.download.com/Stylus-Studio-2008-XML-Enterprise-Suite/3000-7241_4-10399885.html?part=dl-StylusStu&subj=dl&tag=button&cdlpid=10399885
    how to use:
    http://www.stylusstudio.com/learn_convert_to_xml.html
    http://www.sap-img.com/abap/sample-xml-source-code-for-sap.htm
    Flat file to XML
    CONVERTION OF FLAT FILE TO XML : NO OUT PUT FOUND
    Converting Idoc flat file representation to XML
    how to convert flat file into IDOC-XML
    Thanks
    sandeep sharma
    PS ; if helpful kindly reward points

Maybe you are looking for

  • Latest version firefox cannot open not supported by architecture on mac G5 with OSX 10.5.8

    Have been using firefox as preferred browser on Mac G5 OSX 10.5.8. Today, message said new version optimized for yahoo available. I downloaded it and now firefox logo has do not enter sign superimposed and when I try to open, it says can't open not s

  • Automatic release of notification

    Hai PM gurus , Is it possible to release PM notification automaically when created , as create and release person are same . Thanks in advance gmr

  • Install Mac OS X 10.6

    Hi I have an Intel-based Mac, it has Mac OS X 10.5.8 Leopard, but I want to install Mac OS X 10.6 Snow Leopard, or if it is possible directly to Mac OS X 10.10 Yosemite, my Mac is compatible with Yosemite, but how can I update to Mac OS X 10.6 or 10.

  • CAN't find Parameters, Events and Approval tabs in the Page Properties opti

    Hi Gurus, I am trying to test the approval process. I have created a page group and also created a page under that. I don't find the 3 tabs Parameters, Events and Approval in the Edit Page/Page Properties option. Please reply me what I have to do to

  • Simple max() sql query

    Dear SQL Experts i have data like below id rate date 1 10 03-JAN-2010 1 20 02-JAN-2010 1 30 01-JAN-2010 2 10 01-JAN-2010 2 20 02-JAN-2010 2 30 10-JAN-2010 3 40 01-JAN-2010 3 50 15-JAN-2010 3 60 03-JAN-2010 I want to get the id wise last date's rate.