<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Idoc in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3313075#M793519</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  i thing this will be help full to u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; With this user exit, the contents and structure of IDOC WMTOID01&lt;/P&gt;&lt;P&gt; 'Transfer order' can be influenced customer-specifically in the outbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Call transaction and other important requirements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The user exit is performed in the function module that sets up IDOC&lt;/P&gt;&lt;P&gt; WMTOID01. This is done after the IDOC setup but before it is transferred&lt;/P&gt;&lt;P&gt; to the ALE interface. The standard function module for setting up IDOC&lt;/P&gt;&lt;P&gt; WMTOID01 is called L_IDOC_CREATE_WMTOID01. The IDOC setup is part of the&lt;/P&gt;&lt;P&gt; transfer order generation. This means that the source code can run both&lt;/P&gt;&lt;P&gt; asynchronously in the update program and online. For this reason, all&lt;/P&gt;&lt;P&gt; error messages must be issued as abend messages to guarantee a correct&lt;/P&gt;&lt;P&gt; termination with rollback. Furthermore, you must not use any key words&lt;/P&gt;&lt;P&gt; such as COMMIT WORK, ROLLBACK WORK, LEAVE, or the like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Parameters and options&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The user exit in the program is function module EXIT_SAPLLIDO_001. In&lt;/P&gt;&lt;P&gt; order to be able to use the user exit, you must create Include ZXLIDU01  and activate the enhancement with transaction CMOD. As parameters, you&lt;/P&gt;&lt;P&gt; can use the transfer order and IDOC data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   TO header (import parameter I_LTAK)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   TO items (table parameter T_LTAP)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   Control record of the IDOC that has been set up (import parameter&lt;/P&gt;&lt;P&gt;     X_IDOC_CONTROL)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   Data records of the IDOC that has been set up (table parameter&lt;/P&gt;&lt;P&gt;     T_IDOC_DATA)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; This user exit can basically be used to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   change or redetermine the data in IDOC WMTOID01 that were determined&lt;/P&gt;&lt;P&gt;     during the standard procedure or provide partners with additional&lt;/P&gt;&lt;P&gt;     information using empty fields of this IDOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   change or enhance the data for controlling the IDOC processing in&lt;/P&gt;&lt;P&gt;     the control record of the IDOC.&lt;/P&gt;&lt;P&gt;    o   If you enhanced the basic IDOC WMTOID01 with your own segments, you&lt;/P&gt;&lt;P&gt;        have to fill these segments including the necessary data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    The user exit returns the modified IDOC data to the calling program by&lt;/P&gt;&lt;P&gt;    means of the following parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    o   Control record of the IDOC that has been set up (export parameter&lt;/P&gt;&lt;P&gt;        X_IDOC_CONTROL)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    o   Data records of the IDOC that has been set up (table parameter&lt;/P&gt;&lt;P&gt;        T_IDOC_DATA)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    The modified IDOC is passed on by the calling program to the ALE&lt;/P&gt;&lt;P&gt;    interface for sending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Although changes to table T_LTAP are without any meaning, they should&lt;/P&gt;&lt;P&gt;    still not be made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Examples&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Below, you will find some conceivable changes including the necessary source code.&lt;/P&gt;&lt;P&gt;  o   You want to send additional data on TO item level. These data are&lt;/P&gt;&lt;P&gt;      transferred in the standard segment of IDOC WMTOID01.&lt;/P&gt;&lt;P&gt;      With field 'Goods recipient', information is transferred whether the&lt;/P&gt;&lt;P&gt;      external system should additionally print accompanying documents for&lt;/P&gt;&lt;P&gt;      the sent transfer order. The indicator for printout from the TO&lt;/P&gt;&lt;P&gt;      header and the printer from the TO items are specified in this&lt;/P&gt;&lt;P&gt;      field.&lt;/P&gt;&lt;P&gt;      In addition, a separate description is written into the field&lt;/P&gt;&lt;P&gt;      'Unloading point'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;        *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCLUDE ZXLIDU01&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;        *&lt;/P&gt;&lt;P&gt;      tables: e1ltori,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        loop at t_idoc_data.&lt;/P&gt;&lt;P&gt;  *........Zusatzinfos aus dem Transportauftrag..........................&lt;/P&gt;&lt;P&gt;      if t_idoc_data-segnam = 'E1LTORI'.&lt;/P&gt;&lt;P&gt;         move t_idoc_data-sdata to e1ltori.&lt;/P&gt;&lt;P&gt;         loop at t_ltap&lt;/P&gt;&lt;P&gt;          where tanum eq i_ltak-tanum&lt;/P&gt;&lt;P&gt;            and tapos eq e1ltori-tapos.&lt;/P&gt;&lt;P&gt;           exit.&lt;/P&gt;&lt;P&gt;         endloop.&lt;/P&gt;&lt;P&gt;         if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;           move i_ltak-drukz to e1ltori-wempf.&lt;/P&gt;&lt;P&gt;           move t_ltap-ldest to e1ltori-wempf+2.&lt;/P&gt;&lt;P&gt;           move e1ltori to  t_idoc_data-sdata.&lt;/P&gt;&lt;P&gt;           modify t_idoc_data.&lt;/P&gt;&lt;P&gt;         endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *........Zusatzinfos die individuell beschafft werden..................&lt;/P&gt;&lt;P&gt;         move 'USER-EXIT' to e1ltori-ablad.&lt;/P&gt;&lt;P&gt;         move e1ltori to  t_idoc_data-sdata.&lt;/P&gt;&lt;P&gt;         modify t_idoc_data.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;  o   The IDOCs that have been set up are to be transferred to the&lt;/P&gt;&lt;P&gt;      external system via two different logical destinations, depending on&lt;/P&gt;&lt;P&gt;      the transport type. This requires two different partner profiles.&lt;/P&gt;&lt;P&gt;      The partner profile depends on the message type, message variant and&lt;/P&gt;&lt;P&gt;      message function. Message function 'EIN' is used for stock&lt;/P&gt;&lt;P&gt;      placements whereas 'RES' is used for all other movements. You have&lt;/P&gt;&lt;P&gt;      to maintain the partner profile for these two message functions&lt;/P&gt;&lt;P&gt;      'EIN' and 'RES' as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;        *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCLUDE ZXLIDU01&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;        *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if i_ltak-trart eq 'E'.&lt;/P&gt;&lt;P&gt;          move 'EIN' to x_idoc_control-mesfct.&lt;/P&gt;&lt;P&gt;        else.&lt;/P&gt;&lt;P&gt;    move 'RES' to x_idoc_control-mesfct.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For transfer orders on deliveries, the external system requires&lt;/P&gt;&lt;P&gt;additional delivery data such as name of the goods recipient, route,&lt;/P&gt;&lt;P&gt;shipping point, and the like. In this case, the large amount of&lt;/P&gt;&lt;P&gt;additional data can only be transferred via an additional IDOC&lt;/P&gt;&lt;P&gt;segment. That is, you have to define a seprate IDOC type that&lt;/P&gt;&lt;P&gt;consists of the basic IDOC type WMTOID01 and a separate enhancement&lt;/P&gt;&lt;P&gt;type. In the enhancement type, you define the new segment, for&lt;/P&gt;&lt;P&gt;example Z1LTORZ, that refers to the standard segment E1LTORH.&lt;/P&gt;&lt;P&gt;Filling the data of the new segment can be done as follows.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;-*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCLUDE ZXLIDU01&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;-*&lt;/P&gt;&lt;P&gt;  tables: e1ltori,&lt;/P&gt;&lt;P&gt;          z1ltorz,&lt;/P&gt;&lt;P&gt;          edidd,&lt;/P&gt;&lt;P&gt;          likp.&lt;/P&gt;&lt;P&gt;  data: flg_neues_segment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: begin of xidoc_data occurs 0.&lt;/P&gt;&lt;P&gt;         include structure edidd.&lt;/P&gt;&lt;P&gt;  data: end   of xidoc_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&amp;gt;&amp;gt;&amp;gt; Neues Segment anlegen Z1LTORZ &amp;lt;&amp;lt;&amp;lt;.............................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.......Bestehendes IDOC sichern......................................&lt;/P&gt;&lt;P&gt;loop at t_idoc_data.&lt;/P&gt;&lt;P&gt;  move t_idoc_data to xidoc_data.&lt;/P&gt;&lt;P&gt;  append xidoc_data.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *........Neuen IDOC-Typ und Erweiterungs-Typ im Kontrolsatz fortschr...&lt;/P&gt;&lt;P&gt;    move:&lt;/P&gt;&lt;P&gt;         'ZZWMTOID' to x_idoc_control-doctyp,&lt;/P&gt;&lt;P&gt;         'ZWMTOID1' to x_idoc_control-cimtyp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *........Aus dem bestehenden IDOC ein neues IDOC erstellen.............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       dabei wird das neue Segment aufgebaut und eingebettet&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    refresh t_idoc_data.&lt;/P&gt;&lt;P&gt;    loop at xidoc_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *........Merken:neues Segment soll nach dem Segment E1LTORH kommen.....&lt;/P&gt;&lt;P&gt;      if xidoc_data-segnam = 'E1LTORH'.&lt;/P&gt;&lt;P&gt;        flg_neues_segment = 'X'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *........Standard-Segmente übernehmen..................................&lt;/P&gt;&lt;P&gt;        move xidoc_data to t_idoc_data.&lt;/P&gt;&lt;P&gt;        append t_idoc_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    *........Neues Segment übernehmen......................................&lt;/P&gt;&lt;P&gt;        if flg_neues_segment eq 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    *........Lesen Lieferung und Daten in neues Segment übergeben..........&lt;/P&gt;&lt;P&gt;          if not i_ltak-vbeln is initial.&lt;/P&gt;&lt;P&gt;            select single * from likp&lt;/P&gt;&lt;P&gt;             where vbeln eq i_ltak-vbeln.&lt;/P&gt;&lt;P&gt;            if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;              clear t_idoc_data.&lt;/P&gt;&lt;P&gt;              move-corresponding likp to z1ltorz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    *........Neues Segment sichern.........................................&lt;/P&gt;&lt;P&gt;              move 'Z1LTORZ' to t_idoc_data-segnam.&lt;/P&gt;&lt;P&gt;              move z1ltorz to t_idoc_data-sdata.&lt;/P&gt;&lt;P&gt;              append t_idoc_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      move space to flg_neues_segment.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Feb 2008 15:28:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-06T15:28:04Z</dc:date>
    <item>
      <title>Idoc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3313073#M793517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the use of this MWMIDO01 Enhancement? Please do the need full.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 15:21:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3313073#M793517</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T15:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Idoc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3313074#M793518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With this user exit, the contents and structure of IDOC WMTOID01&lt;/P&gt;&lt;P&gt;'Transfer order' can be influenced customer-specifically in the outbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call transaction and other important requirements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user exit is performed in the function module that sets up IDOC&lt;/P&gt;&lt;P&gt;WMTOID01. This is done after the IDOC setup but before it is transferred&lt;/P&gt;&lt;P&gt;to the ALE interface. The standard function module for setting up IDOC&lt;/P&gt;&lt;P&gt;WMTOID01 is called L_IDOC_CREATE_WMTOID01. The IDOC setup is part of the&lt;/P&gt;&lt;P&gt;transfer order generation. This means that the source code can run both&lt;/P&gt;&lt;P&gt;asynchronously in the update program and online. For this reason, all&lt;/P&gt;&lt;P&gt;error messages must be issued as abend messages to guarantee a correct&lt;/P&gt;&lt;P&gt;termination with rollback. Furthermore, you must not use any key words&lt;/P&gt;&lt;P&gt;such as COMMIT WORK, ROLLBACK WORK, LEAVE, or the like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters and options&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user exit in the program is function module EXIT_SAPLLIDO_001. In&lt;/P&gt;&lt;P&gt;order to be able to use the user exit, you must create Include ZXLIDU01&lt;/P&gt;&lt;P&gt;and activate the enhancement with transaction CMOD. As parameters, you&lt;/P&gt;&lt;P&gt;can use the transfer order and IDOC data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o   TO header (import parameter I_LTAK)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o   TO items (table parameter T_LTAP)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o   Control record of the IDOC that has been set up (import parameter&lt;/P&gt;&lt;P&gt;    X_IDOC_CONTROL)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o   Data records of the IDOC that has been set up (table parameter&lt;/P&gt;&lt;P&gt;    T_IDOC_DATA)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This user exit can basically be used to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o   change or redetermine the data in IDOC WMTOID01 that were determined&lt;/P&gt;&lt;P&gt;    during the standard procedure or provide partners with additional&lt;/P&gt;&lt;P&gt;    information using empty fields of this IDOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o   change or enhance the data for controlling the IDOC processing in&lt;/P&gt;&lt;P&gt;    the control record of the IDOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o   If you enhanced the basic IDOC WMTOID01 with your own segments, you&lt;/P&gt;&lt;P&gt;     have to fill these segments including the necessary data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The user exit returns the modified IDOC data to the calling program by&lt;/P&gt;&lt;P&gt; means of the following parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   Control record of the IDOC that has been set up (export parameter&lt;/P&gt;&lt;P&gt;     X_IDOC_CONTROL)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   Data records of the IDOC that has been set up (table parameter&lt;/P&gt;&lt;P&gt;     T_IDOC_DATA)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The modified IDOC is passed on by the calling program to the ALE&lt;/P&gt;&lt;P&gt; interface for sending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Although changes to table T_LTAP are without any meaning, they should&lt;/P&gt;&lt;P&gt; still not be made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 15:25:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3313074#M793518</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T15:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Idoc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3313075#M793519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  i thing this will be help full to u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; With this user exit, the contents and structure of IDOC WMTOID01&lt;/P&gt;&lt;P&gt; 'Transfer order' can be influenced customer-specifically in the outbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Call transaction and other important requirements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The user exit is performed in the function module that sets up IDOC&lt;/P&gt;&lt;P&gt; WMTOID01. This is done after the IDOC setup but before it is transferred&lt;/P&gt;&lt;P&gt; to the ALE interface. The standard function module for setting up IDOC&lt;/P&gt;&lt;P&gt; WMTOID01 is called L_IDOC_CREATE_WMTOID01. The IDOC setup is part of the&lt;/P&gt;&lt;P&gt; transfer order generation. This means that the source code can run both&lt;/P&gt;&lt;P&gt; asynchronously in the update program and online. For this reason, all&lt;/P&gt;&lt;P&gt; error messages must be issued as abend messages to guarantee a correct&lt;/P&gt;&lt;P&gt; termination with rollback. Furthermore, you must not use any key words&lt;/P&gt;&lt;P&gt; such as COMMIT WORK, ROLLBACK WORK, LEAVE, or the like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Parameters and options&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The user exit in the program is function module EXIT_SAPLLIDO_001. In&lt;/P&gt;&lt;P&gt; order to be able to use the user exit, you must create Include ZXLIDU01  and activate the enhancement with transaction CMOD. As parameters, you&lt;/P&gt;&lt;P&gt; can use the transfer order and IDOC data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   TO header (import parameter I_LTAK)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   TO items (table parameter T_LTAP)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   Control record of the IDOC that has been set up (import parameter&lt;/P&gt;&lt;P&gt;     X_IDOC_CONTROL)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   Data records of the IDOC that has been set up (table parameter&lt;/P&gt;&lt;P&gt;     T_IDOC_DATA)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; This user exit can basically be used to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   change or redetermine the data in IDOC WMTOID01 that were determined&lt;/P&gt;&lt;P&gt;     during the standard procedure or provide partners with additional&lt;/P&gt;&lt;P&gt;     information using empty fields of this IDOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; o   change or enhance the data for controlling the IDOC processing in&lt;/P&gt;&lt;P&gt;     the control record of the IDOC.&lt;/P&gt;&lt;P&gt;    o   If you enhanced the basic IDOC WMTOID01 with your own segments, you&lt;/P&gt;&lt;P&gt;        have to fill these segments including the necessary data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    The user exit returns the modified IDOC data to the calling program by&lt;/P&gt;&lt;P&gt;    means of the following parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    o   Control record of the IDOC that has been set up (export parameter&lt;/P&gt;&lt;P&gt;        X_IDOC_CONTROL)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    o   Data records of the IDOC that has been set up (table parameter&lt;/P&gt;&lt;P&gt;        T_IDOC_DATA)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    The modified IDOC is passed on by the calling program to the ALE&lt;/P&gt;&lt;P&gt;    interface for sending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Although changes to table T_LTAP are without any meaning, they should&lt;/P&gt;&lt;P&gt;    still not be made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Examples&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Below, you will find some conceivable changes including the necessary source code.&lt;/P&gt;&lt;P&gt;  o   You want to send additional data on TO item level. These data are&lt;/P&gt;&lt;P&gt;      transferred in the standard segment of IDOC WMTOID01.&lt;/P&gt;&lt;P&gt;      With field 'Goods recipient', information is transferred whether the&lt;/P&gt;&lt;P&gt;      external system should additionally print accompanying documents for&lt;/P&gt;&lt;P&gt;      the sent transfer order. The indicator for printout from the TO&lt;/P&gt;&lt;P&gt;      header and the printer from the TO items are specified in this&lt;/P&gt;&lt;P&gt;      field.&lt;/P&gt;&lt;P&gt;      In addition, a separate description is written into the field&lt;/P&gt;&lt;P&gt;      'Unloading point'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;        *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCLUDE ZXLIDU01&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;        *&lt;/P&gt;&lt;P&gt;      tables: e1ltori,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        loop at t_idoc_data.&lt;/P&gt;&lt;P&gt;  *........Zusatzinfos aus dem Transportauftrag..........................&lt;/P&gt;&lt;P&gt;      if t_idoc_data-segnam = 'E1LTORI'.&lt;/P&gt;&lt;P&gt;         move t_idoc_data-sdata to e1ltori.&lt;/P&gt;&lt;P&gt;         loop at t_ltap&lt;/P&gt;&lt;P&gt;          where tanum eq i_ltak-tanum&lt;/P&gt;&lt;P&gt;            and tapos eq e1ltori-tapos.&lt;/P&gt;&lt;P&gt;           exit.&lt;/P&gt;&lt;P&gt;         endloop.&lt;/P&gt;&lt;P&gt;         if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;           move i_ltak-drukz to e1ltori-wempf.&lt;/P&gt;&lt;P&gt;           move t_ltap-ldest to e1ltori-wempf+2.&lt;/P&gt;&lt;P&gt;           move e1ltori to  t_idoc_data-sdata.&lt;/P&gt;&lt;P&gt;           modify t_idoc_data.&lt;/P&gt;&lt;P&gt;         endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *........Zusatzinfos die individuell beschafft werden..................&lt;/P&gt;&lt;P&gt;         move 'USER-EXIT' to e1ltori-ablad.&lt;/P&gt;&lt;P&gt;         move e1ltori to  t_idoc_data-sdata.&lt;/P&gt;&lt;P&gt;         modify t_idoc_data.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;  o   The IDOCs that have been set up are to be transferred to the&lt;/P&gt;&lt;P&gt;      external system via two different logical destinations, depending on&lt;/P&gt;&lt;P&gt;      the transport type. This requires two different partner profiles.&lt;/P&gt;&lt;P&gt;      The partner profile depends on the message type, message variant and&lt;/P&gt;&lt;P&gt;      message function. Message function 'EIN' is used for stock&lt;/P&gt;&lt;P&gt;      placements whereas 'RES' is used for all other movements. You have&lt;/P&gt;&lt;P&gt;      to maintain the partner profile for these two message functions&lt;/P&gt;&lt;P&gt;      'EIN' and 'RES' as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;        *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCLUDE ZXLIDU01&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;      *&lt;/P&gt;&lt;P&gt;        *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if i_ltak-trart eq 'E'.&lt;/P&gt;&lt;P&gt;          move 'EIN' to x_idoc_control-mesfct.&lt;/P&gt;&lt;P&gt;        else.&lt;/P&gt;&lt;P&gt;    move 'RES' to x_idoc_control-mesfct.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For transfer orders on deliveries, the external system requires&lt;/P&gt;&lt;P&gt;additional delivery data such as name of the goods recipient, route,&lt;/P&gt;&lt;P&gt;shipping point, and the like. In this case, the large amount of&lt;/P&gt;&lt;P&gt;additional data can only be transferred via an additional IDOC&lt;/P&gt;&lt;P&gt;segment. That is, you have to define a seprate IDOC type that&lt;/P&gt;&lt;P&gt;consists of the basic IDOC type WMTOID01 and a separate enhancement&lt;/P&gt;&lt;P&gt;type. In the enhancement type, you define the new segment, for&lt;/P&gt;&lt;P&gt;example Z1LTORZ, that refers to the standard segment E1LTORH.&lt;/P&gt;&lt;P&gt;Filling the data of the new segment can be done as follows.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;-*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCLUDE ZXLIDU01&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;-*&lt;/P&gt;&lt;P&gt;  tables: e1ltori,&lt;/P&gt;&lt;P&gt;          z1ltorz,&lt;/P&gt;&lt;P&gt;          edidd,&lt;/P&gt;&lt;P&gt;          likp.&lt;/P&gt;&lt;P&gt;  data: flg_neues_segment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: begin of xidoc_data occurs 0.&lt;/P&gt;&lt;P&gt;         include structure edidd.&lt;/P&gt;&lt;P&gt;  data: end   of xidoc_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&amp;gt;&amp;gt;&amp;gt; Neues Segment anlegen Z1LTORZ &amp;lt;&amp;lt;&amp;lt;.............................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.......Bestehendes IDOC sichern......................................&lt;/P&gt;&lt;P&gt;loop at t_idoc_data.&lt;/P&gt;&lt;P&gt;  move t_idoc_data to xidoc_data.&lt;/P&gt;&lt;P&gt;  append xidoc_data.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *........Neuen IDOC-Typ und Erweiterungs-Typ im Kontrolsatz fortschr...&lt;/P&gt;&lt;P&gt;    move:&lt;/P&gt;&lt;P&gt;         'ZZWMTOID' to x_idoc_control-doctyp,&lt;/P&gt;&lt;P&gt;         'ZWMTOID1' to x_idoc_control-cimtyp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *........Aus dem bestehenden IDOC ein neues IDOC erstellen.............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       dabei wird das neue Segment aufgebaut und eingebettet&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    refresh t_idoc_data.&lt;/P&gt;&lt;P&gt;    loop at xidoc_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *........Merken:neues Segment soll nach dem Segment E1LTORH kommen.....&lt;/P&gt;&lt;P&gt;      if xidoc_data-segnam = 'E1LTORH'.&lt;/P&gt;&lt;P&gt;        flg_neues_segment = 'X'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  *........Standard-Segmente übernehmen..................................&lt;/P&gt;&lt;P&gt;        move xidoc_data to t_idoc_data.&lt;/P&gt;&lt;P&gt;        append t_idoc_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    *........Neues Segment übernehmen......................................&lt;/P&gt;&lt;P&gt;        if flg_neues_segment eq 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    *........Lesen Lieferung und Daten in neues Segment übergeben..........&lt;/P&gt;&lt;P&gt;          if not i_ltak-vbeln is initial.&lt;/P&gt;&lt;P&gt;            select single * from likp&lt;/P&gt;&lt;P&gt;             where vbeln eq i_ltak-vbeln.&lt;/P&gt;&lt;P&gt;            if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;              clear t_idoc_data.&lt;/P&gt;&lt;P&gt;              move-corresponding likp to z1ltorz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    *........Neues Segment sichern.........................................&lt;/P&gt;&lt;P&gt;              move 'Z1LTORZ' to t_idoc_data-segnam.&lt;/P&gt;&lt;P&gt;              move z1ltorz to t_idoc_data-sdata.&lt;/P&gt;&lt;P&gt;              append t_idoc_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      move space to flg_neues_segment.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 15:28:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc/m-p/3313075#M793519</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T15:28:04Z</dc:date>
    </item>
  </channel>
</rss>

