508: CURSOR c_fm_to_serial_number IS
509: SELECT
510: msnt.fm_serial_number,
511: msnt.to_serial_number
512: FROM mtl_serial_numbers_temp msnt
513: WHERE msnt.transaction_temp_id = p_mmtt_id;
514:
515: CURSOR c_fm_to_lot_serial_number IS
516: SELECT
516: SELECT
517: msnt.fm_serial_number,
518: msnt.to_serial_number
519: FROM
520: mtl_serial_numbers_temp msnt,
521: mtl_transaction_lots_temp mtlt
522: WHERE mtlt.transaction_temp_id = p_mmtt_id
523: AND msnt.transaction_temp_id = mtlt.serial_transaction_temp_id;
524:
777: begin
778: select count(*)
779: into l_msnt_cnt
780: from mtl_transaction_lots_temp mtlt
781: ,mtl_serial_numbers_temp msnt
782: where mtlt.transaction_temp_id = l_mmtt_id
783: and mtlt.serial_transaction_temp_id = msnt.transaction_temp_id;
784:
785: mdebug('l_msnt_cnt:'||l_msnt_cnt);
794: if l_serial_control_code NOT IN (1,6) then -- serial controlled
795: begin
796: select count(*)
797: into l_msnt_cnt
798: from mtl_serial_numbers_temp msnt
799: where transaction_temp_id = l_mmtt_id;
800:
801: mdebug('l_msnt_cnt:'||l_msnt_cnt);
802: exception
850: CLOSE c_fm_to_lot_serial_number;
851:
852: mdebug('before delete msnt');
853:
854: DELETE FROM mtl_serial_numbers_temp msnt
855: WHERE msnt.transaction_temp_id IN
856: (SELECT mtlt.serial_transaction_temp_id
857: FROM mtl_transaction_lots_temp mtlt
858: WHERE mtlt.transaction_temp_id = l_mmtt_id);
896:
897: END LOOP;
898: CLOSE c_fm_to_serial_number;
899:
900: DELETE FROM mtl_serial_numbers_temp msnt
901: WHERE msnt.transaction_temp_id = l_mmtt_id;
902:
903: END IF;
904: