Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> UserExit>MWMIDO03



User Exits for IDOC Setup in WM
With this user exit, the contents and structure of IDOC WMRRID01 'Reference number release' can be influenced customer-specifically in the outbox.

General Information on IDOC Processing

Within the application, you first decide using the Customizing application whether the interface to an external system will be activated. In this case, the transfer orders are evaluated and the system creates an extract of the items relevant for this interface. In addition, you determine the partner system to which the transfer order data is to be transmitted, that is, one or several external systems are determined for the communication process. For each external system, an IDOC is created. The IDOC is set up in a function module that is assigned to the respective message type via a Customizing table. All the transfer order items that are relevant for the external system in question are passed on to this function module. This function module creates the IDOC and passes it on to the ALE interface. The ALE interface is responsible for saving the created IDOCs and for transmitting them to the external system.

General information on the reference number release in the WCU interface.

The reference number is used in the WM system to group together several transfer orders or to identify them. It is used for multiple processing during the transfer order generation. The individual transfer orders that were created with multiple processing were transferred to one or more external systems. Usually, the stock movements for these transfer orders in the external system must be initiated separately by the Warehouse Management System. When the reference number is released in WM, the start for the stock movements is passed on to the subsystem.

Call transaction and other important requirements

The user exit is performed in function module that sets up IDOC WMRRID01. This is done after the IDOC setup but before it is transferred to the ALE interface. The standard function module for setting up IDOC WMRRID01 is called L_IDOC_CREATE_WMRRID01. The setup is part of the reference number release for multiple processing. This means that the source code is executed online.

Parameters and options

The user exit in the program is function module EXIT_SAPLLIDO_003. In order to be able to use the user exit, you must create Include ZXLIDU03 and activate the enhancement with transaction CMOD. As parameters, you can use the reference number, the TO data of all transfer orders on the reference number and the IDOC data:

  • Warehouse number (import parameter I_LGNUM)
  • Reference number (import parameter I_REFNR)
  • TO headers (table parameter T_LTAK)
  • TO items (table parameter T_LTAP)
  • Control record of the IDOC that has been set up (import parameter X_IDOC_CONTROL)
  • Data records of the IDOC that has been set up (table parameter T_IDOC_DATA)

This user exit can basically be used to:

  • change or redetermine the data in IDOC WMRRID01 that were determined during the standard procedure or provide partners with additional information using empty fields of this IDOC.
  • change or enhance the data for controlling the IDOC processing in the control record of the IDOC.
  • If you enhanced the basic IDOC WMRRID01 with your own segments, you have to to fill these segments including the necessary data.

The user exit returns the modified IDOC data to the calling program by means of the following parameters:

  • Control record of the IDOC that has been set up (export parameter X_IDOC_CONTROL)
  • Data records of the IDOC that has been set up (table parameter T_IDOC_DATA)

The modified IDOC is passed on by the calling program to the ALE interface for sending.

Although changes to tables T_LTAP and T_LTAK are without any meaning, they should still not be made.


Below, you will find some conceivable changes including the necessary source code.

  • You want to send additional data in IDOC WMRRID01.

The fields 'Date' and 'Time' are not used in the standard system. The picking date is to be transferred to the external system. The date is determined from all deliveries in question as the earliest required picking date. That is, picking for this reference number must begin in the external system at this date.

*   INCLUDE ZXLIDU03                                                  *
tables : e1lrrfx,
data: datum like likp-kodat.

*........Ermitteln Datum und Uhrzeit der Kommisionierung...............

  clear datum.
  loop at t_ltak.
    check not t_ltak-vbeln is initial.

*........Lesen Lieferung und das fr・este Kommi.Datum ermitteln........

    select single * from likp
     where vbeln eq t_ltak-vbeln.
    if sy-subrc eq 0.
      if datum is initial.
*........Das ermittelte Datum im IDOC fortschreiben...................
  check not datum is initial.
  loop at t_idoc_data.
    if t_idoc_data-segnam = 'E1LRRFX'.
      move t_idoc_data-sdata to e1lrrfx.
      move datum to e1lrrfx-datum.
      move e1lrrfx to t_idoc_data-sdata.
      modify t_idoc_data.

  • Please refer to the documentation of user exit MWMIDO01 for more
    • EXIT_SAPLLIDO_003: Customer Exit of IDOC WMRRID01 (Reference Number Release) on Issue