SAPFree generatorPDF, Excel, Word exportSAP ECC / S/4HANA

SAP WM Open Transfer Order ABAP SELECT Generator

Unconfirmed transfer orders are the first thing to check when stock looks wrong or pickers say a task is stuck. This generator produces a small ABAP report that lists open transfer order items by warehouse, storage type and age.

Fill in

Generated code
Download:

ABAP report

REPORT ZWM_OPEN_TO_AGING.

TABLES: ltap.

PARAMETERS: p_lgnum TYPE ltap-lgnum DEFAULT '100' OBLIGATORY,
            p_age   TYPE i DEFAULT 1.
SELECT-OPTIONS: s_vltyp FOR ltap-vltyp.

TYPES: BEGIN OF ty_open_to,
         lgnum TYPE ltap-lgnum,
         tanum TYPE ltap-tanum,
         tapos TYPE ltap-tapos,
         matnr TYPE ltap-matnr,
         werks TYPE ltap-werks,
         vltyp TYPE ltap-vltyp,
         vlpla TYPE ltap-vlpla,
         nltyp TYPE ltap-nltyp,
         nlpla TYPE ltap-nlpla,
         vsolm TYPE ltap-vsolm,
         meins TYPE ltap-meins,
         bdatu TYPE ltak-bdatu,
         bname TYPE ltak-bname,
         age   TYPE i,
       END OF ty_open_to.

DATA: lt_open TYPE STANDARD TABLE OF ty_open_to,
      lv_cutoff TYPE sy-datum.

INITIALIZATION.
  IF '001' IS NOT INITIAL.
    s_vltyp-sign = 'I'.
    s_vltyp-option = 'EQ'.
    s_vltyp-low = '001'.
    APPEND s_vltyp.
  ENDIF.

START-OF-SELECTION.
  lv_cutoff = sy-datum - p_age.

  SELECT p~lgnum p~tanum p~tapos p~matnr p~werks
         p~vltyp p~vlpla p~nltyp p~nlpla p~vsolm p~meins
         k~bdatu k~bname
    FROM ltap AS p
    INNER JOIN ltak AS k
       ON k~lgnum = p~lgnum
      AND k~tanum = p~tanum
    INTO CORRESPONDING FIELDS OF TABLE lt_open
    UP TO 5000 ROWS
    WHERE p~lgnum = p_lgnum
      AND p~pquit = space
      AND p~vltyp IN s_vltyp
      AND k~bdatu <= lv_cutoff
    ORDER BY k~bdatu.

  FIELD-SYMBOLS: <ls_open> TYPE ty_open_to.
  LOOP AT lt_open ASSIGNING <ls_open>.
    <ls_open>-age = sy-datum - <ls_open>-bdatu.
    WRITE: / <ls_open>-tanum, <ls_open>-tapos, <ls_open>-matnr,
             <ls_open>-vltyp, <ls_open>-vlpla, <ls_open>-nltyp,
             <ls_open>-nlpla, <ls_open>-vsolm, <ls_open>-meins,
             <ls_open>-bdatu, <ls_open>-age.
  ENDLOOP.

Notes on the logic

* PQUIT blank in LTAP means the transfer order item is not yet confirmed.
* BDATU in LTAK is the creation date of the transfer order.
* The age is calculated in calendar days. Adjust for a factory calendar if needed.
* Replace the WRITE statements with an ALV (CL_SALV_TABLE) for production use.

Written in classic ABAP syntax that runs on ECC and S/4HANA. Verify field names in SE11 for your release, test in a sandbox, and add authority checks (for example on object L_LGNUM) before using in production. Open transfer orders in the quality or interim storage types may be expected, so review the list before cancelling anything.

Open task reporting without ABAP

Optional: see how a read-only assistant answers questions about stuck warehouse tasks from live SAP data.

Optional. The tool and every export work without this. No spam.

How to use the generator

Enter your warehouse number, the minimum age in days and optionally a source storage type. The generated report joins LTAP and LTAK, filters unconfirmed items using the confirmation indicator PQUIT and lists them oldest first. Copy the code into SE38, activate it and run it. Export the code to PDF if you need to attach it to a change request or a transport description.

How the query works

LTAP holds the item level movement, with source and destination bins, quantities and the confirmation indicator. LTAK holds the header, including the creation date and the user who created the order. The join is on warehouse number and transfer order number. Filtering on PQUIT = space selects items that are open. The age is calculated against the creation date, which is a useful proxy for stuck work, as a task that has been open for several days is rarely waiting for a legitimate reason.

  • Use storage type selection to focus on picking or putaway areas
  • Sort by creation date to find the oldest stuck orders
  • Review the creator to find manual or interface sources

Common mistakes

Do not cancel open transfer orders blindly. Some are intentionally open, for example putaway tasks waiting for a forklift or picks staged for a shipment tomorrow. Check the delivery status first. Another mistake is running the report without a warehouse number, which scans every warehouse and runs slowly in large systems. This generator makes the warehouse number mandatory for that reason.

Frequently Asked Questions

How do I know a transfer order item is confirmed?

In LTAP the confirmation indicator PQUIT is set to X when the item is confirmed. A blank value means it is still open. For items that need confirmation, the transfer order is also not complete until all items are confirmed.

Will this work in S/4HANA?

In S/4HANA systems that still use classic WM the tables exist and the code works. If the system uses embedded EWM, you need warehouse tasks from the /SCWM/ tables instead, and this report does not apply.

Can I turn this into an ALV report?

Yes. Replace the WRITE loop with CL_SALV_TABLE=>FACTORY and display the internal table. This gives sorting, filtering and Excel export for users without extra code in the layout.

What does the age filter use?

The creation date of the transfer order header, field BDATU in LTAK, compared to the current date. Orders created on or before the cut-off date are listed. Adjust the logic if you need working days.

If you regularly build reports like this for warehouse supervisors, Netray can set up a read-only assistant so they can ask for open and aged orders themselves.