Purging discarded orders

Web orders have more chances of being discarded mid stream through the process than the normal backend orders due to web connection being lost or customers deciding not to go ahead with the order. The discarded orders are being stored unnecessarily in the system and can be tying up stock that can otherwise be sold. The existing transaction purge program will delete these records based on the user defined retention period. However web orders will need to be deleted more frequently than normal back end sales order transactions.

The web orders have a distinct order type on the transaction header. This is set-up in control file TMSWWW/ORDT-DFT.

The web orders go through the following stages.

L’ (in maintenance) – when the order is being processed on the web and products are added to the shopping cart

B’ (awaiting payment) – when the order is checked out and ready to process payment

S’ (suspended) – all web orders in ‘L’ and ‘B’ statuses will be updated to ‘S’ by running DSO899 (Suspend Orders program) if the last activity time is more than an hour. Suspend orders program can be scheduled to run at customer specified frequency after the end of day process.

The users can retrieve the web orders in above statuses when they log back to the web and can proceed to check out and pay the order. The subsequent supply and delivery will be handled as per normal orders.

Purge Suspended Orders program (DSP190) has been developed specifically to delete web orders based on a different retention period and selection criteria. Control file TMSDS/RTN-SPNO has been created to define, by company, the retention period of web and normal orders in days. The purge program will delete all sales order transactions with status of ‘S’ (suspended),  order type as per control file TMSWWW/ORDT-DFT and last activity date earlier than the current date plus retention period. The last activity date is derived from the transaction date from the date/time stamp file.

Depending on the set-up of stock allocation flag in control file TMSDS/OM-OT1, the reserved stock will need to be released from the warehouse file by reducing the reserved processing quantity on the warehouse file with the web ordered quantity. This will be done using Stock De-allocation program.

For a given example with ordered quantity of 10, stocks are reserved as follows.

 Status 1=Normal  2=In maintenance 3=Finalised 
10 10  0
B 10 10  10 
10