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

Similar Messages

  • Me and my family have 2 game cetre accounts on one email, but when we try to log into one, we log into the other. Also, we cant start a new apple id

    Me and my family have 2 game cetre accounts on one email, but when we try to log into one, we log into the other. Also, we cant start a new apple id

    Drrhythm2 wrote:
    What's the best solution for this? I
    Copy the entire /Music/iTunes/ folder from her old compouter to /Music/ in her account on this new computer.

  • 1:N mapping - One EDI document (ST-SE) to be split into multiple idocs

    Hello Experts,
    I am working on a scenario where the source is an EDI 204 document. Now in this document, the L11 segment has a count of the total number of items in the source EDI document.
    ISA
    ST
    L111110BC   <------- 2 is the number of OIDs that can appear
    OID*1
    LADCAS3****BL84985197CGZZAM000521*122
    LAD******CCCC12345678COCO12345678PMPM123456
    OID*2
    OID*910
    OID*911
    OID*1110
    SE148744
    IEA
    Now both the OIDs are in a single ST-SE EDI document. The requirement is that if the number of OID segments exceed 910 in a single document, then the output needs to be split with one idoc containing 910 items (OID, LAD, LAD...). The next set of 910 OIDs (from OID*911 onwards)need to be output into a new idoc.
    The header part for both the idocs would be the same. Only the detail part would differ for the next set of OID, LAD segments.
    I do not intend to use BPM. I want to achieve this using using graphical mapping.
    Awaiting your replies.
    Thank you
    Vincent

    Hi Vincent,
    1:n Multi mapping can be used for that. Please refer to the following link for how to implement a message split using multi mapping.
    http://help.sap.com/saphelp_nw04/helpdata/en/26/9e97b0f525d743882936c2d6f375c7/frameset.htm
    Honestly speaking, I have never tried using that myself. But after seeing your post I am now keen to develope a similar interface. Will let you know if I am successful.
    Regards,
    Suddha

  • About combing two array into one

    Hi all,
      I post a questiona bout converting an array of integer into char (byte) array and I got a solution already http://forums.ni.com/t5/LabVIEW/how-to-display-char-code-properly/m-p/2596087#M780368
    However, I enouther another problem while dealing with an array of  U16 type. I would like to extract the high and low byte from numbers (U16) stored in array. I extract the high and low byte for each U16 number and convert them as char, concatenate them to a string. Repeat this process for each element in the array so to get a big string with each element is a char for high and low byte. My code is enclosed as follows
    It works fine but I am concerning the speed. Is that any other way to do it fast and don't use loop (in real case, I will deal with pretty big array many times, efficiency is a problem). Note that the high and low bytes array extracted from the original array with the module Split number.vi, but how can I combine these two array in one code with data arranged as high-low-high-low ... ? Thanks.
    Solved!
    Go to Solution.

    PKIM wrote:
    However, I enouther another problem while dealing with an array of  U16 type. I would like to extract the high and low byte from numbers (U16) stored in array. I extract the high and low byte for each U16 number and convert them as char, concatenate them to a string. Repeat this process for each element in the array so to get a big string with each element is a char for high and low byte. My code is enclosed as follows
    It works fine but I am concerning the speed. Is that any other way to do it fast and don't use loop (in real case, I will deal with pretty big array many times, efficiency is a problem). Note that the high and low bytes array extracted from the original array with the module Split number.vi, but how can I combine these two array in one code with data arranged as high-low-high-low ... ? Thanks.
    You need to be more clear.
    Looking at the code, you are dealing with I16, not U16. Also your index array primitives could be replaced by autoindexing. Your use of the feedback node only makes sense if you want to append strings forever with stale data, thus growing data structures without limits. If you only want to convert the current data, remove the feedback mode and use a "concatenate strings" with a single input. A for loop is one of the most efficient data structures and using it is not a problem. One way or another the code needs top oerate on all data.
    All that said, I agree with Tim that most likely all you need to do is insert a typecast after the "to I16" and eliminate all other code.
    LabVIEW Champion . Do more with less code and in less time .

  • Combing Multiple Albums into One but keeping meta-data?

    Hello, I am in need of some help!
    Okay, so I have a bunch of Rihanna tracks from different albums, but not the full albums. I also scrobble my music to last.fm. I was wondering if I could somehow combine all of the tracks to appear as one album but maintain there original album data so when it scrobbles it shows up on last.fm as having the correct album title. For example, right now I have them all as one album but when it scrobbles it shows all tracks as being on the same album name and not it's actual album title. Thanks!

    Hi,
    I don't think that this can be done. Once you have changed the album title, all tracks will appear as one album as you have already done.
    Jim

  • How combine book cds into one fi

    I use my zen primarily for audio books. When I rip them from cds, and upload them to my zen, it shows each cd as a separate album. Long books will show up as 5-20 separate albums. This is a pain when I have 0 books on my player -- I have to scroll through so many "albums" to find the one I want to play.
    When I download books from the net, they combine and show up on the zen as one album, so they are much easier to deal with.
    I have tried changing the ripping software settings -- trying various combinations of file names and playlist names, but nothing seems to work.
    Does anyone have a method of ripping multiple cds and having them show up on a zen's"albums" file as one album?
    thanks.

    I tried the playlist idea, but on my zen "albums" it still showed one album per disc, rather than combining them into one "album" , and within "playlist" it only brings up one cd's tracks.
    The second idea, changing the album name using properties:? if I change to one single album name, then the tracks are all mixed up - track from disc - track from disc 2 - track from disc 3, etc.
    I thought if I used the same album name, but tried to play around with the track name, maybe I could get the sequence right. That is, if I could get the track name to include the disc # first, then the track number, they would line up correctly:? 0 0, 0 02, 0 03. (with?the first?number?being the disc #, and the second # being the track #.).
    If I could do that, then all the tracks would have the same album name so there would only be one listing in "albums".
    All the tracks from all the discs would show up in that single album listing, but the software used on the?zen would arrange the tracks first by disc # then by track # -- in the correct order to play them all.
    The track names are created when you rip the cds -- and I think I have tried all the various combinations, but cannot get the software to create the right "track name" to make this work.
    Does anyone have any idea how to do that within the ripping software?

  • Do not condense requests into one request when activation takes place

    hi all
    In process chain ods activation step, we have one option like
    "<b>do not condense requests into one request when activation takes place</b>"
    can anyone let m eknow what exactly it is
    regards
    balji

    during ODS activation,if there are more than one requests which are unactivated,then..
    if this checkbox is ticked..after activation..each request will appear individually(with its unique request ID) in the requests tab of ODS..
    if this checkbox is not ticked,then during activation..multiple requests will be activated at one go..and will appear as a single request ID in the requests tab of the ODS..
    example..unactivated request ID's 2,3 and 4.
    checkbox ticked..after activation..in requests tab..2,3,4.
    if checkbox not ticked..in requests tab..no 2 or 3.shows only one request ID(4)..no. of records of 2,3 and 4 get added up in 4.
    Vishvesh

  • Multiple Idocs (DEBMAS06) into one single file

    Hi All,
    Multiple Idocs(DEBMAS06) are sent from SAP in bulk to be sent to FTP server via XI...(Cannot use Append the file as The structure is with Header,Detail(all the idoc details) and Trailer)
    I have seen different threads which speaks about the same,
    But Please suggest me the best approach to proceed with this kind of scenario...
    Multiple IDocs -> XI -> Flat file which is speaking about BPM and also Packaging(SAP note 814393)
    and https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30ea2fdf-f047-2a10-d3a2-955a634bde6b
    (How Tou2026 Send Multiple IDocs Within One XI Message)
    I prefer not to use BPM... but if required then....
    Please suggest me which is the best approach to proceed with it..
    Thanks and Regards,
    Sridhar Reddy

    Hi ,
    I had tried the scenario Multiple IDOC's coming from R/3 and send all of them into a Single File
    But it did not work...
    Of course i changed as Micahel mentioned in
    The specified item was not found.
    (Collect and make pack size to 50) but still the idocs are posting as 50 messages in XI and 50 files are being created ...
    But as per his remarks we need customization which is very difficult...
    And also i checked Michaels blog
    The specified item was not found.
    But this is dicussing reverse of my scenario...
    and finally i am thinking of going with the stefens weblog...
    Collecting IDocs without using BPM
    Can any one please suggest any other best way to handle this...
    Instead of going for BPM i am implementing as Stefen suggested ... This is because we have many such interfaces where SAP sends collective idocs....
    Regards,
    Sridhar Reddy
    Edited by: sridhar reddy kondam on Oct 22, 2008 6:20 AM

  • BPM: Multiple IDOC collect into one file

    Hi
    I have done collecting multiple IDOCs of same type into one file using BPM
    I have used the following blog which is collecting different types of IDOCs.
    IDOCs (Multiple Types) Collection in BPM
    But i have done collecting of IDOCs which are same type.
    Source side it is showing successful and its reaching to BPM also . But in target i am not getting any file. Could any one please help me how to check where exactly I am failing.
    Thanks & Regards
    Sowmya

    Check whether the Outbound Status is successful or not in sxm_moni. Is there any message created from Integration Process to receiver File system.
    Check this
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/80a22ce8-8e72-2b10-3fba-e9511c6f0b8b
    Regards,
    Prateek

  • Inbound idoc error in 51 Status of at least one serial number of item

    Dear Experts,
    There is one inbound IDOC which is in error with status 51 showing error Status of at least one serial number of item  is not allowed.
    Can you please advice why this error is coming.
    Thanks & Regards,
    Nikhil Kanegaonkar.

    An inbound IDOC in error will have the status 51, & it is marked for deletion it has a status of 68.
    http://www.dataxstream.com/2009/10/mass-status-change-sap-idoc/
    http://wiki.sdn.sap.com/wiki/display/ABAP/IDoc+Statuses
    Edited by: Krupaji on May 6, 2011 2:38 PM

  • Combine into one IDOC

    Dear FI Idoc Gurus,
    Iu2019m using basic type PEXR2002 , this idoc is generated when I  do a payment run via F110. The idoc generation as far as I know is standard , with some enhancement done via user exit - EXIT_SAPLIEDP_902.
    Currently for each payment document generated one IDOC is created . The Business document / payment document is per vendor. Hence each vendor I get one IDOC .
    Client is asking if  I can combine payments of various vendors into one IDOC ? is this possible?  Is it possible through heavy customization?
    Please assist thank you.
    Best Wishes

    Hi,
      I guess its very difficult to combine the different vendor IDOC into single IDOC and require the customized development.
    Instead you can collect the different vendor IDOC based on the specific parameter. so that all the IDOC will get collected and send as a single message or single file. for this you can use the IDOC collect functionality.

  • Each row into one idoc

    hello  all,
    here  i have a basic  problem  ,
    i am given a text file ie. note pad which  has  around  100 rows  ,
    each  row  represents  each  employee details,
    now  i have  to  convert  each  row  into 1  idoc,
    for this  i had created one  datatype whose  structure  coincides   with  the  employee fields  and after  creating  the message interface  i mapped  it  with  the  all ready  imported  idoc,can  any one tell me  how  to  further  with  little  details,  any  help will be  appreciated  ,its  very  urgent,  thank you.

    Hi Kutumba,
    In ID u need to create atlest one business service with a Sender File Communication Channel to receive the file and one Business System for the R/3 System with a Receiver IDoc Communication Channel to receive the Idoc XML.
    U also need to create the Receiver and the Sender Agreements.
    U can also go through this link:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6bd6f69a-0701-0010-a88b-adbb6ee89b34
    Try doing this and let me know if u face any further problems.
    Regards
    Neetu

  • Split one IDoc into two IDocs ?

    hello all,
    I wanna split one IDoc into two IDocs in XI?
    how can implement it?
    plx give some suggestions.
    thx in advance
    best regards
    Yaning
    Message was edited by:
            Yaning Liu

    Yaning,
    Please find the below blog for changing the ocurrences of IDOC
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    Best regards,
    raj.

  • Splitting multiple IDoc XML files into single IDoc messages for R/3

    Hi all. I have a problem splitting IDoc XML files coming in to XI. I currently have an interface that takes in single store sale IDoc transactions (type WPUBON01) in an IDoc XML file. I then have some complex graphical mapping on the IDoc before sending to R/3 via the IDoc adapter. This works fine. However, we now wish to include multiple sales in one file i.e. many WPUBON01 IDocs. I could use message splitting to do this BUT the mapping is so complex, I do not wish to have to change it to enable the processing of many IDocs in one file instead of just one.
    What I want to do: have one mapping splitting a multiple IDoc XML file into single IDoc messages and then another taking these single messages as before and performing the mapping. I cannot find a way to do this in one interface; the main problem I'm having is getting XI to split the multiple IDocs into many single IDoc messages within XI itself. I'd be very grateful for any advice on the best way to do this.
    Thankyou.
    Stuart Richards (Halfords, UK)

    Bhavesh,
    Thanks again for a clear explanation... I'm moving forwards but still struggling. I've been on this all afternoon today (after a break on other things) and just cannot get my message to split properly (though the SOAP adapter problem I had earlier is now fixed!). If my initial IDoc XML file contains this format:
    <WPUBON01><IDOC>....</IDOC>
                          <IDOC>....</IDOC>
                          <IDOC>....</IDOC></WPUBON01>
    .. I'm not sure what the cardinaility on the first message mapping and interface mapping should be. I'd have thought the source interface would be 1 and the target would be 0..unbounded but this isn't working. I'm trying different things but I get different errors each time. Currently, I have the above cardinality in my first interface and I'm passing in the following data:
    <WPUBON01><IDOC><EDI_DC40><TABNAM>EDI_DC40</TABNAM><MANDT /><DOCNUM /><DOCREL>620</DOCREL><DIRECT>2</DIRECT><IDOCTYP>WPUBON01</IDOCTYP><MESTYP>WPUBON</MESTYP><MESCOD>ST6</MESCOD><SNDPOR>WPUX</SNDPOR><SNDPRT>KU</SNDPRT><SNDPRN>0518</SNDPRN><RCVPOR /><RCVPRT>KU</RCVPRT><RCVPRN>0518</RCVPRN><REFINT>00000003832292</REFINT></EDI_DC40><E1WPB01 SEGMENT="1"><POSKREIS>0518</POSKREIS><KASSID>29</KASSID><VORGDATUM>20071029</VORGDATUM><VORGZEIT>160633</VORGZEIT><BONNUMMER>1001</BONNUMMER><KASSIERER>100</KASSIERER><CSHNAME> </CSHNAME><BELEGWAERS>GBP</BELEGWAERS><E1WPB02 SEGMENT="2"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="3"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="4"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="5"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="6"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="7"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="8"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="9"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="10"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="11"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="12"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="13"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="14"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="15"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="16"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB06 SEGMENT="17"><VORZEICHEN></VORZEICHEN><ZAHLART>PTCS</ZAHLART><SUMME> </SUMME><KARTENNR /><ZUONR>1001</ZUONR></E1WPB06></E1WPB01></IDOC><IDOC><EDI_DC40><TABNAM>EDI_DC40</TABNAM><MANDT /><DOCNUM /><DOCREL>620</DOCREL><DIRECT>2</DIRECT><IDOCTYP>WPUBON01</IDOCTYP><MESTYP>WPUBON</MESTYP><MESCOD>ST6</MESCOD><SNDPOR>WPUX</SNDPOR><SNDPRT>KU</SNDPRT><SNDPRN>0518</SNDPRN><RCVPOR /><RCVPRT>KU</RCVPRT><RCVPRN>0518</RCVPRN><REFINT>00000003832293</REFINT></EDI_DC40><E1WPB01 SEGMENT="1"><POSKREIS>0518</POSKREIS><KASSID>29</KASSID><VORGDATUM>20071029</VORGDATUM><VORGZEIT>160634</VORGZEIT><BONNUMMER>1002</BONNUMMER><KASSIERER>100</KASSIERER><CSHNAME> </CSHNAME><BELEGWAERS>GBP</BELEGWAERS><E1WPB02 SEGMENT="2"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="3"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="4"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="5"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="6"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="7"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="8"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="9"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="10"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="11"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="12"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="13"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="14"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="15"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="16"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB06 SEGMENT="17"><VORZEICHEN></VORZEICHEN><ZAHLART>PTCS</ZAHLART><SUMME> </SUMME><KARTENNR /><ZUONR>1002</ZUONR></E1WPB06></E1WPB01></IDOC><IDOC><EDI_DC40><TABNAM>EDI_DC40</TABNAM><MANDT /><DOCNUM /><DOCREL>620</DOCREL><DIRECT>2</DIRECT><IDOCTYP>WPUBON01</IDOCTYP><MESTYP>WPUBON</MESTYP><MESCOD>ST6</MESCOD><SNDPOR>WPUX</SNDPOR><SNDPRT>KU</SNDPRT><SNDPRN>0518</SNDPRN><RCVPOR /><RCVPRT>KU</RCVPRT><RCVPRN>0518</RCVPRN><REFINT>00000003832294</REFINT></EDI_DC40><E1WPB01 SEGMENT="1"><POSKREIS>0518</POSKREIS><KASSID>29</KASSID><VORGDATUM>20071029</VORGDATUM><VORGZEIT>160634</VORGZEIT><BONNUMMER>1003</BONNUMMER><KASSIERER>100</KASSIERER><CSHNAME> </CSHNAME><BELEGWAERS>GBP</BELEGWAERS><E1WPB02 SEGMENT="2"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="3"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="4"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="5"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="6"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="7"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="8"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="9"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="10"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="11"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="12"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="13"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="14"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="15"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="16"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB06 SEGMENT="17"><VORZEICHEN></VORZEICHEN><ZAHLART>PTCS</ZAHLART><SUMME> </SUMME><KARTENNR /><ZUONR>1003</ZUONR></E1WPB06></E1WPB01></IDOC></WPUBON01>
    In the message monitor, I get a chequered flag. Great. However, I get the dreaded error 500 in the SOAP receiver comm channel:
    SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Internal Server Error
    Exception caught by adapter framework: SOAP Error
    Delivery of the message to the application using connection AFW failed, due to: SOAP Error.
    Any ideas as to what this might be?! I'm getting there.... if I get a solution out of this, I promise to write the blog myself!
    Cheers
    Stuart

  • How to split a PO into 2 iDocs ??

    Hello,
    We use EDI to send PO's outbound to suppliers via ORDERS05 iDoc.  Problem is that most of our suppliers cannot accept EDI PO if it contains more than one "Delivery Address".
    I need 2 or more Orders05 iDocs to be created (1 for each Delivery Address) when a PO is created with more than one Delivery address.
    For example ... A User creates an EDI enabled PO that contains 3 Delivery addresses with PO# 111111.  I need 3 iDocs (111111a, 111111b, and 111111c) to be created so that the EDI supplier system receives 3 separate PO's.
    Has anyone heard of a way to accomplish this?  Any help is appreciated.  Thank you.
    Dan Avis

    ELSEIF  WA_DATA-SEGNAM = 'E1EDK17'.
            WA_E1EDK17-QUALF = WA_DATA-SDATA+0(3).
            WA_E1EDK17-LKOND = WA_DATA-SDATA+3(3).
            APPEND WA_E1EDK17 TO IT_E1EDK17.
            IF SY-SUBRC = 0.
              WA_DATA1-MANDT  = WA_DATA-MANDT.
              WA_DATA1-DOCNUM = WA_DATA-DOCNUM.
              WA_DATA1-SEGNUM = WA_DATA-SEGNUM.
              WA_DATA1-SEGNAM = WA_DATA-SEGNAM.
              WA_DATA1-PSGNUM = WA_DATA-PSGNUM.
              WA_DATA1-HLEVEL = WA_DATA-HLEVEL.
              WA_DATA1-DTINT2 = WA_DATA-DTINT2.
              WA_DATA1-SDATA  = WA_E1EDK17.
              APPEND WA_DATA1 TO IT_DATA1.
              CLEAR WA_DATA1.
            ENDIF.
          ELSEIF  WA_DATA-SEGNAM = 'E1EDK18' AND WA_DATA-SEGNUM = '000012'.
            WA_E1EDK181-QUALF = WA_DATA-SDATA+0(3).
            WA_E1EDK181-TAGE  = WA_DATA-SDATA+3(8).
            WA_E1EDK181-PRZNT = WA_DATA-SDATA+11(8).
            APPEND WA_E1EDK181 TO IT_E1EDK181.
            IF SY-SUBRC = 0.
              WA_DATA1-MANDT  = WA_DATA-MANDT.
              WA_DATA1-DOCNUM = WA_DATA-DOCNUM.
              WA_DATA1-SEGNUM = WA_DATA-SEGNUM.
              WA_DATA1-SEGNAM = WA_DATA-SEGNAM.
              WA_DATA1-PSGNUM = WA_DATA-PSGNUM.
              WA_DATA1-HLEVEL = WA_DATA-HLEVEL.
              WA_DATA1-DTINT2 = WA_DATA-DTINT2.
              WA_DATA1-SDATA  = WA_E1EDK181.
              APPEND WA_DATA1 TO IT_DATA1.
              CLEAR WA_DATA1.
            ENDIF.
          ELSEIF  WA_DATA-SEGNAM = 'E1EDK18' AND WA_DATA-SEGNUM = '000013'.
            WA_E1EDK182-QUALF = WA_DATA-SDATA+0(3).
            WA_E1EDK182-TAGE  = WA_DATA-SDATA+3(8).
            WA_E1EDK182-PRZNT = WA_DATA-SDATA+11(8).
            APPEND WA_E1EDK182 TO IT_E1EDK182.
            IF SY-SUBRC = 0.
              WA_DATA1-MANDT  = WA_DATA-MANDT.
              WA_DATA1-DOCNUM = WA_DATA-DOCNUM.
              WA_DATA1-SEGNUM = WA_DATA-SEGNUM.
              WA_DATA1-SEGNAM = WA_DATA-SEGNAM.
              WA_DATA1-PSGNUM = WA_DATA-PSGNUM.
              WA_DATA1-HLEVEL = WA_DATA-HLEVEL.
              WA_DATA1-DTINT2 = WA_DATA-DTINT2.
              WA_DATA1-SDATA  = WA_E1EDK182.
              APPEND WA_DATA1 TO IT_DATA1.
              CLEAR WA_DATA1.
            ENDIF.
          ELSEIF  WA_DATA-SEGNAM = 'E1EDK18' AND WA_DATA-SEGNUM = '000014'.
            WA_E1EDK183-QUALF = WA_DATA-SDATA+0(3).
            WA_E1EDK183-TAGE  = WA_DATA-SDATA+3(8).
            APPEND WA_E1EDK183 TO IT_E1EDK183.
            IF SY-SUBRC = 0.
              WA_DATA1-MANDT  = WA_DATA-MANDT.
              WA_DATA1-DOCNUM = WA_DATA-DOCNUM.
              WA_DATA1-SEGNUM = WA_DATA-SEGNUM.
              WA_DATA1-SEGNAM = WA_DATA-SEGNAM.
              WA_DATA1-PSGNUM = WA_DATA-PSGNUM.
              WA_DATA1-HLEVEL = WA_DATA-HLEVEL.
              WA_DATA1-DTINT2 = WA_DATA-DTINT2.
              WA_DATA1-SDATA  = WA_E1EDK183.
              APPEND WA_DATA1 TO IT_DATA1.
              CLEAR WA_DATA1.
            ENDIF.
          ENDIF.
        ELSEIF SEG = 'E1EDP'.
          IF WA_DATA-SEGNAM = 'E1EDP01'.
            WA_E1EDP01-POSEX   = WA_DATA-SDATA+0(6).
            WA_E1EDP01-ACTION  = WA_DATA-SDATA+6(3).
            WA_E1EDP01-PSTYP   = WA_DATA-SDATA+9(1).
            WA_E1EDP01-KZABS   = WA_DATA-SDATA+10(1).
            WA_E1EDP01-MENGE   = WA_DATA-SDATA+11(15).
            WA_E1EDP01-MENEE   = WA_DATA-SDATA+26(3).
            WA_E1EDP01-BMNG2   = WA_DATA-SDATA+29(15).
            WA_E1EDP01-PMENE   = WA_DATA-SDATA+44(3).
            WA_E1EDP01-VPREI   = WA_DATA-SDATA+54(15).
            WA_E1EDP01-PEINH   = WA_DATA-SDATA+69(9).
            WA_E1EDP01-NETWR   = WA_DATA-SDATA+78(18).
            WA_E1EDP01-NTGEW   = WA_DATA-SDATA+132(18).
            WA_E1EDP01-GEWEI   = WA_DATA-SDATA+150(3).
            WA_E1EDP01-MATKL   = WA_DATA-SDATA+175(9).
            WA_E1EDP01-BPUMN   = WA_DATA-SDATA+200(6).
            WA_E1EDP01-BPUMZ   = WA_DATA-SDATA+206(6).
            WA_E1EDP01-BRGEW   = WA_DATA-SDATA+257(18).
            WA_E1EDP01-WERKS   = WA_DATA-SDATA+311(4).
            WA_E1EDP01-LGORT   = WA_DATA-SDATA+383(4).
            APPEND WA_E1EDP01 TO IT_E1EDP01.
            IF SY-SUBRC = 0.
              WA_DATA1-MANDT  = WA_DATA-MANDT.
              WA_DATA1-DOCNUM = WA_DATA-DOCNUM.
              WA_DATA1-SEGNUM = WA_DATA-SEGNUM.
              WA_DATA1-SEGNAM = WA_DATA-SEGNAM.
              WA_DATA1-PSGNUM = WA_DATA-PSGNUM.
              WA_DATA1-HLEVEL = WA_DATA-HLEVEL.
              WA_DATA1-DTINT2 = WA_DATA-DTINT2.
              WA_DATA1-SDATA  = WA_E1EDP01.
              APPEND WA_DATA1 TO IT_DATA2.
              CLEAR WA_DATA1.
            ENDIF.
          ELSEIF WA_DATA-SEGNAM = 'E1EDP20'.
            WA_E1EDP20-WMENG = WA_DATA-SDATA+0(15).
            WA_E1EDP20-AMENG = WA_DATA-SDATA+15(15).
            WA_E1EDP20-EDATU = WA_DATA-SDATA+30(8).
            APPEND WA_E1EDP20 TO IT_E1EDP20.
            IF SY-SUBRC = 0.
              WA_DATA1-MANDT  = WA_DATA-MANDT.
              WA_DATA1-DOCNUM = WA_DATA-DOCNUM.
              WA_DATA1-SEGNUM = WA_DATA-SEGNUM.
              WA_DATA1-SEGNAM = WA_DATA-SEGNAM.
              WA_DATA1-PSGNUM = WA_DATA-PSGNUM.
              WA_DATA1-HLEVEL = WA_DATA-HLEVEL.
              WA_DATA1-DTINT2 = WA_DATA-DTINT2.
              WA_DATA1-SDATA  = WA_E1EDP20.
              APPEND WA_DATA1 TO IT_DATA2.
              CLEAR WA_DATA1.
            ENDIF.
          ELSEIF WA_DATA-SEGNAM = 'E1EDPA1'.
            WA_E1EDPA1-PARVW = WA_DATA-SDATA+0(3).
            WA_E1EDPA1-LIFNR = WA_DATA-SDATA+20(17).
            WA_E1EDPA1-NAME1 = WA_DATA-SDATA+37(35).
            WA_E1EDPA1-STRAS = WA_DATA-SDATA+177(35).
            WA_E1EDPA1-ORT01 = WA_DATA-SDATA+282(35).
            WA_E1EDPA1-PSTLZ = WA_DATA-SDATA+326(9).
            WA_E1EDPA1-LAND1 = WA_DATA-SDATA+344(3).
            WA_E1EDPA1-TELF1 = WA_DATA-SDATA+442(25).
            WA_E1EDPA1-TELFX = WA_DATA-SDATA+517(25).
            WA_E1EDPA1-SPRAS = WA_DATA-SDATA+592(1).
            WA_E1EDPA1-REGIO = WA_DATA-SDATA+655(3).
            APPEND WA_E1EDPA1 TO IT_E1EDPA1.
            IF SY-SUBRC = 0.
              WA_DATA1-MANDT  = WA_DATA-MANDT.
              WA_DATA1-DOCNUM = WA_DATA-DOCNUM.
              WA_DATA1-SEGNUM = WA_DATA-SEGNUM.
              WA_DATA1-SEGNAM = WA_DATA-SEGNAM.
              WA_DATA1-PSGNUM = WA_DATA-PSGNUM.
              WA_DATA1-HLEVEL = WA_DATA-HLEVEL.
              WA_DATA1-DTINT2 = WA_DATA-DTINT2.
              WA_DATA1-SDATA  = WA_E1EDPA1.
              APPEND WA_DATA1 TO IT_DATA2.
              CLEAR WA_DATA1.
            ENDIF.
          ELSEIF WA_DATA-SEGNAM = 'E1EDP19'.
            WA_E1EDP19-QUALF = WA_DATA-SDATA+0(3).
            WA_E1EDP19-IDTNR = WA_DATA-SDATA+3(35).
            WA_E1EDP19-KTEXT = WA_DATA-SDATA+38(70).
            APPEND WA_E1EDP19 TO IT_E1EDP19.
            IF SY-SUBRC = 0.
              WA_DATA1-MANDT  = WA_DATA-MANDT.
              WA_DATA1-DOCNUM = WA_DATA-DOCNUM.
              WA_DATA1-SEGNUM = WA_DATA-SEGNUM.
              WA_DATA1-SEGNAM = WA_DATA-SEGNAM.
              WA_DATA1-PSGNUM = WA_DATA-PSGNUM.
              WA_DATA1-HLEVEL = WA_DATA-HLEVEL.
              WA_DATA1-DTINT2 = WA_DATA-DTINT2.
              WA_DATA1-SDATA  = WA_E1EDP19.
              APPEND WA_DATA1 TO IT_DATA2.
              CLEAR WA_DATA1.
            ENDIF.
          ENDIF.
        ELSEIF SEG = 'E1EDS'.
          IF WA_DATA-SEGNAM = 'E1EDS01'.
            WA_E1EDS01-SUMID = WA_DATA-SDATA+0(3).
            WA_E1EDS01-SUMME = WA_DATA-SDATA+3(18).
            WA_E1EDS01-SUNIT = WA_DATA-SDATA+21(3).
            APPEND WA_E1EDS01 TO IT_E1EDS01.
            IF SY-SUBRC = 0.
              WA_DATA1-MANDT  = WA_DATA-MANDT.
              WA_DATA1-DOCNUM = WA_DATA-DOCNUM.
              WA_DATA1-SEGNUM = WA_DATA-SEGNUM.
              WA_DATA1-SEGNAM = WA_DATA-SEGNAM.
              WA_DATA1-PSGNUM = WA_DATA-PSGNUM.
              WA_DATA1-HLEVEL = WA_DATA-HLEVEL.
              WA_DATA1-DTINT2 = WA_DATA-DTINT2.
              WA_DATA1-SDATA  = WA_E1EDS01.
              APPEND WA_DATA1 TO IT_DATA3.
              CLEAR WA_DATA1.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
      IF SY-SUBRC = 0.
        LOOP AT  IT_DATA2 INTO WA_DATA1.
          READ TABLE IT_DATA2 INTO WA_DATA1 INDEX COUNT.
          APPEND WA_DATA1 TO IT_DATA4.
          APPEND LINES OF IT_DATA4 TO IT_DATA1.
          COUNT = COUNT + 1.
          CLEAR:WA_DATA1,IT_DATA4[],IT_DATA4.
          IF COUNT = 5.
            APPEND LINES OF IT_DATA3 TO IT_DATA1.
           IT_DATA1-SEGNUM = SY-TABIX.
           MODIFY IT_DATA1 FROM IT_DATA1 INDEX SY-TABIX TRANSPORTING SEGNUM .
            PERFORM IDOCGENETRATE.
            DELETE IT_DATA1 FROM 15 TO 19.
            DELETE IT_DATA2 FROM 1 TO 4.
            SORT IT_DATA2.
            CLEAR:WA_DATA1.
            count = 1.
          ENDIF.
        ENDLOOP.
      ENDIF.
      LOOP AT T_COMM_IDOC.
        WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.
      ENDLOOP.
    *&      Form  IDOCGENETRATE
          text
    -->  p1        text
    <--  p2        text
    FORM IDOCGENETRATE .
    DATA: count1 type i VALUE 1.
      DATA : S_CTRL_REC LIKE EDIDC. "Idoc Control Record
    CONSTANTS : C_PO_SEGMENT LIKE EDIDD-SEGNAM VALUE 'PO_SEGMENT'.
      CONSTANTS:  C_IDOCTP LIKE EDIDC-IDOCTP VALUE 'ORDERS05'.
    loop at IT_DATA1 into WA_DATA1.
      it_DATA1-segnum = count1.
      MODIFY IT_DATA1 FROM IT_DATA1 INDEX SY-TABIX TRANSPORTING SEGNUM .
      count1 = count1 + 1.
    endloop.
    Selection Screen
      DATA :  C_MESTYP LIKE EDIDC-MESTYP VALUE 'ORDERS',    "Message Type
                    C_RCVPRT LIKE EDIDC-RCVPRT VALUE 'LS',         "Partner type of receiver
                    C_RCVPRN LIKE EDIDC-RCVPRN VALUE 'DTZ_801',
                    C_RCVPOR LIKE EDIDC-RCVPOR VALUE 'ZEDI',        "'A000000226',
                    C_SNDPRN LIKE EDIDC-SNDPRN VALUE 'DTZ_801',
                    C_SNDPRT LIKE EDIDC-SNDPRT VALUE 'LS'.
      S_CTRL_REC-RCVPOR = C_RCVPOR. "Receiver Port
      S_CTRL_REC-MESTYP = C_MESTYP. "Message type
      S_CTRL_REC-IDOCTP = C_IDOCTP. "Basic IDOC type
      S_CTRL_REC-RCVPRT = C_RCVPRT. "Partner type of receiver
      S_CTRL_REC-RCVPRN = C_RCVPRN. "Partner number of receiver
                                    "Sender Partner type
      S_CTRL_REC-SNDPRN = C_SNDPRN. "
      S_CTRL_REC-SNDPRT = C_SNDPRT ." Sender Partner Number
                    " generate_control_record
      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
        EXPORTING
          MASTER_IDOC_CONTROL            = S_CTRL_REC
        TABLES
          COMMUNICATION_IDOC_CONTROL     = T_COMM_IDOC
          MASTER_IDOC_DATA               = IT_DATA1
        EXCEPTIONS
          ERROR_IN_IDOC_CONTROL          = 1
          ERROR_WRITING_IDOC_STATUS      = 2
          ERROR_IN_IDOC_DATA             = 3
          SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
          OTHERS                         = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        COMMIT WORK.
         LOOP AT T_COMM_IDOC.
          WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " send_idoc

Maybe you are looking for

  • Batch combine multiple image sequences

    My problem in a way is pretty simple. After assembling the render output of my 3d app in photoshop (32bit) and changing the appearance via several CC layers in different layer modes (e.g. Hue/saturation in Overlay mode) I ended up with my composing f

  • Flash, iWeb, and More, HELP!!!!

    Can anyone help me? I want a website with a homepage that is moving all the time with a film going on in the background. It has music playing too! 2. On the site, i will want "selector buttons" at the bottom of the page. Once a button is selected, th

  • What is the role of Schema in File Adapter

    I am configuring File Adapter during the configuration step - 6 two options are there Schema is Opaque & Schema file url, what is the difference between these two and why it is needed? If It is required then what are the elements should be present at

  • Issues importing text in from Word.

    I have just learned how to place text from Word into InDesign, more importantly how to flow the text on multiple pages. However, the word document I have was created by someone else and from what I can tell each "column" on each page are individual t

  • New page after end of record

    Hi i'm using asp.net 2.0,VS 2005 and CR by default comes with VS 2005. I read the records from DB and bind into CR for 10 pages. It's displaying records at 10 pages but the 11th page has created and nothing is there. I dont want to create the extra p