Mapping Issue: one IDoc to multiple IDocs concerning incoming segments

Hi,
i want to devide one incoming IDoc to two or more outgoing IDoc's of same type concerning the appearance of one segment.
Incoming is:
   <IDOC BEGIN="">                   1...1
      <EDI_DC40 SEGMENT="">
      </EDI_DC40>
      <..>
      <Z1MOV SEGMENT="">  0..99999
      </Z1MOV>
   </IDOC>
Target should be:
for each Z1MOV one IDOC.
   <IDOC BEGIN="">                   1...1
      <EDI_DC40 SEGMENT="">
      </EDI_DC40>
      <..>
      <Z1MOV SEGMENT="">  0..1
      </Z1MOV>
   </IDOC>
I already did the occurance change, like imported target IDoc with changed attribute maxOccurs="unbounded".
I mapped the segment Z1MOV to IDOC but when Z1MOV occurs more than one time the target gets generated only one time. I changed the occurance of the IDoc to maxOccurs="unbounded".
What do i have to do to make it run?!
br

Can someone help?
When i switch to debug while testing message mapping i get following:
Close tag
Close tag
Start tag
Targetelement /ZIDOC/IDOC[2]/BEGIN kann nicht angelegt werden. Prüfen Sie, ob die XML-Instanz für die Ausgangs-XSD und die Zielfeldzuordnung die Anforderungen der Ziel-XSD erfüllt. Zielelement /ZIDOC/IDOC[2]/BEGIN kann nicht angelegt werden. Prüfen Sie, ob die XML-Instanz für die Ausgangs-XSD und die Zielfeldzuordnung die Anforderungen der Ziel-XSD erfüllt.
I hope you can get the idea of this error because i can't tanslate.
But the BEGIN is required for each message so how to get rid of it. This also concerns the SEGMENT-tag under each Segment of the IDoc.
br

