Purge Aged Purchase Orders (order_purge_job)

Module Name

order_purge_job

Description

Purge Aged Purchase Orders

Functional Area

Purchase Orders

Module Type

Admin - Ad hoc

Module Technology

Background Processing

Catalog ID

N/A

Wrapper Script

b8dwrap.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This background job is composed of two-step processing. It will have a threading assignment and a business logic processing.

Thread assignment program will filter eligible records from order header and other associated and order-related tables based on its conditions below:

  1. If importing is not enabled in the system (as defined by the import system indicator = 'N') and if invoice matching is not installed, then all details associated with an order are deleted when the order has been closed for more months than specified in 'Order History Months' purge parameter. Orders will only be deleted if all allocations associated, if any, have been closed.

  2. If invoice matching is installed, then all details associated with an order are deleted when the order has been closed for more months than specified in the 'Order History Months' purge parameter. Orders are deleted only if allocations associated have been closed, shipments from the order have been completely matched to invoices or closed, and all those invoices have been posted.

  3. If importing is enabled in the system (as defined by the import system indicator = 'Y') and if invoice matching is not installed, then all details associated with the order are deleted when the order has been closed for more months than specified in the 'Order History Months' purge option. This action presupposes that all ALC records associated with an order are in 'Processed' status, specified in the ALC header and allocations associated to the order, if any, have been closed.

  4. If invoice matching is installed, then all details associated with an order are deleted when the order has been closed for more months than specified in the 'Order History Months' purge parameter. This action presupposes that all ALC records associated with an order are in 'Processed' status, specified in ALC head, all allocations associated to the order, if any, have been closed, all shipments from the order have been completely matched to invoices or closed, and all those invoices have been posted.

  5. If the order to be purged is an import PO and it doesn't have a letter of credit (LC) then purge the related records related to obligations, ALC and ICB transfers.

These records are chunked and Thread ID is assigned for each. They will be stored temporarily in a staging table.

The Business logic program will process all records from the staging table. Using bulk processing, this program will delete the records from order header and other associated and order-related tables. It will free up and clean the staging table afterwards. There is a STOP ON NEXT feature in bulk processing (through a loop) where Administrators can stop this batch with a flip of this indicator.

Restart/Recovery

N/A

Key Tables Affected

Table 5-3 Key Tables Affected

Table Select Insert Update Delete

PURGE_CONFIG_OPTIONS

Yes

No

No

No

RMS_BATCH_STATUS

Yes

No

No

No

B8D_PROCESS_CONFIG

Yes

No

No

No

JOB_AUDIT_LOGS

No

Yes

No

No

B8D_ORDER_PURGE_STG

Yes

Yes

No

Yes

ORDHEAD

Yes

No

No

Yes

ORDLC

Yes

No

No

No

ALLOC_HEADER

Yes

No

No

Yes

SHIPMENT

Yes

No

No

Yes

SHIPSKU

Yes

No

Yes

Yes

INVC_HEAD

Yes

No

No

Yes

ORDLOC_REV

No

No

No

Yes

ORDHEAD_REV

No

No

No

Yes

ALLOC_REV

No

No

No

Yes

ALC_HEAD

Yes

No

No

Yes

ALC_COMP_LOC

No

No

No

Yes

OBLIGATION_COMP_LOC

No

No

No

Yes

OBLIGATION_COMP

No

No

No

Yes

OBLIGATION

No

No

No

Yes

TRANSPORTATION

Yes

No

No

Yes

MISSING_DOC

No

No

No

Yes

TRANS_PACKING

No

No

No

Yes

TRANS_DELIVERY

No

No

No

Yes

TRANS_CLAIMS

No

No

No

Yes

TRANS_LIC_VISA

No

No

No

Yes

TRANS_SKU

No

No

No

Yes

CE_ORD_ITEM

Yes

No

No

Yes

CE_LIC_VISA

No

No

No

Yes

CE_CHARGES

No

No

No

Yes

CE_SHIPMENT

No

No

No

Yes

CE_PROTEST

No

No

No

Yes

CE_FORMS

No

No

No

Yes

CE_HEAD

v

No

No

Yes

APPT_HEAD

Yes

No

No

Yes

APPT_DETAIL

Yes

No

No

Yes

DOC_CLOSE_QUEUE

No

No

No

Yes

DAILY_PURGE

No

Yes

No

No

ORDSKU

Yes

No

No

Yes

ITEM_MASTER

Yes

No

No

No

PACKITEM

Yes

No

No

No

PACK_TMPL_HEAD

Yes

No

No

No

RTV_DETAIL

No

No

No

Yes

WO_DETAIL

No

No

No

Yes

CARTON

No

No

No

Yes

WO_HEAD

Yes

No

No

Yes

ALLOC_CHRG

No

No

No

Yes

ALLOC_DETAIL

No

No

No

Yes

TIMELINE

No

No

No

Yes

ORDLOC

No

No

No

Yes

ORDLOC_DISCOUNT

No

No

No

Yes

ORDLOC_EXP

No

No

No

Yes

ORDSKU_HTS_ASSESS

No

No

No

Yes

ORDSKU_HTS

No

No

