SAP Knowledge Base Article - Public

3768827 - Purchase Order confirmation sequence in EKES reused after deletion; change log shows deletion

Symptom

Change logs show that a purchase order confirmation with sequence 0001 was deleted, but the inbound delivery/confirmation view still shows sequence 1 instead of incrementing to the next sequence (for example 0002).

Environment

  • Materials Management (MM)
  • SAP R/3
  • SAP R/3 Enterprise 4.7
  • SAP ERP Core Component
  • SAP ERP
  • SAP enhancement package for SAP ERP
  • SAP enhancement package for SAP ERP, version for SAP HANA
  • SAP S/4 HANA

Reproducing the Issue

  1. Open transaction ME23N and display a purchase order.
  2. Go to the Confirmations tab and review the first inbound delivery/confirmation sequence.
  3. Compare with the purchase order change logs (CDHDR/CDPOS) that indicate deletion of a confirmation line.
  4. Observe that the new/remaining confirmation still uses sequence 0001 rather than a higher sequence.

Cause

Standard behaviour:

- After a confirmation line is deleted, the next created confirmation reuses the freed sequence number (ETENS) obtained from the bitmask handler, not the next incremental number. 

- This is set by code lines such as t_ekes-etens = lo_bit->get_etens() in the confirmation maintenance logic (e.g., VL31N/ME22N).

Resolution

  1. Acknowledge that confirmation sequence numbers (EKES-ETENS) are reused when freed. The system intentionally assigns the lowest available sequence (for example 0001) after deletion.
  2. When analyzing change history, note that deletion events in ME22N/ME23N record only the action (deletion) and not the detailed field values in CDPOS/CDHDR.
  3. To identify active/visible confirmations in ME23N and downstream reporting, select EKES entries where EKES-MENGE is not zero; lines with zero quantity are not displayed and indicate no open requirement.
  4. Manage confirmations linked to inbound deliveries via VL* transactions (for example VL31N) rather than ME22N; EKES entries tied to deliveries are processed in logistics transactions.
  5. If integration or reporting logic assumed monotonically increasing sequences, adjust it to:
  6. 1. Determine the valid confirmation by status/quantity (for example EKES-MENGE > 0) and delivery reference, not by sequence progression.
  7. 2. Treat ETENS as a reusable identifier that can reappear after deletions.

See Also

When the new confirmation line is created in VL31N:

Include LEINBU08 (FUNCTION ME_CONFIRMATION_MAINTAIN_AVIS)

...

case t_ekes-kz.
*- Neues Avis ----------------------------------------------------------
      when 'I'.
*- vervollständigen ----------------------------------------------------
* get ETENS from bitmask
        t_ekes-etens = lo_bit->get_etens( ).    

...

=========================================

When the new confirmation line is created in ME22N:

Include LEINBF11 (FORM ETS_FUELLEN)

...

* get new ETENS from bitmask handler
    ekes-etens = lo_bit->get_etens( ).    

...    

=========================================

Keywords

EKES, CDPOS, CDHDR, ME22N, ME23N, VL31N, inbound delivery, confirmation control, ETENS, sequence reuse, deletion, change log, shipping notification, purchase order confirmations, MENGE , KBA , MM-PUR-GF-CON , Confirmation Control/Shipping Notification , Problem

Product

SAP S/4HANA Cloud Public Edition all versions