Similar Messages

  • Split the IDOC into multiple IDOC if the IDOC has more than 500 records

    Hi All,
    I developed an outbound IDOC in which we are facing an issue.
    There is some limitation on the maximum idoc size it can handle.
    If number of records is more than 500, split the idoc into multiple iDoc's, e.g. if it would have 1300 records , the result would be 2 iDoc's with 500 records, and the last one would have 300 records
    How can i acheive this.
    Regards
    Jai

    Hi,
    1) first you need to know which message type/Idoc type you are triggering.
    2) Get the Corresponding processcode from Partner profiles(WE20/ WE41).
    3) Then the look for prper user-exit in the related processing FM.
    4) write logic to split the IDoc accordingly.
    if no proper user exit available then copy the standard processing FM and need to all ALE related configurations.
    Catch hold any ABAP expert in your team to do all these.
    Suresh

  • Split Single IDOC into Multiple IDOC's Based on Segment Type

    Hi Experts,
    I have a scenario IDOC to FILE ,  Split Single IDOC into Multiple IDOC's based on Segment Type
    Outbound:
    ZIdocName
    Control Record
    Data Record
    Segment 1
    Segment 2
    Segment 3
    Status Record
    I should get output like below
    Inbound:
    ZIdocName
    Control Record
    Data Record
    Segment 1
    Status Record
    ZIdocName
    Control Record
    Data Record
    Segment 2
    Status Record
    ZIdocName
    Control Record
    Data Record
    Segment 3
    Status Record
    Please suggest me step by step process to achieve this task.
    Thanks.

    Thanks a lot Harish for reply.
    I have small doubt. According to your reply , If we have N number of segments in single IDOC with same fields in all segments then for splitting Single IDOC into Multiple IDOC's based on Segment Type we need to duplicate N number of target IDOC tree structure.
    Is that possible to Split single IDOC into Multiple IDOC's based on Segment Type using only one Target IDOC structure without duplicating the Target IDOC structure tree.

  • How can I split an Orders05 iDoc into multiple iDocs?

    Hello,
    Can one of you experts please tell me how I can split an ORDERS05 iDoc into multiple iDocs based upon Delivery addresses? 
    For example, if the iDoc contains 3 different Delivery Addresses then I need to split it into 3 iDocs.
    It has been suggested to me that I can Create a custom function module. In this custom fm split the idoc into 3 based on the delivery address and create it using the FM MASTER_IDOC_DISTRIBUTE.
    Problem is I don't know how to do this.  Any help is greatly appreciated.  Thanks.
    Dan

    Hi Dan Avis
    Write a Custom  Z program .
    1 get order05 idoc number....
    2 get the segment details...(Based on you condition...)
    3 In a loop  send the data to the FM MASTER_IDOC_DISTRIBUTE  (Based on you condition...)
    4 IDOC will generated,,,every loop and
    5 Change the status of original idoc .
    or
    Create Function module and use the FM as process code to create 3 idocs...and processs...new generated idoc and block original idocs...
    Call me if you have questions  @ 302 290 5677
    Thanks
    Ramesh

  • Multiple IDOC to Multiple IDOC scenario without BPM steps????

    Hi
    Could you please give me the solution for this ???
    I want steps for sending all IDOCs at a time- ---"Multiple IDOC to Multiple IDOC scenario without using BPM".???
    thanks
    3nadh

    Hello,
    Refer the below, for certain details!
    /people/swaroopa.vishwanath/blog/2007/01/22/ale-configuration-for-pushing-idocs-from-sap-to-xi     ALE configuration for pushing idocs from SAP to XI
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change     XI: IDOC bundling - the "trick" with the occurance change
    Regards,
    Jilan

  • 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

  • Each line of a file to a single Idoc (one file to multiple IDoc)?

    Hi Community,
    I have a flat file with many lines. Each of these lines has the same structure and has to fill a separate IDoc. How can I configure XI that it creates for each line a separate IDoc?
    I already found a blog to such a topic: File to Multiple IDocs (XSLT Mapping)
    But thatu2019s not what I am looking for (or I do not get the Point).
    I also tried to set u201CRecords per Messageu201D to 1. But that is not working to. :/
    Maybe one of you guys has an idea?
    Thanks in advance,
    Udo

    Hi Udo,
    For instance if  file structure is as follows:
    <File>
    <Header>
    </Header>
    <Item>
    </Item>
    <Item>
    </Item>
    </File>
    Now if u want to genarate a new Idoc for each n every <Item> in the file. The Header Information is to be repeated for each IDOC as well.
    Then allu need to do is  import the idoc in XI, then take the idoc xsd and change the occurrence o..unbound and then create the external definition.
    Look into this blog.
    The specified item was not found.
    Now use the external definition in your mapping instead of using the original IDOC. In your mapping map the item to IDOC, and for header data you have to use the useOneAsMany function.
    Reward if found useful
    Regards,
    Vinod.

  • One file for multiple IDOCs

    Hi,
    Need help on IDOC files created on application server.
    For IDOCs of EDI type generally one file is created on application server for one idoc. Is there any way to create a common file for multiple IDOCs that are created in a batch job?
    Thanking in anticipation
    Sudhir Bhate

    Hi Sudhir;
       Yes, it is a setting on the outbound parameters of the partner profile.  In the section for "output mode," select "Collect IDocs."  This link to help.sap.com describes the procedure:
    http://help.sap.com/saphelp_nw04/helpdata/en/dc/6b812a43d711d1893e0000e8323c4f/content.htm
    Cheers,
    John

  • One Message, Call multiple IDOCS in PI 7.1

    Hello SDN!!
    We are trying to implement a scenario and curious if anyone has done this. We are looking to have one message exposed to another system, which will be mapped and sent to four different IDOCS on the same system. From some blogs it seems this really can't be done except by BPM. Is this the case, and if so, are there any good tips to do the most basic BPM to have this scenario complete? (Also all the documentation seems to be in 7.0)
    Cheers
    Devlin

    Hello from the first response mapping without bpm it states it is not possible with IDOC
    Messages that result from the split in a mapping-based message split are sent using one AE. So only adapters running on the AE are supported. In particular, this means that target IDOC message splits are not supported since the IDOC adapter is not part of the AE.
    The other two blogs are nice, but wrong direction, instead of collecting IDOCs I was hoping to have one message split out to 4 IDOCS,
    Cheers
    Devlin

  • Copy one file to multiple IDOCs in XI

    Hi,
    I am having following scenario..
    XI receiving XML file with Sales order and customer information.
    Using this file, first I have to create customer and then create sales order using same file if customer is created successfully.
    Please advice how to solve above scenario
    Thanks in advance,
    Laxman.

    Try BPMPatternMulticastSerial BMP Pattern. You can first create the customer, then receive a response (If Sync) and then send the Sales Order. This uses the ForEach mode.
    Hope this Helps to get you started!

  • Import map issue one record at a time

    Hello Experts,
    I built an import map to run it manually with import manager, but when I click on Ready to Import, the import manager is doing one record at a time.  I have to go back to the match tab and refresh in order to import the rest. 
    Any idea where to setup a setting to import all records at once?
    Thank you very much for your help,
    Claudia Hardeman

    Hi Claudia,
    Please check if your matching criteria results in fewer records,what is the matching criteria you are setting?
    Do you see a total of 300 under "Create" Match Action?
    No of records to be imported is governed by Match action which tell the MDS which are distinct records,Match Action tells MDS what is to be done with this number of records which have this Match type.
    Please check if you have "SKIP" as match action,if yes use a appropriate action for match type.
    Do a "Save Update" of the map.
    Please revert with results.
    Thanks,
    Ravi

  • File-XI-multiple IDoc Scenario

    Hi there -
       I am working on single File-XI-multiple IDoc Scenario and have following questions:
    (please keep in mind that there is already an existing multiple IDocs-XI-single File scenario between the same systems)
    1. Please provide any detailed step by step documentation from end-to-end.
    2. I am thinking it's compulsory to use BPM, is there any way to aviod?
    3. Is it possible to update existing IDocs in R/3 directly from the data from XI?
    Thanks everyone in advance...
    Pat

    HI,
    Pls go thru following links-
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    Single inbound file -> XI -> Multiple IDOCs in SAP
    One file for multiple IDOCs
    Hope this helps..
    Regards,
    Moorthy

  • Breaking up of, One IDoc to many IDocs & combing Many IDocs into one IDoc?

    Does anybody have any sample code of:
    Splitting an IDoc into multiple IDocs and
    Combining many similar IDocs into one IDoc
    Any pointers will be appreciated.
    Regards
    Mahesh

    This is the code for splitting of an inbound idoc into multiple idoc
    REPORT ztemp no standard page heading .
    ******************Data Declaration for selection screen***************
    TABLES: edidc,edidd.
    CALL SELECTION-SCREEN 9000.
    SELECTION-SCREEN: BEGIN OF SCREEN 9000,
                      BEGIN OF BLOCK b1 WITH FRAME.
    SELECT-OPTIONS: idocno FOR edidc-docnum.
    SELECTION-SCREEN:END OF BLOCK b1 ,
                      END OF SCREEN 9000.
    *******************Data Declaration ************************************
    DATA : it_contrl LIKE TABLE OF edidc WITH HEADER LINE,
           it_hdata     LIKE TABLE OF edidd WITH HEADER LINE,
           it_fdata  LIKE TABLE OF edidd WITH HEADER LINE,
            it_gdata  LIKE TABLE OF edidd WITH HEADER LINE,
           it_data LIKE TABLE OF edidd WITH HEADER LINE,
           it_status LIKE TABLE OF bdidocstat WITH HEADER LINE,
           it_bdwfretvar LIKE TABLE OF bdwfretvar WITH HEADER LINE,
           it_bdi_ser LIKE TABLE OF bdi_ser WITH HEADER LINE,
           it_ldata LIKE TABLE OF edidd WITH HEADER LINE,
           it_tede2  LIKE  tede2,
           vbeln LIKE vbak-vbeln,
           idocnum LIKE  edidc-docnum,
           result LIKE bdwfap_par-result,
           it_stat LIKE edids.
    DATA : count TYPE i ,
           counter TYPE i ,
           temp TYPE i VALUE 1 ,
           line TYPE i ,
           tab LIKE sy-tabix.
    *********************passing values to control record*****************
    it_contrl-direct = '2'.
    it_contrl-rcvprn = 'ID3IDES802'.
    it_contrl-rcvprt = 'LS'.
    it_contrl-doctyp = 'ORDERS05'.
    it_contrl-idoctp = 'ORDERS05'.
    it_contrl-sndpor = 'ZSOFI'.
    it_contrl-sndprt = 'LI'.
    it_contrl-sndprn = '1000'.
    it_contrl-mestyp = 'ORDERS'.
    APPEND it_contrl.
    ************************Select query for data*************************
    SELECT   * FROM edid4 INTO CORRESPONDING FIELDS OF TABLE it_fdata
    WHERE   docnum IN idocno.
    SELECT   * FROM edid4 INTO CORRESPONDING FIELDS OF TABLE it_data
    WHERE   docnum IN idocno AND segnam NOT LIKE 'E1EDP%'  .
    SELECT   * FROM edid4 INTO CORRESPONDING FIELDS OF TABLE it_hdata
    WHERE   docnum IN idocno AND segnam  LIKE 'E1EDP%'.
    **************select query to count the no of E1EDP01 segment*********
    SELECT COUNT( * ) FROM edid4 INTO count  WHERE docnum IN idocno AND
    segnam = 'E1EDP01'.
    *************to determine the no of idocs to be generated************
    count = count / 5.
    PERFORM datasplit.
    **********************************for remaining idocs*****************
    counter = count MOD 5.
    IF counter NE 0.
      PERFORM dataremain. .
    ENDIF.
    *&      Form  datasplit
          text
    -->  p1        text
    <--  p2        text
    FORM datasplit  .
      LOOP AT it_data.
        MOVE-CORRESPONDING it_data TO it_gdata.
        APPEND it_gdata.
      ENDLOOP.
      DO count TIMES.
        PERFORM split.
        perform idoccreate.
        enddo.
    ENDFORM.                   " datasplit
    *&      Form  SPLIT
          text
    -->  p1        text
    <--  p2        text
    FORM split .
      LOOP AT it_hdata.
        IF temp <= 5.
          ON CHANGE OF it_hdata-segnam.
            IF it_hdata-segnam = 'E1EDP01'.
              MOVE-CORRESPONDING it_hdata TO it_gdata.
              APPEND it_gdata.
            ELSE.
              MOVE-CORRESPONDING it_hdata TO it_gdata.
              APPEND it_gdata.
              temp = temp + 1.
            ENDIF.
          ENDON.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " SPLIT
    *&      Form  dataremain
          text
    -->  p1        text
    <--  p2        text
    FORM dataremain .
      CLEAR it_gdata[].
      LOOP AT it_data.
        MOVE-CORRESPONDING it_data TO it_gdata.
        APPEND it_gdata.
      ENDLOOP.
      LOOP AT it_hdata .
        IF sy-tabix  > 10.
          MOVE-CORRESPONDING it_hdata TO it_gdata.
          APPEND it_gdata.
        ENDIF.
      ENDLOOP.
      perform idoccreate.
    ENDFORM.                    " dataremain
    *&      Form  idoccreate
          text
    -->  p1        text
    <--  p2        text
    form idoccreate .
    ***********************for creating the inbound idocs****************
    CALL FUNCTION 'IDOC_INBOUND_WRITE_TO_DB'
       EXPORTING
         pi_status_message             = it_stat
         pi_do_handle_error            = 'X'
       PI_NO_DEQUEUE                 = ' '
         pi_return_data_flag           = 'X'
      PI_RFC_MULTI_CP               = '    '
       IMPORTING
         pe_idoc_number                = idocnum
         pe_state_of_processing        = sy-subrc
         pe_inbound_process_data       = it_tede2     "for process code
        TABLES
          t_data_records                = it_gdata
      T_LINKED_OBJECTS              =
        CHANGING
          pc_control_record             = it_contrl
    EXCEPTIONS
       IDOC_NOT_SAVED                = 1
       OTHERS                        = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      COMMIT WORK.
    *it_contrl-status = '64'.
    modify it_contrl index 1.
    ****************for posting the idoc**************************
      CALL FUNCTION 'IDOC_INPUT_ORDERS'
        EXPORTING
          input_method                = 'A'
          mass_processing             = '1'
       IMPORTING
         workflow_result             = result
      APPLICATION_VARIABLE        =
      IN_UPDATE_TASK              =
      CALL_TRANSACTION_DONE       =
       DOCUMENT_NUMBER             = vbeln
        TABLES
          idoc_contrl                 = it_contrl[]
          idoc_data                   = it_gdata[]
          idoc_status                 = it_status[]
          return_variables            = it_bdwfretvar[]
          serialization_info          = it_bdi_ser[]
      EDI_TEXT                    =
      EDI_TEXT_LINES              =
       CLEAR : it_contrl-docnum.
      COMMIT WORK.
    endform.                    " idoccreate

  • Create Individual Idocs Based on Parent and Child Segment type

    Hi Experts,
    I have a scenario IDOC to FILE ,  Split Single IDOC into Multiple IDOC's based on parent and child Segment Type
    For example If 3 child segments are same and 1 segment is different under parent segment then 3 same child segments are clubbed and create single idoc under parent segments and 1 different child should create in individual idoc under parent segment.
    Note : Same logic should work for N number of Parent Segments and Child Segments.
    Outbound:
    ZIdocName
    Control Record
    Data Record
    Parent Segment A
       Child Segment 1
       Child Segment 1
       Child Segment 1
       Child Segment 2
    Parent segment  B
       Child Segment 3
    Status Record
    I should get output like below
    Inbound:
    ZIdocName
    Control Record
    Data Record
    Parent segment A
      Child Segment 1
      Child Segment 1
      Child Segment 1
    Status Record
    ZIdocName
    Control Record
    Data Record
    Parent segment A
      Child Segment 2
    Status Record
    ZIdocName
    Control Record
    Data Record
    Parent Segment B
      Child Segment 3
    Status Record
    Please suggest me step by step process to achieve this task.
    Thanks.
    Ram

    Hello,
    Segment won't hold any value, so filter criteria should be there on some field wich exist in Parent node and chile node?
    Paste ur XML?
    Try this(Assuming u have some fields in parent/child segment on which u want to define filter criteria):
    Parent Field--UseOneAsMany----RC----
                                      ------------------Concat ----splitbyvalue(value change)--collapse context --- ZIdoc
    Child field-- RC----------
    Child field--RC--splitbyvalue(valuechange)--CC -Splitbyvalue(each value) -- ParentSegment
    Child field--RC--splitbyvalue(valuechange)--- ChildSegment
    RC -> Remove Context
    CC - Collapse Context
    Note - i haven't tested ur mapping, so make sure to adjust context in mapping
    Thanks
    Amit Srivastava
    Message was edited by: Amit Srivastava

  • Multi-Mapping without BPM (Multiples IDoc To one EDI output?)

    Hi all,
    We are currently working for a client that want us to create, based on a multiple IDoc (an idoc that contains data of more than one idoc) only one output
    Meaning that we have to do a mapping that based in this multiple input generates only one output that cointains all that data in only one flat file
    example:
    Idoc: PERX2002.PAYTEXT generates an EDI 820 with this structure:
    LIST
    /S_ISA (first input)
    /S_ISA (second input)
    At this moment we tried to use "Collect IDoc" option in SAP, and as seen in other blogs we changed the ocurrency of the message mapping to "0.unbounded", but when we release several idocs (WE14) we only get multiples output files (3 idoc collected and released give us 3 different edi files) instead only one edi file with all the data gathered together as ISA segments
    In this required process possible???
    Thanks in advance

    As you can see in the following pics..
    http://img201.imageshack.us/img201/8352/process1xz1.jpg
    http://img244.imageshack.us/img244/4954/processvc9.jpg
    i already made those changes, the multi-mapping is set, and also the option for collecting the IDocs and the "enhanced" option in the Integration Directory, but when i release all the idocs i still get multiple outputs (2 files), instead one file with all the gathered data
    Could someone tell me if  i'm missing some step?
    Thanks for your time
    Edited by: Alexis Alanis on Jan 7, 2008 7:24 PM

