Flat file to idoc - mapping

Gurus,
I have a flat txt file of following format
Doc#         Whse        Item          Matnr         date                       code
3256999     WH20     1001     861927     09/12/200713:24     9596     2
3256999     WH20     1002     861928     09/12/200713:24     9596     2
3256999     WH20     1003     861929     09/12/200713:24     9596     2
3257169     WH20     2000     861964     09/12/200713:24     9596     2
The first 2 columns are header fields rest all are item fields. How do i map this to an Idoc, so as to move doc# and whse to header segment and rest of columns to add multiple item segments on the same idoc ? So for above file i should get 2 idocs only.

You can navigate thru these links to get more information:
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
http://help.sap.com/saphelp_nw04/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/ee/bf9640dc522f28e10000000a1550b0/frameset.htm
Do your want the source and target structures to resemble the structures below?
Source:-
<source_file>
<row_1>
<item_a>
<item_b>
<item_c>
</row_1>
<row_2>
<item_p>
<item_q>
<item_r>
</row_2>
<row_3>
<item_x>
<item_y>
<item_z>
</row_3>
</source_file>
Target:-
<target_idoc>
<item_a>
<item_b>
<item_c>
<item_p>
<item_q>
<item_r>
<item_x>
<item_y>
<item_z>
</target_idoc>
If so, then all you need to do is to use the node function: "remove context" for all the items under your rows. In other words,do the following mapping:-
*source_file mapped to target_idoc
*map each of the items under all the three rows in the following way:-
"source item" mapped to "remove context" (node function) mapped to (corresponding) "target item".
Also check the occurences for each of your variables in both source and target structures.
/people/ravikumar.allampallam/blog/2005/03/03/creating-purchase-order-idoc-through-xi
Regard's
-Prabhakar.A

