–关闭工单提示 这些任务存在待定事务处理。
/*select * from FND_NEW_MESSAGES T where T.MESSAGE_TEXT LIKE '这些任务存在待定事务处理。';--TRANSACTIONS PENDING
select * from ALL_SOURCE T where TEXT LIKE '%TRANSACTIONS PENDING%' ;
WIP_JOBCLOSE_PRIV;
*/
SELECT wip_entity_name
FROM wip_dj_close_temp
WHERE group_id = p_group_id
AND organization_id = &p_organization_id
AND wip_entity_id IN (SELECT wip_entity_id
FROM wip_move_txn_interface
WHERE organization_id = &p_organization_id
UNION ALL
SELECT wip_entity_id
FROM wip_cost_txn_interface
WHERE organization_id = &p_organization_id
UNION ALL
SELECT transaction_source_id
FROM mtl_material_transactions_temp mmtt
WHERE organization_id = &p_organization_id
AND transaction_source_type_id = 5
AND transaction_source_id NOT IN (SELECT txn_source_id
FROM mtl_txn_request_lines
WHERE txn_source_id = mmtt.transaction_source_id
AND organization_id = mmtt.organization_id
AND line_status = 9)
UNION ALL
SELECT transaction_source_id
FROM mtl_material_transactions
WHERE costed_flag IN ('N', 'E')
AND transaction_source_type_id = 5
AND organization_id = &p_organization_id
UNION ALL
SELECT DISTINCT wip_entity_id
FROM wip_operation_yields
WHERE organization_id = &p_organization_id
AND status IN (1, 3)
UNION ALL
SELECT wlc.wip_entity_id
FROM wip_lpn_completions wlc,
wms_license_plate_numbers lpn,
mtl_txn_request_lines mtrl
WHERE wlc.organization_id = &p_organization_id
AND wlc.lpn_id = lpn.lpn_id
AND mtrl.lpn_id = lpn.lpn_id
AND mtrl.txn_source_id = wlc.wip_entity_id
AND mtrl.line_status = 7
AND lpn.lpn_context = 2);