cleaning up reservation entry

genericgeneric Member Posts: 511
Hello when MRP runs, it creates thousands of entries in reservation entry.

Looking at code it actually deletes all existing reservation entries based on the following logic before running MRP.
I was wondering that you could run the same process at the end and get rid of all the tracking entries.
All they cause is headache. We are getting constantly errors with this reservation does not exists, this PO does not exists when deleting Requisition lines. It's great that tracking tries to keep track as demand and supply but the code is not fixed. This is version 4.0 sp3.

Name	DataType	Subtype	Length
ActionMsgEntry	Record	Action Message Entry	
ReservEntry	Record	Reservation Entry
DeleteTracking(VAR Item : Record Item)
ActionMsgEntry.SETCURRENTKEY("Reservation Entry");

WITH ReservEntry DO BEGIN
  RESET;
  SETCURRENTKEY("Item No.","Variant Code","Location Code","Reservation Status");
  SETRANGE("Item No.",Item."No.");
  SETFILTER("Reservation Status",'<>%1',"Reservation Status"::Prospect);
  IF FIND('-') THEN
    REPEAT
      IF (("Reservation Status" <> "Reservation Status"::Reservation)
        OR (Binding = Binding::"Order-to-Order")) THEN BEGIN
        ActionMsgEntry.SETRANGE(ActionMsgEntry."Reservation Entry","Entry No.");
        DELETE;
        ActionMsgEntry.DELETEALL;
      END;
    UNTIL NEXT = 0;
END;

Comments

Sign In or Register to comment.