Similar Messages

  • Flat file to idoc mapping issue

    Hi Gurus,
    i had a flat file format in sender side as below:
    H_ID     TYP_CODE    line_elemet      Quantity
    5896  STANDARD                       1.transmitter    1
    5896                  STANDARD       2.xxxxxxxxx           1
    5896                   STANDARD      3.yyyyyyyyy  2
    6895                  STANDARD       1.aaaaaaaaa        1
    9436                  STANDARD       1.bbbbbbbbb          4
    9436                  STANDARD       2.ggggggggg          3
    The above file need to be send to an Idoc.
    for which same header_ID values should create only one header segment, under that many a line segments should create as many line items appear on that header_id value.
    Here my query is how to suppress the repetetive header values to create onlyone header segment. And how to create as many line_item segments as the number of line items appear.
    points obvoius for the response
    Thanks in advance,
    Sekhar.

    About map problem I suggest youn to see the following link that are really helpful to improve knowledge about mapping:
    /people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    I suggest you to see the following link to learn more about mapping:
    Mapping functionality in XI
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
    SAP Exchange Infrastructure - Graphical_Mapping
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6658bd90-0201-0010-fbb6-afe25fb398d3
    SAP Exchange Infrastructure - Graphical Mapping Exercise
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/fd5ebd90-0201-0010-d697-91374d5b5190
    SAP Exchange Infrastructure - Graphical Mapping - Advanced
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e55f9548dd
    SAP Exchange Infrastructure: Mapping Patterns - Understand Context Handling in Message Mapping - Webinar Powerpoint
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f59730fa-0901-0010-df97-c12f071f7d3b
    SAP NetWeaver Exchange Infrastructure Mapping Troubleshooting - Webinar Powerpoint
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e01e9400-9e81-2910-20a5-a862945a5e98
    Mapping Lookups a RFC API
    Mapping lookups - RFC API
    XI 3.0 New Mapping Features
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8a57d190-0201-0010-9e87-d8f327e1dba7
    I hope these links will be usefull.
    Regards,
    Salvatore

  • Flat File to IDOC Mapping requirement to generate Multiple Segments

    Hi Experts,
    I got a requirement were i have 2 records in a file and i need to generate 2 IDOCs  with  multiple segments in it.
    FILE :
    10/01/2010     101  KRNA     ic_quantity          30-0257     3526     1     1     ea     110000     10
    10/01/2010     101     KRNA     ic_quantity          90-0005     3526     1     2     ea     110000     10
    Idoc should generate 2 IDOCs with multiple segments as shown below
    I have imported the IDOC and changed the occurrence to " unbounded "
    The Basic  IDOC Type :  WMMBID02
    I need to generate Multiple segments of  E1MBXY1
    i.e..,  First IDOC should contain two  E1MBXY1 segments
             Second IDOC should contain Four  E1MBXY1 segments
    IDOC1 :   WMMBID02
    Segment :   E1MBXY1( 2 segments)                                                       
    10/01/2010     101     KRNA     ic_quantity          30-0257     3526     1     1     ea     110000     10
    10/01/2010     101     KRNA     ic_quantity          90-0005     3526     1     2     ea     110000     10
    IDOC2 : WMMBID02
    Segment :  E1MBXY1 ( 4 segments)                                                  
    10/01/2010     101     KRNA     ic_quantity          30-0257     3526     1     1     ea     110000     10
    10/01/2010     101     KRNA     ic_quantity          30-0257     3521     1     1     ea     110000     10
    10/01/2010     101     KRNA     ic_quantity          90-0005     3526     1     2     ea     110000     10
    10/01/2010     101     KRNA      ic_quantity          90-0005     3521     1     2     ea     110000     10
    Can anyone suggest me how to generate IDOCs with multiple segments
    what are multiple ways of generating it
    Whether it can be achieved using Multi-mapping or I need go for UDF
    If any one has done has done this type of requirement ,please share the points.
    Thanks
    Sai

    Basically you need to generate idoc per record in the flat file. During fcc conversion you convert flat file to xml structure at the sender side. In the mapping use xml file structure source and idoc as receiver structure. You just export idoc and update the idoc segment 1 to unbounded.  Please follow the michael blog for file to idoc multimapping without bpm. Yes without bpm it is possible.
    see this link... This will answer your requirement.
    https://wiki.sdn.sap.com/wiki/display/XI/File%20to%20Multiple%20IDOC%20Splitting%20without%20BPM
    >Whether it can be achieved using Multi-mapping or I need go for UDF
    you dont need udf for this.

  • File to idoc mapping error

    Hi,
    I am mapping a flat file to idoc in xi. If I execute the test data it works fine. But in actual run, it gave me the following mapping error:
    com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_MT_APPayment_to_FIDCCP02_: Runt
    imeException in Message-Mapping transformatio~
    Exception of class CX_XMS_SYSERR_MAPPING
    Is it due to some mapping error or some basis config issue?
    Thanks,
    Jassi

    Hi Jassi,
    This may be a mapping issue, try this:
    a)in interface mapping see if grids are formed at source and target after executing the test option,
    b)also take the xml of the idoc from sxmb_moni , copy it and paste it at the source of the mapping ( use the src tab now) and execute the mapping, is your file structute formed?
    Check the following link:
    /people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
    Amaresh

  • Converting a flat file to IDOC

    Greetings to All,
    I have a requirement where i need to convert an IDOC (flat) file to IDOC.
    the idoc is SHPMNT04.Presently i am trying to implement it using FCC at the sender side as the flat file is fixed length type.
    Can any one suggest me a better method like using XSLT or Java mapping which could make my work smarter as i am Finding it very difficult to count and write the FCC for the IDOC which is have more than 60 segments.
    Any help will be greatly admired.
    Thnaks,
    Anika.

    Hi
    I am still having a doubt if this method will work on real time scenario.I mean i have to pick files
    from an 3rd party FTP location (polling and picking as and when i get a file starting with say
    ABC*.txt).Added to this there will be issue related to the volume of file(1000 per day),will that create
    any performance issues.
    It is now that you are sharing the complete scenario/ problem , just have a glance from your first post at the top & the replies, because its the problem statement that steers the discussion.
    Making the files available for the Report is a seperate task. You have to develop FTP-to-File XI scenario (or regular ftp process to send files across, which normally will not be allowed in XI server), I dont see any other way, if any, I 'assume' that it might complicate the situation.
    Performance - it is not something to do with your scenario alone, but the overall system load, configuration etc. (b.t.w 1000 is normal)
    Can we schedule a job for running the report periodically?
    Yes, scehdule a batch job calling this Report (with necessary variants) with required frequency or exact time (if there is any agreement with sender)
    I have started a POC
    I appreciate that, best way at this moment. you can reverse engineer from the errors to configure your scenario. for any reason,if you think it does not work, you can always stop and/or look for different solution.
    need your help
    - Definitely I will share my thoughts, if time permits
    how will i get the flat file xml(IDOC) in the source side
    do you mean the source structure, you can use the same structure as your target.
    once you are convinced with your solution approach, then it is better to close this thread & start a new one with new issues, for more views & suggestions and better readability.
    @Rajesh - I appreciate your efforts to solve the issue , but the below is not correct & possible, w.r.t this issue
    Here what you need is to do configure File Sender CC with NFS protocol.
    Regards
    Vishnu

  • 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

  • IDoc flat file to IDoc

    I am receiving flat file in SFTP Server which need to be posted into SAP (No mapping involved)
    What will be the best approach ?
    1. I tried using IDOCFlatToXmlConvertor (The limitation in the format of source file. The parent and child node relationship should be explicitly mentioned in IDoc flat file which legacy system is not able to do) - Any workarounds ?
    2. I moved the Idoc flat file into SAP application server. Now need to schedule job using program RSEINB00
    3. File Content Conversion
    Any other better solution ? Appreciate your help.
    Thanks and regards,
    Jose Augastine

    For converting Idoc Flat file to idoc xml, ABAP mapping is one of the feasible option.

  • Flat File to IDOC- didn't get data into IDOC

    Hi All,
    Our scenario is Flat File to IDOC....
    working fine... didn't get any errors... IDOC also generated but didn't get any data in that IDOC....
    for details see the attachment...
    Thanks In Advance,
    vishnu.........

    Hi Rajesh,
    I am getting payload in RWB from sender Cc like below:
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns:MT_File xmlns:ns="http://mouritech.com/file2idocsender"> 
    - <MT_File> 
    <Value>1</Value>  
    <Reason>test</Reason>  
    </MT_File>
    </ns:MT_File>
    If i test with this payload in mapping i am getting a pop up with this message and mapping not completed ...
    Could you please let me know what i have to do now?
    Pop Up: 
            The processing instruction target matching "[xX][mM][lL]" is not allowed.
    See error logs for details    

  • IDOC Flat File-- XI-- IDOC

    Hi,
       I have a requirement wherein we have to read the IDOC flat file and post it as IDOC to SAP using XI. I understand we have to use the Flat File Sender adapter and the IDOC Receiver Adapter. On the Sender Side we have to define the Content Conversion to convert the IDOC Flat File to IDOC XML. Writing File Content Conversion for the IDOC Flat File would be very tedious because of the number of fields and fixed structure of the flat file.
      I have don through the following guide Section 3.2 where it talks abt converting IDOC to IDOC XML using reportRSEINB00.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20convert%20between%20idoc%20and%20xml%20in%20xi%203.0.pdf
    I am not clear how to invoke this report in the Flat File Sender adapter. Also is there any other approach.
    Thanks
    Rajeev Gupta

    Hi Rajeev
    You have a flatfile at the sender side so you dnt  have any feasiable option to do other than FCC....FCC is not a tediuos one...if you can provide the strucutrre we will help you out...
    Check out you have a fixedlength file or piple separated one....
    In the functional design how many fields re present and buil the DT,MT MI accoprdingly.....
    you have to just use some conecnt conversion parameters that's it...
    item.fieldSeparator
    item.endSeparator
    item.fieldNames
    here item is your recordset name
    let us know your strucutre
    regards
    Nisar

  • Mapping FLAT File to Idoc

    Hi,
    I have to implement a flatfile --> XI ---> IDOC scenario and I have a question about the mapping.
    Suppose I have a Flat Fiel as following with the first 2columns as key:
    100991;001;text1;posting date
    100991;002;text2;posting date
    100992;001;text4;posting date
    100992;002;text6;posting date
    I have to pass this items to a IDOC strucutured  with header and positions.
    By mapping how can I group  key data to pass to single Idoc?
    Thanks
    marco

    Hi ,
    I have done it with ORDERS IDOC Structure .
    Since the source is a flat file you could take a simple structure with row and all the fields following it ( say filed1 , field2, field3).
    Take a bottom up approach for the child :
    Change the context of all the individual fields to the root then apply split by value on field3 ( this introduces context changes )
    Then format its parents Queue (Field2) based on Field3 Queue for this use the function Format By Example .
    Use the resulting queue  as one of the argument and Field1 to generate the link .
    Using Graphical this requirement is achievable . How ever it is upto your ease to choose which way you want to do it .
    Thanks & Regards
    Kavitha

  • IDoc to Flat file scenario - abap mapping

    Hi All,
    I have to do some IDOC to Flat file scenarios. In Order to generate the file in required format I will have to add all segments(Nodes) of Idoc in FCC receiver. We also have other option of doing it through ABAP Mapping which I found in one blog.
    Now my question is : Is it better way of doing it through FCC or ABAP Mapping?
    Ofcourse from development point of view ABAP Mapping looks easier as FCC is very time consuming task.
    Is there and performance issues in either of the approach?
    Thanks and Regards,
    Atul

    Hi VJ and Harald,
    Thanks for your replies.
    I am not having PI7.1 however the given blog was very informative.
    I will try using file port approach as suggested.
    Thanks and Regards,
    Atul

  • File content conversion - flat file to Idoc error

    Dear Experts,
    I have a situation where im using FCC in the sender adapter The data is in flat file with multiple fields separated by space .
    (*header444456    line4445758 header343434 line445687*) sample falt file data . should be divided as below
    header - 44456 , 343434
    *line    -  44457578 , 445687
    So i want to read the header items and pass it into header data of the IDoc and line items into line item data of the Idoc . And the header items and fields items are mixed up in the flat file . How do i read from the position 20 to 26 , 37 to 56 intermittently .And im not using any key field name . as the whole data is in one line . Any solution would be of great help .
    Thanks in advance
    Ganga
    Edited by: N.Ganga on Jan 28, 2012 3:30 PM
    Edited by: N.Ganga on Jan 28, 2012 3:30 PM

    Dear Grzegorz ,
    Yes i totally agree with you it can be separated by comma . But it is as below
    Header       - (once ).............................................. Flat file example :
         Field 1    -
    >order    line no 1   plant        material 1  code 1  quantity 1 
          .......................................................................order    line no 2   plant        material 2  code 2  quantity 2
         Field 2  (plant vlaue shuld come........................................................|
    Line          -  repeats (0-unbounded)                                      |                                     |                             |
       field 1 (line no 1)----
    |                                     |                             |
       field 2(material1)----
    |                             |
       field 3 (quant 1)----
    |
       field 1 (line no 2)----
    |                                     |                             |
       field 2(material2)----
    |                             |
       field 3 (quant 2)----
    |
    So i need to read the data intermittently and map them in the line items ignoring the order and plant data in every line apart from the first line. The order and plant remains the same in the flat file only line items keep changing .
    Hope my question is clear .
    Regards
    Ganga

  • Unsorted Flat File into IDoc with multiple use of nodes

    Hi Experts!
    I am facing a little problem. I have a source flat file for a classification where some fields appear several times.
    My source flat file looks like this:
    item1; field1a
    item2; fieldA
    item3; fieldxa
    item1; field1b
    as you can see the item1 exists twice (further appearances are also possible).
    Now i have to map the flat file into an IDoc structure
    My target IDoc looks like this
    Header
    -- node1
    attribute1
    -- node2
    the "field1a" and "field1b" has to be mapped into the "attribute1" in "node1". "node1" has to be duplicated for each time an "item1" appears (.. and if item2, item3 etc. appears twice, three ... four times...).
    So how can i reach it that the node1 will be duplicated automatically when an item appears twice or more times? I know that it could be possible to work with "SplitByValue"... but for this i need all item1 in an straight order.... but i dont have them in a correct order.
    I am looking forward to your suggestions.
    Thank you in advance.
    Udo

    Complex sorting is not or not easy possible with the grafical mapping tool.
    Use a sequence mapping. The first mapping is a simple XSLT which does the sort. The second mapping works as usual.
    I have an example XSLT which I used for a different purpose:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="/">
        <ORDERLIST>
          <xsl:for-each select="ORDERLIST/ITEM">
            <xsl:sort select="ID"/>
            <xsl:copy-of select="."/>
          </xsl:for-each>
        </ORDERLIST>
      </xsl:template>
    </xsl:stylesheet>
    Regards
    Stefan

  • Flat file to Idoc : Last line empty in payload

    Hello everyone,
    I'm trying to import Flat File from an external partner, and insert it in our SAP System as Idoc.
    It works fine, after a small change in the flat file.
    In the normal version, I have a last record with value 'OK'.
    I have add the close record.lastFielsOptional in the FCC.
    But after checking the payload, I have seen that I have at the end the following thing :
    <ns:File xlmns:ns="http://world.com/file">
    <record>
    </record>
    <record>
    </record>
    <record />
    </ns:File>
    Can someone explain me how to avoid to have this last <record/>, or checking it in mapping ?
    Thanks a lot

    Hello Greg,
    The problem is that the key in the flat file is 3 digit numeric field, and OK is 2 char.
    If I try to use the key, I have an error on the last record because we have only 2 char for the key, and when I put the parameter record.lastFiledsOptional : yes, i have no more error on the FCC, but the last record of the payload is empty.
    Have you a possibility to avoid this error.
    Thanks and regards
    JC

  • Flat file with IDOC structure on sender side - how to convert

    Hello,
    I have a flat file with an IDOC structure in it, like produced from R/3.
    Example:
    EDI_DC40  4000000000000761577620 3014  ORDERS05                                                    ORDRSP                                           SAPR3P    LS  LS_R3P_302                                                                                DATEIPORT2KMBG0000019887                                                                                20061206095508                                                                                20061206095508     
    E2EDK01005                    400000000000076157700000100000001004 EUR   1.00000     0039                                                     DFUE0000543012                                                                                12Muenster/Weststr.0000019887                                                                               
    E2EDK14                       40000000000007615770000020000000200630                                
    E2EDK14                       40000000000007615770000030000000200710                   ......             
    I need to send this file via XI to an R/3 system as an ORDERSP IDOC.
    My question is:
    What is the easiest way to do this?
    My intention is to us a self programmed mapping!
    Best regards
    Dirk
    null

    Hi Shabarish,
    I found a sinple solution:
    File adapter picks up file from external drive
    Receiver adapter saves it on XI server directory
    We21 can pick up now from here!
    But, next problem:
    When trying to save the file port in We21 (like described in the guide) I get a message: Port incomplete, not possible to save! (mess. is green -> information).
    But I cannot save the port. What is wrong?
    Hm, possibly reason was that inbound and outbound file name was the same! Now its OK! Port is created!
    Regards
    Dirk
    Message was edited by:
            Dirk Meinhard

Maybe you are looking for

  • Report for POs

    Hi Friends, we just want a report that shows the Document date, the Invoice date, the PO number, the vendor and the value if possible, Thanks in advance

  • Synced with another iTunes library

    There was a recovery performed on my computer and I have now lost all of my music on the computer. After re-installing iTunes I tried to sync my iPod but I get the message The iPod"*" is snyced with another iTunes library. An iPod can only be synced

  • Flash player to fullscreen non widescreen.

    I have looked several places and I can't seem to find anyone that can help me with this I want to know how to get Flash Player(on websites) to go completely fullscreen on my 1280x1024 display without it keeping its widescreen values. I want it to fit

  • Latest software update is causing the dock process to use an abnormally high amount of system resources- what's going on?

    After I installed the latest software update (updates that prepare some apps to run on OSX Lion), I'm noticing that the dock process is using 100% of my CPU when idle. This is causing my battery life to be 30 min at best. What's going on?

  • Strain measurement using 9237 and cDAQ 9172

    I am trying to measure strain using a 9237 and cDAQ 9172. The strain gage is connected to 9945 (Red wire to EX+, White to IN+ and Black to QTR terminal also tried connected the white and black to IN+ terminal). The 9945 is connected to 9237 quarter b