16:
17: move_recs wip_move_txn_interface_cleanup.WIP_MOVE_TXN_INTERFACE_REC;
18: alloc_recs wip_move_alloc_cleanup.WIP_MOVE_TXN_ALLOCATIONS_REC;
19: mtl_temp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
20: sn_temp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
21: lt_temp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
22: sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
23: sn_marks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
24:
18: alloc_recs wip_move_alloc_cleanup.WIP_MOVE_TXN_ALLOCATIONS_REC;
19: mtl_temp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
20: sn_temp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
21: lt_temp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
22: sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
23: sn_marks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
24:
25: cursor overcpl_move_id is
26: select wmti1.transaction_id
19: mtl_temp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
20: sn_temp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
21: lt_temp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
22: sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
23: sn_marks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
24:
25: cursor overcpl_move_id is
26: select wmti1.transaction_id
27: from wip_move_txn_interface wmti,
143: err_code out NOCOPY number,
144: err_app out NOCOPY varchar2,
145: err_msg out NOCOPY varchar2) is
146: mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
147: mtl_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
148: mtl_lt_tmp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
149: mtl_dyn_sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
150: mtl_sn_mrks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
151:
145: err_msg out NOCOPY varchar2) is
146: mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
147: mtl_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
148: mtl_lt_tmp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
149: mtl_dyn_sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
150: mtl_sn_mrks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
151:
152: x_retcode number;
153: x_app varchar2(3);
146: mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
147: mtl_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
148: mtl_lt_tmp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
149: mtl_dyn_sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
150: mtl_sn_mrks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
151:
152: x_retcode number;
153: x_app varchar2(3);
154: x_msg varchar2(30);
206: err_app OUT NOCOPY VARCHAR2,
207: err_msg OUT NOCOPY VARCHAR2) IS
208:
209: cmp_mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
210: cmp_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
211: cmp_lt_tmp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
212: cmp_dyn_sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
213: cmp_sn_mrks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
214:
208:
209: cmp_mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
210: cmp_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
211: cmp_lt_tmp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
212: cmp_dyn_sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
213: cmp_sn_mrks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
214:
215: bf_mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
216: bf_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
209: cmp_mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
210: cmp_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
211: cmp_lt_tmp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
212: cmp_dyn_sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
213: cmp_sn_mrks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
214:
215: bf_mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
216: bf_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
217: bf_lt_tmp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
212: cmp_dyn_sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
213: cmp_sn_mrks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
214:
215: bf_mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
216: bf_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
217: bf_lt_tmp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
218: bf_dyn_sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
219: bf_sn_mrks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
220:
214:
215: bf_mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
216: bf_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
217: bf_lt_tmp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
218: bf_dyn_sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
219: bf_sn_mrks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
220:
221: -- Overcompletion
222: oc_move_recs wip_move_txn_interface_cleanup.WIP_MOVE_TXN_INTERFACE_REC;
215: bf_mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
216: bf_sn_tmp_recs wip_serial_temp_cleanup.MTL_SERIAL_NUMBERS_TEMP_REC;
217: bf_lt_tmp_recs wip_lot_temp_cleanup.MTL_TRANSACTION_LOTS_TEMP_REC;
218: bf_dyn_sn_recs wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_REC;
219: bf_sn_mrks wip_serial_number_cleanup.MTL_SERIAL_NUMBERS_MARK_REC;
220:
221: -- Overcompletion
222: oc_move_recs wip_move_txn_interface_cleanup.WIP_MOVE_TXN_INTERFACE_REC;
223: oc_alloc_recs wip_move_alloc_cleanup.WIP_MOVE_TXN_ALLOCATIONS_REC;
368:
369: if (mtl_header_id > 0) then
370:
371: -- Delete predefined serial numbers
372: delete mtl_serial_numbers
373: where group_mark_id = mtl_header_id
374: and current_status = 6;
375:
376: -- Unmark serial numbers
373: where group_mark_id = mtl_header_id
374: and current_status = 6;
375:
376: -- Unmark serial numbers
377: update mtl_serial_numbers
378: set group_mark_id = null,
379: line_mark_id = null,
380: lot_line_mark_id = null
381: where group_mark_id = mtl_header_id;
380: lot_line_mark_id = null
381: where group_mark_id = mtl_header_id;
382:
383: -- Delete lot and serial records from temp tables
384: delete mtl_serial_numbers_temp
385: where group_header_id = mtl_header_id;
386:
387: delete mtl_transaction_lots_temp
388: where group_header_id = mtl_header_id;
415: (select transaction_temp_id
416: from mtl_material_transactions_temp
417: where transaction_header_id=txn_hdr_id
418: and transaction_mode=1);
419: delete mtl_serial_numbers_temp where
420: transaction_temp_id in
421: (select transaction_temp_id
422: from mtl_material_transactions_temp
423: where transaction_header_id=txn_hdr_id
468: where transaction_header_id = txn_hdr_id
469: and transaction_type_id in (35, 43, 38, 48)
470: ) ;
471:
472: delete from mtl_serial_numbers_interface
473: where transaction_interface_id in
474: ( select transaction_interface_id from
475: mtl_transactions_interface
476: where transaction_header_id = txn_hdr_id