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 .

Similar Messages

  • 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

  • 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

  • How to convert iDocs in flat format to Xml

    Hi,
    I'm getting iDocs in my .NET application using the SAP .NET Connector.
    But SAP Connector I receive the iDocs in flat format that is very difficult to read, it would be much easier if I had them in xml format. Do you know an easy way for transforming them to Xml or diretly receive them in Xml format?
    I'm a C# developer, so the best solution for me would be to have a small sample showing how to do it.
    I have seen some documents about the IDoc Adapter, how can it be used? Should it be used together with the SAP .NET Connector or it is a separate way of working?
    Maybe my questions are very basic but I come from the SAP Business One word that is completely different from the ERP world.
    Thanks in advance
    Trinidad.

    Hello,
    SAP Provides a standard report / program that converts the idoc flatfile into Idoc XML.
    The report is : rseinb00
    Just make sure that the Idoc Flat file is formatted in the right way,
    1. Linefeed after every segment,
    2. Idoc Control Record matches the logical system name of the business system defined in XI.
    3. Port in the idoc control record exists.
    If this is going to be a end to end interface flow, using this in a ABAP Mapping and then feeding this as the input to your graphical mapping might be a solution.
    Regards,
    Bhavesh

  • Does anyone know how to convert a Filemaker flat file to some other program that runs on Lion?

    I have a flat file of 200 recipes in Filemaker. It is searchable and prints the recipes on 4x6 cards.
    How can I get the same funtionality without getting an expensive new version of FM that runs on Lion?

    In order to password protect files or folders, you need to create an encrypted disk image. Then what ever is copied to the disk image will be protected.
    The directions to do this are here
    http://support.apple.com/kb/ht1578
    Allan

  • Convert amount from flat file format to user format

    hi,
    how to convert amount from flat file format to user specific format.
    input:  1000.00
    output: 1.000,00 (user specific)
    thanks in advance

    move that value to a type WRBTR variable
    and use write statement.
    data v_wrbtr type wrbtr.
    data v_char(20).
    v_wrbtr = 1000.
    write v_wrbtr to v_char.
    v_char will contain the amount in user format.
    Prerequsite, go to SU3 transaction.
    Defaults tab, chose the decimal notation .
    Regards,
    Ravi

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

  • 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

  • What is the impact by changing gl account contra account: acquisition value

    Hi experts what is the impact by changing gl account  (contra account: acquisition value in asset accounting(AO90)  to the different company codes and different countries. Please review and send across step by step points to us Warm regards Sreenivas

  • Globally Formatting Notes in Keynote

    Notes that the audience can't see is a wonderful feature. But I can find no way to format the notes (font size etc) globally over all slides. Masters don't seem to have Notes! And the other obvious way to do it, in Presenter Display Preferences, appe

  • Cannot find the "D" drive (CD/DVD)

    Hi There was a D drive on my laptop before and now there isn't. I have no idea how it vanished. The drive is for both compact discs and dvd discs. Now when i put discs in the drive they start to load but then finish. I cant find the drive on "My Comp

  • Groupware configuration

    Hi When a create a room with the standard SAP meeting room template i add some memebers with different roles.When ai login as a memeber an error occurs saying 'No connection to groupware server (Invalid RID: No repository manager found: /calendar). R

  • Connecting an 802.11n Express to an older WEP-enabled WDS network

    I have a domed 802.11g Extreme base station connected to an older (802.11g) Express in a 128-bit WEP enabled WDS network - works great. I recently purchased a new 802.11n Express and would like to add it as another remote in my WDS. The new Airport S