Maybe you are looking for

  • My iphone 3g no longer will sinc to itunes

    i have deleted itunes and quicktime and re installed it, turning off computer , but still advice to get it to sinc does not work bought new cable from apple and the hubs all work as moved printer to each hub and they all bleep when plugged in i want

  • Using with and row_number in a query

    I'm trying to do a sub-select on a top N type query, for multiple slices. It works for 1 or 2 slices at a time, but then returns nulls. with subselect as select issue, count(*) as cnt, row_number() over (order by count(*) desc) as rn from TBL group b

  • USER_DEPENDENCIES view in oracle 11g and oracle 10g are different?

    I have tested oracle 10g and oracle 11g. And I found some different behavior in the user_dependencies view between two oracle version. In the oracle 10g, whatever referenced object is populated in the user_dependencies view. In the oracle 11g, howeve

  • Running perl scripts off the preinstall script during a pkgadd

    Hello, I'm trying to build a custom package (apache2 + mysql + php + other stuff) and get stuck on some stone wall that I can't figure. Correct me if I'm wrong in my assumptions, and if able, could you provide a work around ? Here it is : - The prein

  • Can I buy Keynote/pages/numbers together?

    I may be mistaken but when the IPad first came out I thought I saw in the Keynote speech that you could buy all 3 for like $20 or buy them each individually for $10. Is this true or did I just remember wrong? I haven't found the link to buy them all