WM – ABAP – Custom Control Cycle Determination

WM – ABAP – Custom Control Cycle Determination

Sometimes SAP WM has some limitations in Control Cycle determination. Control Cycle Master Data (Transaction LPK1-2-3) are simply based on supply areas (transaction PK05) that are linked to workcenters or resources. Unfortunately only one storage location can be linked to a supply area. As a WM certified consultant, I love to have a clean system and a clean warehouse situation without many negatives or useless open transfer requirements. Due to the SAP Standard architecture, this is not possible if different storage locations are determined for a production operation. In these cases it could happen that during goods issue posting some goods are issued from storage type 100 and other from storage type 914 (creating a transfer requirement) simply because for some components the control cycle is determined and for other components with a “not matching storage location” no. This can be easily checked looking in table RESB. Here after production order release you can find WM information from control cycle: Warehouse Number (LGNUM), Storage Type (LGTYP) and Storage BIN (LGPLA).

In this blog post you will learn how to influence the WM data determination. Please note that this solution applies only in scenarios without EWM (for EWM a custom control cycle determination is still possible, but It’s a whole different story).

Debugging the standard system, a few years ago, I found the function module responsible of WM data determination: L_WMPP_INTERFACE_FROM_PP. Please consider that in this Function module you can influence the Warehouse Number, the Storage Type and the Storage Bin. You cannot modify the supply area (PRVBE). If you want to modify also this information you have to modify the function module that encapsulate the above FM: CO_ZF_WM_INTERFACE.

Here is an example of how to modify the FM L_WMPP_INTERFACE_FROM_PP. In this case we want that control cycle is fetched ignoring the storage location information. Search for implicit enhancements points and create a new enhancement just before the “ENDFUNCTION” instruction.

Here is the code for a simple copy and paste:

    LOOP AT lres.

      “–> Select Material Specific Control Cycle
      SELECT SINGLE * FROM pkhd INTO CORRESPONDING FIELDS OF lres WHERE matnr = lres-matnr AND werks = lres-werks AND prvbe = lres-prvbe.
      IF sy-subrc = 0.
        CLEAR lres-ecode.
        CLEAR lres-eprot.
        MODIFY lres INDEX sy-tabix.
      ELSE.
        “–> Select Supply Area Generic Control Cycle
        SELECT SINGLE * FROM pkhd INTO CORRESPONDING FIELDS OF lres WHERE werks = lres-werks AND prvbe = lres-prvbe.
        IF sy-subrc = 0.
          CLEAR lres-ecode.
          CLEAR lres-eprot.
          MODIFY lres INDEX sy-tabix.
        ENDIF.
      ENDIF.

    ENDLOOP.

Please note that we are also overwriting the error messages because by design the system will fail, but we force a new (and absolutely right!) control cycle.

Tags: , ,

Lascia un commento