sql
Source: INVCLRMOv115.5.sql version 115.5
To check for corrupted move order data that could be cleaned up by the script IN
VCLRMOv115.5.sql, please run SQL queries like below:
a. Check for orphan move order allocations in Pending Transactions: (all move or
der types)
select
mmtt.trx_source_line_id
,mmtt.transaction_source_id
,mmtt.transaction_temp_id
,mmtt.move_order_header_id
,mmtt.move_order_line_id
,mmtt.organization_id
,mmtt.inventory_item_id
,mmtt.transaction_type_id
,mmtt.primary_quantity
from
mtl_material_transactions_temp mmtt
where mmtt.move_order_line_id is not null
and not exists (
select null
from mtl_txn_request_lines mtrl
where mtrl.line_id = mmtt.move_order_line_id
)
order by
mmtt.trx_source_line_id
,mmtt.transaction_temp_id
/
b. Check for move order allocations in Pending Transactions related to closed mo
ve order lines: (all move order types)
select
mtrl.txn_source_line_id
,mtrl.txn_source_id
,mmtt.transaction_temp_id
,mtrl.header_id
,mtrl.line_number
,mtrl.line_id
,mmtt.organization_id
,mmtt.inventory_item_id
,mmtt.transaction_type_id
,mmtt.primary_quantity
from
mtl_txn_request_lines mtrl
,mtl_material_transactions_temp mmtt
where mmtt.move_order_line_id = mtrl.line_id
and mtrl.line_status = 5
order by
mtrl.txn_source_line_id
,mmtt.transaction_temp_id
/
c. Check for sales order move order allocations in Pending Transactions with no
order by
mtrl.txn_source_line_id
,mtrl.line_id
/