No

Yes

REQ_DOC

No

No

No

Yes

ORDSKU_REV

No

No

No

Yes

ORDLOC_INVC_COST

No

No

Yes

Yes

ORDCUST

Yes

No

No

Yes

ORDCUST_DETAIL

No

No

No

Yes

ORDCUST_CUSTOMER_DETAIL

No

No

No

Yes

ORD_XDOCK_TEMP

No

No

No

Yes

INVC_XREF

No

No

No

Yes

INVC_MATCH_WKSHT

No

No

No

Yes

ORDLOC_WKSHT

No

No

No

Yes

SUP_VIOLATION

No

No

No

Yes

REV_ORDERS

No

No

No

Yes

LC_ORDAPPLY

No

No

No

Yes

ORDHEAD_DISCOUNT

No

No

No

Yes

RUA_RIB_INTERFACE

No

No

No

Yes

ORDLOC_TEMP

No

No

No

Yes

ALLOC_CHRG_TEMP

No

No

No

Yes

ALLOC_DETAIL_TEMP

No

No

No

Yes

ALLOC_HEADER_TEMP

No

No

No

Yes

ORDSKU_TEMP

No

No

No

Yes

ORDLOC_EXP_TEMP

No

No

No

Yes

ORDSKU_HTS_ASSESS_TEMP

No

No

No

Yes

ORDSKU_HTS_TEMP

No

No

No

Yes

ORDLOC_DISCOUNT_TEMP

No

No

No

Yes

TIMELINE_TEMP

No

No

No

Yes

REQ_DOC_TEMP

No

No

No

Yes

WO_DETAIL_TEMP

No

No

No

Yes

WO_HEAD_TEMP

No

No

No

Yes

REPL_RESULTS_TEMP

No

No

No

Yes

DEAL_COMP_PROM

No

No

No

Yes

DEAL_HEAD

Yes

No

No

Yes

DEAL_THRESHOLD

No

No

No

Yes

DEAL_DETAIL

No

No

No

Yes

DEAL_QUEUE

No

No

No

Yes

ORD_INV_MGMT

No

No

No

Yes

REPL_RESULTS

No

No

No

Yes

INVC_DETAIL

No

No

No

Yes

INVC_NON_MERCH

No

No

No

Yes

INVC_MERCH_VAT

No

No

No

Yes

INVC_DETAIL_VAT

No

No

No

Yes

INVC_DISCOUNT

No

No

No

Yes

INVC_TOLERANCE

No

No

No

Yes

INVC_MATCH_QUEUE

No

No

No

Yes

TSFHEAD

No

No

No

Yes

TSFDETAIL

No

No

No

Yes

TSFDETAIL_CHRG

No

No

No

Yes

DEAL_ITEMLOC_ITEM

No

No

No

Yes

DEAL_ITEMLOC_DCS

No

No

No

Yes

DEAL_ITEMLOC_DIV_GRP

No

No

No

Yes

DEAL_ITEMLOC_PARENT_DIFF

No

No

No

Yes

ORDHEAD_L10N_EXT

No

No

No

Yes

ORD_TAX_BREAKUP

No

No

No

Yes

ORDHEAD_CFA_EXT

No

No

No

Yes

DEALHEAD_CFA_EXT

No

No

No

Yes

TSFHEAD_CFA_EXT

No

No

No

Yes

SHIPSKU_LOC_PRG_HIST

No

Yes

No

No

SHIPSKU_PRG_HIST

No

Yes

No

No

SHIPMENT_PRG_HIST

No

Yes

No

No

ALLOC_CHRG_PRG_HIST

No

Yes

No

No

ALLOC_DETAIL_PRG_HIST

No

Yes

No

No

ALLOC_HEADER_PRG_HIST

No

Yes

No

No

ORDLOC_REV_PRG_HIST

No

Yes

No

No

ORDSKU_REV_PRG_HIST

No

Yes

No

No

ORDHEAD_REV_PRG_HIST

No

Yes

No

No

ORDCUST_DETAIL_PRG_HIST

No

Yes

No

No

ORDCUST_PRG_HIST

No

Yes

No

No

ORDLOC_CFA_EXT_PRG_HIST

No

Yes

No

No

ORDLOC_PRG_HIST

No

Yes

No

No

ORDLOC_DISCOUNT_PRG_HIST

No

Yes

No

No

ORDLOC_EXP_PRG_HIST

No

Yes

No

No

ORDSKU_HTS_ASSESS_PRG_HIST

No

Yes

No

No

ORDSKU_HTS_PRG_HIST

No

Yes

No

No

ORDSKU_CFA_EXT_PRG_HIST

No

Yes

No

No

ORDSKU_PRG_HIST

No

Yes

No

No

ORDHEAD_DISCOUNT_PRG_HIST

No

Yes

No

No

ORDHEAD_L10N_EXT_PRG_HIST

No

Yes

No

No

ORD_TAX_BREAKUP_PRG_HIST

No

Yes

No

No

ORDHEAD_CFA_EXT_PRG_HIST

No

Yes

No

No

ORDHEAD_PRG_HIST

No

Yes

No

No

Design Assumptions

N/A