Creating multiple idocs in ABAP mapping

Hi,
my scenario is source message (JDBC) to target message (idoc).
There can be multiple idocs (unbounded).
I am using ABAP mapping to create the Idoc XML structure. For this i use function module IDX_IDOC_TO_XML.
The idoc is getting created but the problem occurs in case of generating multiple idoc instances.
I changed the idoc occurence to unbounded & used the new idoc external definition in the interface mapping.
I also call the IDX_IDOC_TO_XML & create the output stream factory in a loop (per idoc ).
However only 1 idoc gets generated every time.
Can someone suggest how to create the multiple idocs.
Regards
Prasenjit

Hi Prasenjit,
In order to generate multiple idoc first of all you need to change the target structure with multiple occurence...that you have already done...
Now while generating XML in abap mapping you have to make sure you have element idoc(with its content) repeating for your "N" number of idocs...
can you please copy paste your final xml generated...
Nilesh

Similar Messages

  • Create multiple idoc with multiple receivers based on value mapping table

    Hi,
    Scenario: 
    Step1 : sender sends a finance doc iin the form of an idoc. This idoc will have multiple line items based on profit center. Do determine the value of receiving comp code(header field) n receiving system(logical sys name) value mapping table has to be used.
    Solution so far: I can put an rfc lookup for fetching receiving comp code from mapping table with i/p paraameter as profit center . And split the incoming idoc based on comp code value by using split by value. Now I need your advise 2 take this further.
    Issue 1 : say the incoming idoc has 4  line seg wid 4 diff profit center
    Profit center.       Rec comp code.   Recv sys
    P1.                       C1.                        R1
    P2.                       C2.                        R1
    PS.                       C2.                        R1
    P3.                       C3.                        R2
    Nw using this info, I want 3 diff idocs to be created for each unique comp code.
    Idoc 1 : for C1 wid one line item + 1 for reconsilation ( to be generated additionally)
    Idoc2 : for C2 wid 2 line items + 1 for reconsilation
    Idoc 3: for C3 wid 1 line item + 1 for reconsilation
    Idoc 1 and idoc 2 shud be sent to R1.
    Idoc 3 shud be sent to R2.
    Kindly advise on this

    Hi experts,
    U all r pretty close, but let me put this more clearly.
    Step1: create multiple idocs based on unique comp code - I'm able to do this using rfc lookup n split by value. So I get 3 idocs each for c1, c2 n c3.
    Nw as per the values from value mapping table.
    Idoc for c1 contains 1 line seg.
    Idoc for c2 contains 2 line segs.
    N idoc for c3 contains 1 line seg.
    steps2 n 3,  where I do not have a confirmed solution yet n need ur advise.
    Step 2 : for each idoc generated I need 2 create n additional segment, mapping 4 which will be based on the values in the original segments for that idoc.
    In d above scenario, idoc for c1 contains 1 line seg, nw I want 2 add one more seg to it. The amount and pisting key values in this segment wud be calculated based on the values of the amount and posting key belonging to the original segment in this idoc.
    Similarly for idoc for c2 there are 2 segs, nw I need one more, means 3 in allm
    Hence for idoc for c3, 1 orig already present + 1 more. = total 2.
    Nw I need ur advise on how 2 generate this additional seg in each idocm
    Step 3: when all dese 3 idocs are generated, ( in this case itz 3, in real time it can be n), I need to find their respective receivers using rfc lookup n then based on the receiver send 2 resp recvng systm
    Nw how do I do this?
    Please explain with examples if possible 4 bettr understanding.
    u2020ђąu03B7kўu03C3u03C5 in advance.

  • How to create multiple idocs based on complex condition

    HI Users,
    my scenario is jms(xml file) to idoc. for each file have multiple records for each record i need to create multiple idocs.
    source structure:
    <lineitem>
    <student sid="cid">456</student>
    <hreference>
    <reference rtype="number">123</reference>
    </hreference>
    <hreference>
    <reference rtype="number">789</reference>
    </hreference>
    <hreference>
    <reference rtype="char">147</reference>
    </hreference>
    now condition is One input message must create only one output message for each unique  rtype="number" and sid="cid" combination.
    for example
    1. rtype="number" and sid="cid" the value combination means 123456 for this one idoc
    2.  rtype="number" and sid="cid" the value combination means 789456 for this one idoc
    --> the below file shows with out sid="cid"
    <lineitem>
    <student sid="abc">456</student>
    <hreference>
    <reference rtype="number">123</reference>
    </hreference>
    <hreference>
    <reference rtype="number">789</reference>
    </hreference>
    <hreference>
    <reference rtype="number">147</reference>
    </hreference>
    in this case we have to consider only rtype="number" so here we need to create  3 idocs.
    Could anyone help me in this regard.
    Thanks in advance

    Hi Swathip,
    Change the occurence of the IDoc to "unbounded", so that multiple IDocs can get create
    Try with below logic
    If (SID = "CID")
    Then
         If(rtype = "number")
              concat(student,reference ) ---> removeContext ---> Idoc          
    Else
         rtype ---> removeContext ---> Idoc
    If combination of unique  student and reference can occur more than once in the XML, use sort command and splitByValue (Value Change)
    Edited by: chandra shekhar on Jul 3, 2011 12:53 PM

  • How to create multiple Idocs in SAP R3 ?

    I have been asked question on Idocs from MNC company.
    How to create multiple idocs in R3 ? Please let me know.

    hi ,
    if you want to create in multiple IDOCS in XI , take XSD of IDOC and chnage the occurance to 1 to UNBOUNDED, you can genarate multiple IDOCS.
    Regards,
    Raj

  • Creating multiple links from one map image in Flash CS4

    I have been tasked with creating multiple links from one map image using flash. Each link would go to the main website page with that location. I assume I could create a button for each location on the map but not having a lot of experience any help / tutorial you know of would be super helpful.. Thanks! Not looking for someone to work me thru it but a little guidance would be great!

    If I was to answer the problem, I would be giving you what you asked not to be given... the solution.  So I'll suggest that you start by researching the getURL() function.  That is what AS2 uses for opening web pages.
    As for coding a button, I'll recommend the following article for you... it will explain the proper approach to coding a button, which will give you an advantage over others who don't follow it, but instead use the way the article says not to.
    http://www.adobe.com/devnet/flash/articles/as_bestpractices_04.html
    Google is one of the best resources available for learning how to do things with Flash--it's the first place I go when I have a wondering.  In general, if you type in the right keywords, you get fairly good search results.  In your case, combinations of "AS2", "button", "getURL", "tutorial" would probably work well.

  • Multiple document numbers not created while creating multiple idocs.

    Hi Experts,
    we have developed one the interface file to idoc, whenever invoice number change it will create a multiple idocs.
    but i am facing some issue with context handling, can you suggest the suitable mapping / UDF for the below issue.
    Our customized idoc structure has header and line items and both are in not same level-its parent child structure.
    in our sample file there are three different invoice number and as per the requirement its creating three idocs and corresponding headers but not line item details.
    all line item details creating in 1st idoc itself and 2nd and 3rd idoc has only header items no line items. but tried fix with graphical mapping context handling for this problem but not resolved. please advise.
    Regards,
    Krushi.

    hi Hareesh,
    thank you for your quick response.
    after the File Adapter FCC, below is the inbound payload, first four feilds we mapped to header and rest for line items.
    <SettlementDetails>
    <row>
      <PaymentType>CHECK</PaymentType>
      <Filler></Filler>
      <Currency>IN</Currency>
      <Filler1></Filler1>
      <Invoice>100410-133MT5-MH</Invoice>
      <Filler2></Filler2>
      <SettlementMethod>4</SettlementMethod>
      <Filler3></Filler3>
      <PreferredTradingPartnerIdentifier>MT</PreferredTradingPartnerIdentifier>
      <Filler4></Filler4>
      <FinalPayAmount>12.00</FinalPayAmount>
      <Filler5></Filler5>
      <ProductIDUnformatted>55111064001</ProductIDUnformatted>
      <Filler6></Filler6>
      <Filler7></Filler7>
      <Filler8></Filler8>
      <PaytoPreferredTradingPartnerIdentifier>MT</PaytoPreferredTradingPartnerIdentifier>
      <ClaimType>ORIG</ClaimType>
      <CMSRecordID>FFSU</CMSRecordID>
    </row>
    </SettlementDetails>
    multiple settlement details will be there.
    regards,
    krushi.

  • Create multiple IDocs

    Hi experts,
    I have a scenario where XI has to read the following flat file.
    FI010 delivery start ( 1..1)
         FI020 Section start (1..n)
              FI030 paymentrecord ( 1..n )
                   FI040 Name adresse record                     FI041 Meddelelsesrecord
         FI080 Sektion end
         FI020 Sektion start
         FI080 Sektion end
    FI090 delivery start
    For each FI020 section XI has to create an Idoc.
    In the message mapping i can create only one idoc.
    How can i split this source message into multiple messages ( dependant on FI020 section records ) so that message mapping is done for each message and mulitple IDocs are created???
      Can i split the source message using file adapter?
      can i use BPM transformation to do this??
    Looking forward to share your ideas.......
    thanks in advance
    Suneel
    Message was edited by: Suneel

    Hi,
    I was reading thru the thread..
    I request a help.
    I have a scenario where i have a outbound idoc (Zartmas04)
    Against a material it can have multiple plant information.
    It is required I update 6 tables of anotehr application if the incoming messages have all the mandatory fields..Else i have to consolidate all the error (Material Plant Comination) and send a Mail
    Let me know how can i achieve this
    Thanks
    John

  • IDOC--XI--IDOC Using ABAP MAPPING

    Hi all,
    My requirement is to map source IDOC fields to target IDOC fields using ABAP Mapping.
    few fields in source idoc structure has to be merged into a single field in target idoc structure.
    need help on how to start with as i am not exposed to ABAP Mapping.
    regards,
    Subba

    Hi Subba,
    I suggest you also go through these links:
    https://websmp101.sap-ag.de/~sapdownload/011000358700003082332004E/HowToABAPMapping.pdf
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    /people/r.eijpe/blog
    ABAP Mapping Vs Java Mapping.
    Re: Message Mapping of type ABAP Class not being shown
    Re: Performance of mappings (JAVA, XSLT, ABAP)
    Refer to following SDN Demo which explains the need and how to do the ABAP mapping.
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#jdi [original link is broken]
    This document will help you to create ABAP Mapping.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how%20to%20use%20abap-mapping%20in%20xi%203.0.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    Regards,
    Abhy
    Message was edited by: Abhy Thomas

  • Create multiple idocs at once

    Dear Experts,
    I need to create few Idocs - for MBGMCR -  in WE19.
    Can you please suggest is there any shortcut to to similate multiple idocs at a time.
    I saw the option of using file as a template in WE19. But donot know how to use it.
    Can some one pls help me?
    Regards,
    Shashidhar

    For the file option, you need to define a file port in WE21 then format a file in your IDOC format and drop it in that location.  You then specify the file location in WE19.  When I need to run a bunch of IDOCs, I use LSMW with WE19.  LSMW can do just about anything.  It depends on your requirements I guess.

  • JDBC to Idoc mapping - create multiple Idocs from 1 JDBC input

    I am importing data using JDBC and I want to put the data in an IDoc on a SAP system.  my data is about 100,000 rows, but my Idoc (ZIDOC) is defined as 1-35,000 for the segments.  I have followed Ossnote 814393, and also set up my Interface Mapping to use my JDBC source and the Idoc as the target.  In my Message Mapping, i use the source as my JDBC Message Type, and the target is my External Definition Idoc (changed to be 1 to unbounded). 
    My incoming JDBC mapping is:
    JDBCinput     (1:1)
      -row            (0...Unbounded)
          -part        (1:1)
          -unit        (1:1)
          -type       (1:1)
    my outgoing Idoc (from external definition) is:
    ZIDOC           (1:1)
      -IDOC          (1...Unbounded)
         -Begin       (required)
         -EDI_DC40  (1:1)
         -Zsegment   (1...35,000)
            -part        (1:1)
            -unit        (1:1)
            -type       (1:1)
    I currently map JDBCinput = ZIDOC and IDOC,  row = Zsegment, and the rest of the rows match. 
    When I use this mapping, my first 35,000 rows from my JDBC input gets mapped to ZIDOC with 35,000 segments, but the remaining 65,00 rows from my JDBC input just seem to be lost, as only this one ZIDOC is created.  I would expect to see 3 Idocs created, 2 with 35,000 segments each, and the 3rd Idoc created with 30,000 segments.
    Does anyone know what I need to change to get this mapping to work and create the extra needed Idocs?  Can this be done with out using a BPM?
    Any guidance? 
    Thanks
    Jake

    HI,
    Just try out with context change and check if it works
    In this type of case, it is easy to use Java mapping so that you can generate target structures as you like.
    Hope this helps,
    Regards,
    moorthy

  • Creating Multiple IDOCs and Line Items based on Posting date from file

    Hi All,
    My scenario is File to IDOC(MBGMCR01)...
    Need your suggestions and help on how to go with this...
    Source file structure is
    DC61|2009-03-15|000000000001200051|00000005.00|200|0001|1234|
    DC61|2009-03-15|000000000001200363|00000001.00|300|0001|1234|
    DC61|2009-03-15|000000000001200334|00000002.00|400|0001|1234|
    DC61|2009-03-16|000000000001201145|00000001.00|200|0001|1234|
    DC61|2009-03-16|000000000001201086|00000002.00|100|0001|1234|
    DC61|2009-03-17|000000000001200051|00000003.00|200|0001|1234|
    DC61|2009-03-17|000000000001200052|00000003.00|200|0001|1234|
    DC61|2009-03-17|000000000001200053|00000003.00|200|0001|1234|
    DC61|2009-03-18|000000000001200056|00000003.00|200|0001|1234|
    And target IDOC(MBGMCR01) is
    IDOC (0u202699999)
    E1BP2017_GM_ITEM_CREATE(0u2026999999)
         Date
    For Each new Posting date(column 2) of the source a new idoc to be created and the corresponding records of each posting date to be added to E1BP2017_GM_ITEM_CREATE
    The out put for the above should be like this
    IDOC(2009-03-15)
    E1BP2017_GM_ITEM_CREATE=2009-03-15
    E1BP2017_GM_ITEM_CREATE=2009-03-15
    E1BP2017_GM_ITEM_CREATE=2009-03-15
    IDOC(2009-03-16)
    E1BP2017_GM_ITEM_CREATE=2009-03-16
    E1BP2017_GM_ITEM_CREATE=2009-03-16
    IDOC(2009-03-17)
    E1BP2017_GM_ITEM_CREATE =2009-03-17
    E1BP2017_GM_ITEM_CREATE=2009-03-17
    E1BP2017_GM_ITEM_CREATE=2009-03-17
    IDOC(2009-03-18)
    E1BP2017_GM_ITEM_CREATE=2009-03-18
    Will be thank ful if any one gives a hint....
    Thanks and regards,
    Sridhar

    I rather meant a picture of your mapping - anyways. Hope this is correct:
    Your souce structure:
    <MT_IAR>
      <IAR_Recordset>
        <IAR_Details>
          <Inv_adj_date>
        </IAR_Details>
        <IAR_Details>
          <Inv_adj_date>
        </IAR_Details>
    Than mapping should be like this:
    <Inv_adj_date>        ==> SplitbyValue        ==> IDOC
    Please confirm this doesn't work.

  • How to create multiple extract from one map

    Hello ,
    I have a map which extract data from source and create a output text file. Now, I need to create 10 different files from the same mapping with same format but different name. So I want to generate file1.txt, file2.txt, file3.txt etc . My map currently has one target file , i donot want to create 10 target files operator in the map itself, is there a way to achive this functionality ie I want to call the same map 10 times. Do I have to do it from outside.
    Thank you.
    Suhail

    Hi Suhail
    Why not create 10 maps? These don't take up much space, only a few Kb, and you would be able to generate a unique file per map, which would be the correct approach.
    If you don't want to have duplicate maps, would the data in the output files be the same or would it need to change based on some condition?
    If the data is the same you can do this externally by just making x copies of the original file.
    If the data needs to change you either need to have multiple maps, as mentioned at the beginning, or you would somehow need to change the source data. You cannot change the name of a mapped output file, this is because OWB maps use a hard-coded file name making it impossible to change the name of the file dynamically.
    However, let's say you are able to change the source data, perhaps using a view. If you had x copies of the view script you could generate it x times, calling the map x times. Each time you would run the map it would generate file1.txt, and you would need to rename it to file2.txt before recompiling the view and rerunning the map to get another file1.txt. This would be renamed file3.txt and you could then repeat the process as many times as you like.
    Does this help?
    Regards
    Michael

  • Message output(IDoc) from MIGO creates multiple idocs repeats for each line

    Hi Experts,
    We want to send one idoc message thru MIGO output message control upon posting at HEADER level regardless of how many line items are there on the Purchase Order.
    Using MIGO we are doing a 101 goods receipt on a PO with 3 line items and we are getting 3 idocs created with the same information form the message output control(basically it is at item level).
    I don't know if this is how standard SAP designed the MM message output control.
    From MIGO or MB03 there is no option to display the messages at the header level because you have to go thru the line item details to see the messages
    I have also tried the collective slip option on MIGO and it did not work(help suggests that it will combine everything in one output)
    Can you please let me know if there is a config or development that needs to made on controling the message output at the header level from MIGO.
    Thanks for all your help
    Shraj

    Hi Sri hari Raju.
    Did you solve this problem?
    Can you tell me how?
    Thanks

  • 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

  • Idoc  - JMS queue using ABAP Mapping

    Hi all,
    I am doing a idoc to JMS queue scenario using ABAP Mapping. I am new to ABAP
    Basically i want to know how to read the OUTBOUND idoc segments and their field values. I have gone through link : IDOC--XI--IDOC Using ABAP MAPPING(Idoc to Idoc using ABAP Mapping).
    If any body could suggest me how to read idoc->segment->fields or give some sample code, it would be very helpful.
    Thanks in advance&
    Regards,
    Mani

    Hi Mani,
    Maybe it would be easier to use graphical mapping. In ABP mapping you have to parse XML and than create target document. If you want to do it I'd strongly advice you to read it:
    http://help.sap.com/saphelp_nw04/helpdata/en/47/b5413acdb62f70e10000000a114084/frameset.htm
    Regards,
    Wojtek

