Outbound 856 - Error generating an IDOC

Hi Everyone,
  We have a scenario where we need to generate an IDOC for Advance shipping notification for 856 outbound, the basic settings required to do the same are done using the message type DESADV and IDOC type DESADV01. However the IDOC is not getting generated and encountering an error while generating an idoc for 856 outbound from VL02N transaction, when checked the processing log the error with the message 'IDoc type DESADV01 cannot be processed by  IDOC_OUTPUT_DELVRY' is displayed. Following Partner profile details are maintained in WE20 for the basic idoc type DESADV01,
processing code DELV ,
message type 'LAVA'
application V2,
also checked the fm attached in WE41 for the process code and found that it is the same. Can anyone give me a clue as to why IDOC is not getting generated for this message type,
Your quick response would be highly appreciated,
Rgds,

Hai sailatha,
Just check these links you may get some idea.........
edi 856 inbound
Shipping Notification
Advance Ship Notice
Regards,
Srikanth.

Similar Messages

  • Stop generating delivery IDOC output (outbound IDOC)  if goods issued!

    How to stop generating delivery IDOC output (outbound IDOC)  if the delivery has been goods issued?! Any user exit or BADI for this?!
    Thanks

    We take a routine in output requirement! it's done!

  • Error generating IDOC (Transaction F110) - Segment E1IDIBA is blank

    Hi experts,
    I'm facing a problem here when trying to generate an IDOC through F110.
    I'm using PEXR2003 that needs to be sent to a German Bank.
    On this IDOC Type (which was never used before on this company) I need the new fields (updated from PEX2002) to be filled up.
    The segment that I need the informations to be filled up is E1IDIBA (IBAN and SWIFT-Code).
    Does anybody know how I can get this segment filled?
    I've been stuck on this point for 2 days!
    Thank you very much!

    EXIT_SAPLIEDP_902 is the user exit to add/modify segments in PEXR2003 IDoc, if the contents differs for each payment document number processed in the IDoc. This user exit is called at the end of processing for each payment document. We use it in our company for manipulating the PAYEXT IDoc before it is sent to the banks for clearing the payment to our vendors.
    To debug this user exit, you need to set and save the parameters and/or payment proposal in F110 but should not actually run it, if you want your breakpoints to be hit.
    Put your breakpoint and run the program RFFOEDI1 with the payment run date and identification saved in F110 through SE38.
    If the above exit is not what you are looking for there are two other user exits  EXIT_SAPLIEDP_901 and EXIT_SAPLIEDP_903, which are called at the beginning and end of processing for each bank (i.e., EDI partner)
    Regards,
    Vishnu Tallapragada

  • SP14 Multi-mapping - error in receiver idoc adapter

    Hi,
    I have a scenario where a business service should send some XML to SAP CRM. I get the file via a sender JMS adapter and try to post it to CRM via a receiver IDOC adapter.
    I have created a multimapping (1:N - 1 XML file to many Idocs) as should in the repository.
    In the configuration under Interface Determination, I have chosen 'RB_SPLIT' and selected the interface multimapping.
    It should be pointed out, that when testing both interface and message mapping i get no error. All idocs seem to be created as they should.
    When testing the setup 'real life' the message fails. The error message in the monitor says:
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="IDOC_ADAPTER">ATTRIBUTE_WRONG_INTF</SAP:Code>
      <SAP:P1>InterfaceCollection</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Unable to interpret IDoc interface InterfaceCollection</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Notice that the above error is when trying to send only 1 record, which in turn then should result in only 1 idoc.
    If trying to send multiple XML records, i get the following error:
    - <!--  Technical Routing
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="OUTBINDING">MMF_ENGINETYPE</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>A system error occurred in the outbound binding</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    In the monitor in the payload of 'Request message mapping' I see as many Maindocument, Submaindocument pairs as should be Idocs.
    Now i really don't know how to interpret the error messages in both cases, so I'm a little lost here...
    It should be pointed out that the idoc being used everywhere in this scenario, has not been modified - from all places it is being used (and only exists) in the 'Imported objects | Idocs' place.
    Also the Idoc is also being used as Inbound interface - so no mistakes here either.
    I really hope someone can help me here, as I'm otherwise pretty stuck in this case.
    Best regards,
    Daniel

    Hi Daniel,
    I have exactly the same type of scenario (under SPS14 and now also SPS15), sending an XML message over JMS to XI and trying a multi-mapping to many IDocs (actually a list of orders in XML is mapped to n ORDERS Idocs).
    I also face problems doing so, when I use the IDoc Adapter as outbound in the Receiver Agreement. I receive the following error:
    <i>CO_TXT_MMF_ENGINETYPE
    Messages in multi message format can be sent to one adapter engine only</i>
    However, I tested the same scenario by just changing the Receiver Agreement to a File Communication Channel and - surprise, surprise - it works. One file per IDoc is created.
    Of course, this is not what we want to accomplish, but when I checked this piece of documentation (sorry another link
    http://help.sap.com/saphelp_nw04/helpdata/en/42/ed364cf8593eebe10000000a1553f7/content.htm
    the IDoc adapter is not listed in the list of Adapters that are supported. Does that mean, that this feature is not supported for generating IDocs? Maybe that's a question for a SAP OSS Message?
    I hope that helped you a little further - if you find out more I'd be happy to learn about it.
    regards,
    Peter

  • Output type not created for outbound delivery while using SHMNT05 idoc type

    Hi Experts,
    Please help me to solve the below issue.
    Problem:- I want to to generate an IDOC(using type SHPMNT06) once the PGI is done for an outbound delivery.
    Already it is working fine when used DESADV.DESADV01 or DESADV.DELVRY07. But now the output type is not getting created when used SHMNT.SHPMNT06. I have created a separate output type ZPJ7 just as a mirror copy of the earlier output type(ZPJ6) used for DESADV.DELVRY07.
    Question:- Is it possible to use idoc SHPMNT06 instead for DESADV01 or DELVRY07? If yes then what are steps to be followed?
    The reason why SHPMNT06 idoc is planned:- We have a scenario to send outbound delivery to 3rd party system via XI. If the outbound delivery is for National(Not for Export) and PGI is completed then send the idoc straight forward to XI otherwise DO NOT generate the idoc, but just create the delivery. Collect all the deliveries in a transport and send it in a shipment. The shipment details can be sent using SHPMNT idoc. Now from XI perspective, if we can utlitze the same SHPMNT idoc for the National delivery(1st case) then perhaps this will require less effort. Hence shipment idoc is required to be generated when the delivery is created and PGI is done.
    Also it would be great if you can advice some better way to solve above mentioned scenario.
    Many Thanks,
    Sanjay

    There could be several reasons. Go to the document and in the extras-output check output determination analysis in the processing log.
    If the output has been created successfully then you need to see your printer determination. Ask basis to check it up. If the problem is that even the print preview is not coming. Check your communication in the output analysis and ensure LOCL is selected. Any other printer will need to be configured.
    If thats done already then check whether you have maintianed the condition record.
    If that too is done then check whether your output type has been assigned to the output procedure and that the output type is listed in the procedure.
    regds
    Jude

  • ATTRIBUTE_IDOC_RUNTIME error in File-IDOC Scenario

    Hi,
    I got this error in FIle-IDOC scenario.
    ATTRIBUTE_IDOC_RUNTIME</SAP:Code>
      <SAP:P1>Transaction IDX1: Port SAPMMX, client , RFC destination contain errors
    There are many threads on same issue. Almost in all threads, the suggestion given was, we need to check the Channel Definition(Port should be SAP<SYSID> and not SAP<SYSID>_<CLIENT>)
    I have given the proper values for RFC desitnation and port. Even then, I m getting this error.
    Is there any other suggestions?

    Hi aarthi,
    I suggest u chk all d settings dat u hav done..
    Steps for ALE settings:-
    Steps for XI
    Step 1)
         Goto SM59.
         Create new RFC destination of type 3(Abap connection).
         Give a suitable name and description.
         Give the Ip address of the R3 system.
         Give the system number.
         Give the gateway host name and gateway service (3300 + system number).
         Go to the logon security tab.
         Give the lang, client, username and password.
         Test connection and remote logon.
    Step 2)
         Goto IDX1.
         Create a new port.
         Give the port name.
         Give the client number for the R3 system.
         Select the created Rfc Destination.
    Step 3)
         Goto IDX2
         Create a new Meta data.
         Give the Idoc type.
         Select the created port.
    Steps for R3.
    Step 1)
         Goto SM59.
         Create new RFC destination of type 3(Abap connection).
         Give a suitable name and description.
         Give the Ip address of the XI system.
         Give the system number.
         Give the gateway host name and gateway service (3300 + system number).
         Go to the logon security tab.
         Give the lang, client, username and password.
         Test connection and remote logon.
    Step 2)
         Goto WE21.
         Create a port under transactional RFC.(R3->XI)
         Designate the RFC destination created in prev step.
    Step 3)
         Goto SALE.
         Basic settings->Logical Systems->Define logical system.
         Create two logical systems(one for XI and the other for R3)
         Basic settings->Logical Systems->Assign logical system.
         Assign the R3 logical system to respective client.
    Step 4)
         Goto WE20.
         Partner type LS.
         Create two partner profile(one for XI the other for R3).
         Give the outbound or inbound message type based on the direction.
    Step 5)
         Not mandatory.
         Goto BD64.
         Click on Create model view.
         Add message type.
    Step 6)
         Goto WE19
         Give the basic type and execute.
         fill in the required fields.
         Goto IDOC->edit control records.
         Give the following values.(Receiver port,partner no.,part type and sender Partner no. and type)
         Click outbound processing.
    Step 7)
         Go to SM58
         if there are any messages then there is some error in execution.
         Goto WE02.
         Check the status of the IDOC.
         Goto WE47.
         TO decode the status code.
    BD87 to check the status of IDOC.
    In case if not authorized then go to the target system and check in SU53, see for the missing object
    and assign it to the user.
    SAP r3
    sm59(status check)(no message)
    WE02(status check)
    WE05(status check)
    BD87(status check)
    Xi
    IDx5(Idoc check)
    SU53(authorization check)
    reward points if helpful...
    MenoN

  • IDOC error - Receiver of IDoc is its own logical system

    hi,
    i have a requiremnt to generate the IDOC for the same and same client. actually i have to get the data from application server and i have to generate the IDOC.
    for this i have created a Zreport and passed the data from application server to segment and i called the
    FM "MASTER_IDOC_DISTRIBUTE". after executing the Zreport, IDOC is generated and show the error
    status as 29.i.e. Receiver of IDoc is its own logical system.
    my logic is as follows.
    MOVE 'LS' TO w_edidc-rcvprt.
    MOVE 'SBECLNT130' TO w_edidc-rcvprn.
    MOVE 'ISU_MR_UPLOAD' TO w_edidc-mestyp.
    MOVE 'ISU_MR_UPLOAD01' TO w_edidc-idoctp.
    pls let me know the solution for this problem.
    Regards,
    Balu

    Hi  Reddy,
    please let me know how did u solve this issue, even i have the same requirement and am gettign status 29.
    Thanks
    Rakesh

  • Error Loading Hierarchy Error when updating Idocs in Source System

    Hello  Friends,
         I am loading  hierarchy data  using Info pac into  0FUNDS_CTR . I have selected  a hierarchy under hierarchy selections tab  in the Info pac .
    All Partner profiles in WE20 seems OK .   But When I loaded data , throwing errrr message  as below
    Error when updating Idocs in Source System
    Diagnosis
    Errors have been reported in Source System during IDoc update:
    System Response
    Some IDocs have error status.
    Procedure
    Check the IDocs in Source System . You do this using the extraction monitor.
    Error handling:
    How you resolve the errors depends on the error message you get.
    When I checked in TC WE05 says that  IDoc: 0000000000355113 Status: Error during syntax check of IDoc (outbound) with status 26 .
    Please advice .
    Many thanks

    Hi  Krishna4bi,
    Actually we will monitor idoc status in BD87 in SAP BI As well ECC , while extracting the data from source sytem  if any idoc struck we will manually process in BD87 , But you are telling that while loading the datasource the error occurred , so please check once in ECC side . Otherwise see how many packets are still process, make it red that infopackage and do manually update.
    Hope it helps,
    By,
    Praveen Yagnamurthy,
    SAP BI Consultant,
    Blue Marlin Systems-INDIA.
    http://bluemarlinsys.com/bi.

  • Error when updating Idocs in Source System - Urgent

    Hi Team,
    When i was loading the data from SAP R/3 to BW, i was facing the error "Error when updating Idocs in Source System" (0 From 0 Records).
    When i check in the Environment>Transaction RFC->In the Source System, it was displaying the error--
    <b>" Import container contains errors (are any obligato) in the Function Module: IDOC_ERROR_WORKFLOW_START_R".</b>
    Can any one please help me to solve this error.
    This is am Urgent requirement for me to deliver.
    Thanks & Best Regards,
    Venkata.

    Hello VenkaTa,
    How r u ?
    The workflow settings are not proper it seems. Ask the BASIS people to correct the Work Flow Settings. Then try Updating the IDOCs manually.
    Also check the Inbound and outbound IDOCs in the Source system. The outbound should contain some warnings or errors.
    Best Regards....
    Sankar Kumar
    +91 98403 47141

  • Stop generating the IDOC, soap-xi-idoc

    Dear SDN,
    I have a interface SOAP(HTTP) -> XI -> R/3.
    In this interface, 3rd party sending 4 fields and are getting updated in R/3.
    Now, I need to change in this interface.
    There are 4 fields in sender side and one field is like (PersonNumber)primary field. while updating this fields, I have to check whather the primary field is exist in R/3 then only update remaining fields else do not update the record/IDOC in R/3.
    And we are using XSLT mapping.
    The intension of the chage in interface is when the PersonNumber doesnot exist then do not generate the IDOC. whenever the PersonNumber is not there the system is generating the IDOC details with status 51.
    So I need to stop generating IDOC when  the PersonNumber is not there in R/3 system .
    In this scenario, how can I procede further.
    Please need your help and help me.
    Thanks
    Bala Prasad

    Hi,
    In XI you can stop an interface (without generating error) only in receiver determination.
    In your case you can use receiver determination condition which checks if PersonNumber is coming blank etc. If blank then choose a non existing receiver and choose the option "Terminate Message Processing without any error"
    In case if you have any complaex condition then you will have to go for enhanced receiver determination.
    Let me know in case you need any further help.
    Regards,
    Anurag Mahendru.

  • Generate DELVRY  Idoc when Post goods issue is done in SAP

    I need to generate an Idoc when post goods issue is done in SAP (outbound to SAP) .I understood that I can do this using the message control .The message type DESADV with the process code DELV will support this.
    But I didn’t understand how to trigger the Idoc.In the current scenario our Company is doing the post goods issue in SAP for the in three different ways.
    1.Manually doing the post goods issue through the transaction VL02N
    2. an Inbound Interface (using Idoc)  which will do Post goods Issue in SAP
    3.Another Interface using BAPI, which will, do post goods issue in SAP
    I have to run my outbound interface when the post goods issue is done by all the above three ways.  Can any one help me out in this?

    You have to configure the output first .
    You can use output type LAVA ( avaialble in Std SAP ) .
    ( Tcode is NACE , Select Application V2 -> Outputtypes ).
    ( Create condition records suitable to generate an output)
    Next is ALE.
    Setup a distribution Model ( for DESADV ) and all other setup for ALE i.e. Distribute Dist. Model / Generate Partner Profile .
    In the Partner profile in WE20 select your partner system. Double CLick on Outbound Message DESADV ( this wd be there after you generate partner profile , if not add it here in outbound ) . On this screen goto tab MESSAGE CONTROL .
    Application - V2
    Message Type - LAVA
    Process Code - DELV.
    Now you are ready to go. The moment a PGI is done in any form an output LAVA would be proposed and processed using process code DELV.
    Cheers.

  • Generating an IDOC for Message type PROJECT in Change pointer?

    Hi,
    I am trying to generate an IDOC. for the Message Type PROJECT(Actually this msg. type PROJECT is for BAPI method) in CHANGE POINTERS but it is possible Error is coming, is there any other method to use the message type in change pointer technic.
    Thanks,
    Vinayak,
    Message was edited by: vinayaga sundaram

    Hi Vinay,
    Had a similar requirement few days back..
    What we did was to do a multimapping of 1:N where N = N1 and N2, N1 is the Idocs which you are doing today, N2 is the set of invalid records...
    Now we have written this as a file and then created another interface which will pick the file and based on the name of file we decided the To address. We have used mail package and this interface (file to mail ) was made as a generic one so that it can be used across many interfaces...
    filename and To address relationship was maintained as a value mapping in ID... You can have a thought of this approach and try to send the invalid records as a mail rather than alert.
    Regards
    Suraj

  • Error in posting IDOC ORDERS.ORDERS05

    hi,
    dear all,
    i am getting error in posting IDOC ORDERS05.
    IDOC has arrived  on system but with status 51,
    <b>it says:
    VKORG, VTWEG, SPART cannot be determined for customer , vendor</b>
    can you please tell me how to map above specified fields.They are under which  segment.
    I am sending XML file with fields thru XI.
    Thanks.

    hey rajeev,
    thanks very much for your patience to deal with this basic questions expected from me  who is just new to XI
    really thanks.
    but RAJEEV, as you said we have to add the same IDOC to inbound to R3 if R3 is receiving that IDOC and in OUTBOUND if  R3 is sending right?
    hi, sorry to interrupt you more :
    take my scenario of IDOC ->XI->FILE.
    i added that IDOC type in receiving LS that is FILE LS in OUTBOUND side,
    and i do not add anything in OUTBOUND parameters of my sending LS that is R3 system.
    i am using we19 to send IDOC.
    Before Sending IDOC i am filling EDIDC segment with these parameters is it right?
    Sender Information:
    Partner number: SAPLS
    Port: Port defined on XI pointing to R3.
    Partner type :LS
    Receiver Information:
    Partner Number : FILELS
    Port: Port defined on R3 pointing to XI.
    SO, Provided that i entered following values in EDIDC segment and i do not add anything IDOC type in outbound parameters in R3(sending system),
    i add that IDOc in outbound parameters under LS defined for File system,it worked.
    You got my point?
    sorry for writing such a long thread? but please resolve it RAJEEV.
    Thanks.

  • EDI Output type generating multiple IDOCs

    Hi All,
    For one of the Business requirement we have created a Delivery EDI output type and output type is processed via Report RSNAST00 in a batch job.
    The delivery document shows only one output type prcossed still, mutiple idocs are being sent out for this Delivery.
    RSEOUT00 is being used to process outbound IDOC.
    Any pointers toward this abnormal behavior shall be helpful.
    BR,
    Anshul
    PS - We havent implemented change Pointers

    Okay, so you have one output record in the delivery document generating multiple IDocs. 
    Compare the control records of the generated IDocs.  Do they have the same Basic Type, Message Type and recipient Partner Number? 
    If yes,
    1.     Check for multiple background jobs running RSEOUT00 at the same time.  Seems unlikely, but this is easy to check and eliminate as a possible cause.
    2.     Step through the program RSEOUT00 as it generates the output type for one delivery document.  Perhaps something is happening in a user exit that inadvertently results in replication of the IDoc.
    Otherwise, the process code that gets executed by the output type in the delivery document is, for some reason, generating additional output.  I donu2019t know of any standard output process code that does this, but it could be deliberate (by design).  If you are sure that it should NOT happen, then step through the code and look for a mis-behaving user exit.
    Regards,
    zKen

  • Need Code to generate Inbound Idocs

    Hi friends
    i have a flat file consists of delivery confirmation data
    by using this i need to generate inbound idocs
    i filled all the segments in idoc type /afs/delvry03 and message type whscon
    can any one have the code to generate inbound idocs
    please remember that here i am not using XI
    thanks
    Anil

    Hi this is for Stand alone Programs, I hope it is useful to you.
    Program Flow 
    The program logic contains the following blocks: 
      1.  Provide a selection screen to allow a user to specify the various objects for which IDocs are to be generated. 
      2.  Determine the key of the application document from the object specified in step 1. 
      3.  Select application data from the database using the object key identified in step 2. 
      4.  Populate control record information. 
      5.  Populate an internal table of type EDIDD with data records for the various segments. 
      6.  Call the ALE service layer (MASTER_IDOC_DISTRIBUTE) to create the IDocs in the database. 
      7.  Commit work. 
    The program in Listing 32-2 generates the monthly report IDoc ZMREPT01, which illustrates a stand-alone outbound process. 
    Listing 32-2 
    REPORT ZARNEDI1 MESSAGE-ID ZE. 
    Parameters 
    object key (Social security number for the employee) 
      PARAMETERS: P_SSN LIKE ZEMPDETAIL-SSN. 
    message type 
      PARAMETERS: P_MESTYP LIKE EDMSG-MSGTYP OBLIGATORY. 
    destination system 
      PARAMETERS: P_LOGSYS LIKE TBDLST-LOGSYS. 
    Constants 
      DATA: 
        segment names 
            C_HEADER_SEGMENT           LIKE EDIDD-SEGNAM VALUE 'Z1EMHDR', 
            C_WEEKLY_DETAILS_SEGMENT   LIKE EDIDD-SEGNAM VALUE 'Z1WKDET', 
            C_CLIENT_DETAILS_SEGMENT   LIKE EDIDD-SEGNAM VALUE 'Z1CLDET', 
            C_SUMMARY_SEGMENT          LIKE EDIDD-SEGNAM VALUE 'Z1SUMRY', 
        idoc type 
            C_MONTHLY_REPORT_IDOC_TYPE LIKE EDIDC-IDOCTP VALUE 'ZMREPT01'. 
    Data declarations 
    idoc control record 
      data: control_record_out like edidc. 
    employee header data 
      DATA: FS_EMPHDR_DATA LIKE Z1EMHDR. 
    employee weekly details data 
      DATA: FS_WEEKDET_DATA LIKE Z1WKDET. 
    client details data 
      DATA: FS_CLIENTDET_DATA LIKE Z1CLDET. 
    employee monthly summary data 
      DATA: FS_SUMMARY_DATA LIKE Z1SUMRY. 
    total hours and amount for the summary segment 
      DATA: TOTAL_HRS_MONTH TYPE I, 
            TOTAL_AMT_MONTH TYPE I. 
    Database Tables 
    Application data tables 
      TABLES: ZEMPDETAIL, ZEMPWKDET. 
    Internal tables 
      DATA: 
        weekly details - appplication data 
            IT_WKDET LIKE ZEMPWKDET OCCURS 0 WITH HEADER LINE, 
        data records 
            INT_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE, 
        communication idocs geneerated 
            IT_COMM_IDOCS LIKE EDIDC OCCURS 0 WITH HEADER LINE. 
    Program logic 
      ********************Select Application Data*************************** 
      SELECT SINGLE * FROM ZEMPDETAIL WHERE SSN = P_SSN. 
      IF SY-SUBRC NE 0. 
         MESSAGE E001 WITH P_SSN. 
         EXIT. 
      ENDIF. 
      SELECT * FROM ZEMPWKDET INTO TABLE IT_WKDET WHERE SSN = P_SSN. 
      IF SY-SUBRC NE 0. 
         MESSAGE E002 WITH P_SSN. 
         EXIT. 
      ENDIF. 
      ********************Build Control Record****************************** 
    Fill control record information 
      CONTROL_RECORD_OUT-MESTYP = P_MESTYP. 
      control_record_out-idoctp = c_monthly_report_idoc_type. 
      control_record_out-rcvprt = 'LS'. 
      control_record_out-rcvprn = p_logsys. 
      ********************Build Data Records******************************** 
      *--Employee header--
    fill the employee header information 
      FS_EMPHDR_DATA-LNAME = ZEMPDETAIL-LNAME. 
      FS_EMPHDR_DATA-FNAME = ZEMPDETAIL-FNAME. 
      FS_EMPHDR_DATA-SSN   = ZEMPDETAIL-SSN. 
      FS_EMPHDR_DATA-DOB   = ZEMPDETAIL-DOB. 
    fill the administrative section of the data record 
      INT_EDIDD-SEGNAM = C_HEADER_SEGMENT. 
      INT_EDIDD-SDATA = FS_EMPHDR_DATA. 
    append the employee header data record to the IDoc data 
      APPEND INT_EDIDD. 
      *--Employee weekly details--
      LOOP AT IT_WKDET. 
    fill the weekly details for each week 
        FS_WEEKDET_DATA-WEEKNO = IT_WKDET-WEEKNO. 
        FS_WEEKDET_DATA-TOTHOURS = IT_WKDET-TOTHOURS. 
        FS_WEEKDET_DATA-HRLYRATE = IT_WKDET-HRLYRATE. 
    add administrative information to the data record 
        INT_EDIDD-SEGNAM = C_WEEKLY_DETAILS_SEGMENT. 
        INT_EDIDD-SDATA = FS_WEEKDET_DATA. 
    append the data for the week to the IDoc data 
        APPEND INT_EDIDD. 
    Client details of each week 
        FS_CLIENTDET_DATA-CLSITE = IT_WKDET-CLSITE. 
        FS_CLIENTDET_DATA-WORKDESC = IT_WKDET-WORKDESC. 
    add administrative information to the data record 
        INT_EDIDD-SEGNAM = C_CLIENT_DETAILS_SEGMENT. 
        INT_EDIDD-SDATA = FS_CLIENTDET_DATA. 
    append the client details for the week to the IDoc data 
        APPEND INT_EDIDD. 
      ENDLOOP. 
      *--Employee monthly summary--
    compute total hours and amount for the month 
      LOOP AT IT_WKDET. 
        TOTAL_HRS_MONTH = TOTAL_HRS_MONTH + IT_WKDET-TOTHOURS. 
        TOTAL_AMT_MONTH = TOTAL_AMT_MONTH + ( IT_WKDET-TOTHOURS * 
                                              IT_WKDET-HRLYRATE ). 
      ENDLOOP. 
    fill the summary information 
      FS_SUMMARY_DATA-TOTHRS = TOTAL_HRS_MONTH. 
      FS_SUMMARY_DATA-TOTAMT = TOTAL_AMT_MONTH. 
    condense the summary record fields to remove spaces 
      CONDENSE FS_SUMMARY_DATA-TOTHRS. 
      CONDENSE FS_SUMMARY_DATA-TOTAMT. 
    add administrative information to the data record 
      INT_EDIDD-SEGNAM = C_SUMMARY_SEGMENT. 
      INT_EDIDD-SDATA = FS_SUMMARY_DATA. 
    append summary data to the IDoc data 
      APPEND INT_EDIDD. 
      *************Pass control to the ALE layer**************************** 
      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' 
           EXPORTING 
                master_idoc_control            = control_record_out 
           TABLES 
                COMMUNICATION_IDOC_CONTROL     = IT_COMM_IDOCS 
                MASTER_IDOC_DATA               = INT_EDIDD 
           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 NE 0. 
         MESSAGE E003 WITH P_SSN. 
      ELSE. 
         LOOP AT IT_COMM_IDOCS. 
           WRITE: / 'IDoc generated', IT_COMM_IDOCS-DOCNUM. 
         ENDLOOP. 
         COMMIT WORK. 
      ENDIF.

Maybe you are looking for