Ansicht
Dokumentation

MWMIDI01 - Enhancement for error handling with IDOC inbox

MWMIDI01 - Enhancement for error handling with IDOC inbox

RFUMSV00 - Advance Return for Tax on Sales/Purchases   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

With this user exit, the error handling can be influenced customer-specifically when processing IDOCs that were sent from external systems to SAP via the MM-MOB and WM-LSR interfaces.

This exit can be used for the following message types:

  • WMTOCO - Confirm transfer order
  • WMCATO - Reverse transfer order
  • WMTREQ - Create/reverse transfer requirement
  • WMBBIN - Block storage bins
  • WMSUMO - Move storage unit

The user exit is performed in function modules that process the IDOCs of the above-mentioned message types:

  • L_IDOC_INPUT_WMTOCO
  • L_IDOC_INPUT_WMCATO
  • L_IDOC_INPUT_WMTREQ
  • L_IDOC_INPUT_WMBBIN
  • L_IDOC_INPUT_WMSUMO

The IDOC processing is performed online.

The user exit in the program is the function module EXIT_SAPLLIDI_001. In order to be able to use the user exit, you must create Include ZXLIDU04 and activate the enhancement with transaction CMOD. As parameters, you can use the IDOC data and the data for error handling that were determined in the function modules when processing the individual IDOCs:

  • Message type (import parameter I_MESTYP).
  • IDOC number (import parameter I_DOCNUM).
  • Return code from the function module that performs the functions such as 'Create Transfer Order' or 'Block Storage Bins' (import parameter I_SUBRC).
  • Indicator: The error causes a ROLLBACK (import parameter I_FLG_ERROR_ROLLBACK).
  • Identification of the error message (import parameter X_LMESS).
  • Determined return code for further IDOC processing (import parameter X_RETURNCODE).
  • Determined error category for workflow processing in the ALE interface (import parameter X_CATEGORIE).
  • Return code as processing result for the ALE interface (import parameter X_RESULT).

The user exit transfers the modified data of the error handling that control the further processing process and that are returned to the ALE interface:

  • Identification of the error message (export parameter X_LMESS)
  • Determined return code for further IDOC processing. (export parameter X_RETURNCODE)
  • Determined error category for the workflow processing in the ALE interface (export parameter X_CATEGORIE).
  • Return code as processing result for the ALE interface (export parameter X_RESULT).

If an error causes a rollback (import parameter I_FLG_ERROR_ROLLBACK is set), the determined error data cannot be influenced.

If the parameter X_RETURNCODE is returned to the calling program unequal to 0, the IDOC is regarded as being incorrect and the IDOC is marked with status '51'.

You can use the following values for parameter X_CATEGORIE:

  • 'Processed_IDOCs'
  • 'Error_IDOCs'
  • 'Continue_IDOCs'
  • 'Retry_IDOCs'

The following characteristics are currently used for parameter X_RESULT:

  • '0000' - The IDOC was processed successfully
  • '9999' - The IDOC was not processed because of an error

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

  • When you create a transfer requirement from message type WMTREQ, the processing is to be marked as being incorrect for a certain message number and a separate error message is to be stored in the created work item.

    *--------------------------------------------------------------------*
    * INCLUDE ZXLIDU04 *
    *--------------------------------------------------------------------*

    case i_mestyp.
    when 'WMTREQ'.
    if x_returncode ne 0.
    if x_lmess-msgno eq '442'.
    move 1 to x_returncode.
    move 'Error_IDOCs' to x_categorie.
    move '9999' to x_result.
    move 'LK' to x_lmess-msgid.
    move '901' to x_lmess-msgno.
    move i_docnum to x_lmess-msgv2.
    endif.
    endif.
    endcase.

  • When blocking the storage bins via message type WMBBIN, a work item is always to be created to inform certain users that some storage bins were blocked by the external system.

    *--------------------------------------------------------------------*
    * INCLUDE ZXLIDU04 *
    *--------------------------------------------------------------------*

    case i_mestyp.
    when 'WMBBIN'.
    if x_returncode eq 0.
    move 1 to x_returncode.
    move 'Continue_IDOCs' to x_categorie.
    move '9999' to x_result.
    move 'LK' to x_lmess-msgid.
    move '902' to x_lmess-msgno.
    endif.
    endcase.


  • You can also use the user exit together with other user exits of the MM-MOB and WM-LSR interfaces. In the user exit EXIT_SAPLLIDI_002 where the transfer order confirmation is received, you can, for example, determine whether the external system reported a difference. A flag is set for differences that was defined as global variable in module pool SAPLXLID. In the user exit for the error handling, work items are created if the flag is set to inform certain users.
1. EXIT_SAPLLIDI_002 to confirm transfer orders

*--------------------------------------------------------------------*
* INCLUDE ZXLIDU05 *
*--------------------------------------------------------------------*

clear flg_differenz.
loop at t_ltap_conf.
if not t_ltap_conf-ndifa is initial.
move 'X' to flg_differenz.
modify t_ltap_conf.
endif.
endloop.

2. EXIT_SAPLLIDI_002 for error handling

case i_mestyp.
when 'WMTOCO'.
if not flg_differenz is initial.
move 1 to x_returncode.
move 'Continue_IDOCs' to x_categorie.
move '8888' to x_result.
move 'LK' to x_lmess-msgid.
move '903' to x_lmess-msgno.
endif.
endcase.

  • When you confirm a transfer order, the standard system always creats a work item in form of a note, if the transfer order to be confirmed or the transfer order item has already been confirmed. If no work item is to be created in this case, you have to adjust the error category.

    *--------------------------------------------------------------------*
    * INCLUDE ZXLIDU04 *
    *--------------------------------------------------------------------*

    case i_mestyp.
    when 'WMTOCO'.
    if x_lmess-msgid eq 'LK' and
    x_lmess-msgno eq '043' and
    x_categorie eq 'Continue_IDOCs'.
    clear x_lmess.
    move 0 to x_returncode.
    move '0000' to x_result.
    move 'Processed_IDOCs' to x_categorie.
    endif.
    if i_subrc eq 01 and
    x_categorie eq 'Continue_IDOCs'.
    clear x_lmess.
    move 0 to x_returncode.
    move '0000' to x_result.
    move 'Processed_IDOCs' to x_categorie.
    endif.
    endcase.





RFUMSV00 - Advance Return for Tax on Sales/Purchases   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 8201 Date: 20240328 Time: 152848     sap01-206 ( 91 ms )