Maybe you are looking for

  • T_Code 1KEK - Transferring Receivables and Paybles to PCA

    Hi SAPients, We normally do the transfer of Receivables and Paybles to PCA through T-code 1KEK as a period end closing process. Now something strange is happening which was never before. While transferring the Receivables and Paybles through 1KEK, al

  • CC Applications PS, etc Won't launch in new install of ML on Imac Platform Config Error 213:5

    CC Applications PS, Illustrator, Adobe Acrobat Pro will not launch in newly installed Mountain Lion OS on Imac Platform. Attempts to launch and run CC applications results in  Configuration Error: 213:5. Further, On board PS and Lightroom application

  • G5 will Not Start but Powerlight is on

    After a recent storm/power outage, with my G5 in sleep mode at the time, I cannot restart my machine. Interestingly, the power status light came back on when power was restored, and comes back on each time I remove and then replace the power plug. I

  • Reset or delete transactional data in SD

    Dear All, We would like to delete the existing transactional data in SAP-SD  in our Development server such as Enquiry Quotations, Order, Delivery, Billing Documents, Excise Invoice, ARE1 and ARE3. Request to let me know the TCODE or Program or Repor

  • [ERROR] javaType customization in this context must be nested (JAXB spec

    Hi All, when i was trying to generate java classes from schema xjc is giving the below error. parsing a schema... [ERROR] <javaType> customization in this context must be nested (JAXB spec <property> <baseType> <javaType ...> </baseType> </property>