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

Similar Messages

  • 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 ORACLE ERROR!! Please help

    hello all
    I am using OWB on Oracle9i.
    Trying to map flat file (file.txt) to oracle table,
    Validate: okey, some warning
    Generate/Deploy: successful.
    But when I check to the database sqlplus there is no rows existed. I verify that I connect to the right database.
    My question is:
    When doing a map from flat file to oracle table. Do I have to have some thing in the middle such as (filter, join) or I just can do a straight mapping if I don't have any condition to filter out.
    Please response if you know the answer.
    Your answer greatly appreciated. Thank you for your help
    Regards,

    If you are using an OWB version which is 9.0.3.x or earlier, to load a flat file into the database, you should generate SQL loader files and run them either manually or by using a scheduler.
    The new version (9.0.4) supports external tables, so you don't have to use SQL loader. Please refer to the user manual for more details.
    Regards:
    Igor

  • Java heap space error occured during message mapping of FILE to IDOC

    hello Friends,
                          I am trying to do the message mapping for File to Idoc scenario.
    Idoc which I am using is HRMD_A.HRMD_A06 and infotype which I want to update is 14. I am trying to map the message type which I hav created for infotype 14 with the IDOC
    Its very simple scenerio but  every time I try to save the mapping before activating it I get an error:
    Java heap space
    Internal problem occurred (INTERNAL_PROBLEM)
    Java heap space.
                I am not able to figure out what possibly is the problem wheather its from my end or the BASIS end.
    Kindly help.
    Regards,
    Lokesh

    As the server probably survives (you restart your Integration Builder and can probably connect immediately), the problem will be on your side (client). Did you add one or more large xml-test-instances to the mapping ? If yes, delete them, because they lower the performance and can make problems. If not, then this is a strange problem. Even if the Idoc structure is complex, the mapping object itself cannot be that large.Is this problem only with this one mapping ?
    CSY
    Edited by: Christian Sy on Mar 9, 2010 6:26 AM

  • 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

    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

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

  • Mapping from File to IDoc with multiple Idocs and multiple line items?

    Hi All,
    Need some help with mapping, requirement as below: I have a flat file with multiple records, need to create multiple idocs per each separate order in flat file with as many line items.
    Order_1 field-1 field-2 field-3 field-4
    Order_1 field-1 field-2 field-3 field-4
    Order_2 field-1 field-2 field-3 field-4
    Order_2 field-1 field-2 field-3 field-4
    Order_3 field-1 field-2 field-3 field-4
    Order_3 field-1 field-2 field-3 field-4
    I have imported IDoc changed to 1:Unbounded, able to create multiple Idocs based on separate order from flat file.
    Order_No - removeContexts - splitByValue(ValueChanged) - collapseContexts - exists - creatIf - IDOC
    Now I am having hard time creating a line item segment E1EDP01. I want to have Idoc created below way:
    IDoc-1 (Order_1)
    E1EDP01
    E1EDP01
    IDoc-2 (Order_2)
    E1EDP01
    E1EDP01
    IDoc-3 (Order_3)
    E1EDP01
    E1EDP01
    I am getting multiple IDocs created. Please help me to create mutlieple line items under each Idoc. Please be speficic about the node funtions to be used, because I tried many times with different combinations, didn't work.
    Regards,
    N@v!n

    Hi Navin,
    Create your source structure like below
    <Order>1 to unbounded
        <Order_No>
        <field1>
        <field2>
        <field3>
        <field4>
    </oder>
    to create mutiple IDocs based on order number,use below logic
    Order_No-->removecontexts--->sort--->splitbyvalue(Valuechange)--->collapsecontext-->Idoc
    use below logic for E1EDPO1,
    Order----->removecontexts------>
                                                                                    formatByexample------>E1EDP01
    Order_No-->removecontexts--->sort--->splitbyvalue(Valuechange)-------->
    try above logic and let me know if you any issues.
    Regards,
    Raj

  • 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

Maybe you are looking for