121: l_filename VARCHAR2(100) := 'ins_mmtt' || to_char(sysdate, 'dd:mm:hh24:mi');
122: x_mesg_data VARCHAR2(2000) := 'None';
123: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
124: BEGIN
125: /* For lot split transaction (INV_Globals.G_type_inv_lot_split) there is a single start
126: lot and multiple resulting
127: Start Lot always gets stored in the 1st index position .
128: For Lot merger (inv_globals.G_type_inv_lot_merge) 1st index position should store
129: the single resulting lot from
124: BEGIN
125: /* For lot split transaction (INV_Globals.G_type_inv_lot_split) there is a single start
126: lot and multiple resulting
127: Start Lot always gets stored in the 1st index position .
128: For Lot merger (inv_globals.G_type_inv_lot_merge) 1st index position should store
129: the single resulting lot from
130: multiple starting lots.
131: For lot translate transaction (INV_Globals.G_type_inv_lot_translate) there is a
132: single start lot and single resulting lot.
127: Start Lot always gets stored in the 1st index position .
128: For Lot merger (inv_globals.G_type_inv_lot_merge) 1st index position should store
129: the single resulting lot from
130: multiple starting lots.
131: For lot translate transaction (INV_Globals.G_type_inv_lot_translate) there is a
132: single start lot and single resulting lot.
133: Start Lot always gets stored in the 1st index position.
134: */
135:
686: l_parent_id NUMBER := 0;
687: l_header_id NUMBER := 0;
688: l_temp_id NUMBER := 0;
689: l_batch_id NUMBER := 0;
690: l_transaction_action_id NUMBER := inv_globals.G_Action_inv_lot_split;
691: l_transaction_source_type_id NUMBER := inv_globals.G_SourceType_Inventory;
692: l_acct_period_id org_acct_periods.acct_period_id%TYPE := 0;
693: l_dist_account_id mtl_parameters.distribution_account_id%TYPE := NULL;
694: l_wsm_enabled_flag mtl_parameters.wsm_enabled_flag%TYPE := 'N';
687: l_header_id NUMBER := 0;
688: l_temp_id NUMBER := 0;
689: l_batch_id NUMBER := 0;
690: l_transaction_action_id NUMBER := inv_globals.G_Action_inv_lot_split;
691: l_transaction_source_type_id NUMBER := inv_globals.G_SourceType_Inventory;
692: l_acct_period_id org_acct_periods.acct_period_id%TYPE := 0;
693: l_dist_account_id mtl_parameters.distribution_account_id%TYPE := NULL;
694: l_wsm_enabled_flag mtl_parameters.wsm_enabled_flag%TYPE := 'N';
695: l_xfr_lpn_id NUMBER := NULL;
753: END;
754:
755: /* For Lot Translate, need to get the distribution account id and populate
756: into mmtt */
757: IF (p_transaction_type_id = inv_globals.G_type_inv_lot_translate) THEN
758: IF (l_debug = 1) THEN
759: INV_TRX_UTIL_PUB.trace('lot translate before getting dist acct', g_pkg_name, 9);
760: END IF;
761: BEGIN
807:
808: END IF;
809:
810: l_msg_data := 'if trx_type';
811: IF ( p_transaction_type_id = inv_globals.G_type_inv_lot_split)
812: THEN
813: tab_input(ind_1st).transaction_quantity := p_total_qty;
814: l_transaction_action_id := inv_globals.G_Action_inv_lot_split;
815: ELSE
810: l_msg_data := 'if trx_type';
811: IF ( p_transaction_type_id = inv_globals.G_type_inv_lot_split)
812: THEN
813: tab_input(ind_1st).transaction_quantity := p_total_qty;
814: l_transaction_action_id := inv_globals.G_Action_inv_lot_split;
815: ELSE
816: IF ( p_transaction_type_id = inv_globals.G_type_inv_lot_merge)
817: THEN
818: l_transaction_action_id := inv_globals.G_Action_inv_lot_merge;
812: THEN
813: tab_input(ind_1st).transaction_quantity := p_total_qty;
814: l_transaction_action_id := inv_globals.G_Action_inv_lot_split;
815: ELSE
816: IF ( p_transaction_type_id = inv_globals.G_type_inv_lot_merge)
817: THEN
818: l_transaction_action_id := inv_globals.G_Action_inv_lot_merge;
819: ELSE
820: tab_input(ind_1st).transaction_quantity := p_total_qty;
814: l_transaction_action_id := inv_globals.G_Action_inv_lot_split;
815: ELSE
816: IF ( p_transaction_type_id = inv_globals.G_type_inv_lot_merge)
817: THEN
818: l_transaction_action_id := inv_globals.G_Action_inv_lot_merge;
819: ELSE
820: tab_input(ind_1st).transaction_quantity := p_total_qty;
821: l_transaction_action_id := inv_globals.G_Action_inv_lot_translate;
822: END IF;
817: THEN
818: l_transaction_action_id := inv_globals.G_Action_inv_lot_merge;
819: ELSE
820: tab_input(ind_1st).transaction_quantity := p_total_qty;
821: l_transaction_action_id := inv_globals.G_Action_inv_lot_translate;
822: END IF;
823: END IF;
824: -- populate transaction_temp_id in the table so that you know the parent id to
825: -- be populated in all transactions in mmtt
923:
924: tab_input(ind).xfr_lpn_id := l_xfr_lpn_id;
925:
926: IF (tab_input(ind).transaction_lot = 'S'
927: AND (p_transaction_type_id = inv_globals.G_type_inv_lot_split OR p_transaction_type_id = inv_globals.G_type_inv_lot_translate))
928: THEN
929: l_parent_id := l_temp_id;
930: ELSE
931: IF (tab_input(ind).transaction_lot = 'R'
928: THEN
929: l_parent_id := l_temp_id;
930: ELSE
931: IF (tab_input(ind).transaction_lot = 'R'
932: AND p_transaction_type_id = inv_globals.G_type_inv_lot_merge)
933: THEN
934: l_parent_id := l_temp_id;
935: END IF;
936: END IF;
952: tab_input(ind).transaction_quantity := tab_input(ind).transaction_quantity * -1;
953: tab_input(ind).secondary_transaction_quantity := tab_input(ind).secondary_transaction_quantity * -1; -- Bug #4093379 INVCONV
954: END IF;
955:
956: IF (p_transaction_type_id = inv_globals.G_type_inv_lot_translate OR
957: p_transaction_type_id = inv_globals.G_type_inv_lot_split) THEN
958: SELECT MTL_MATERIAL_TRANSACTIONS_S.NEXTVAL
959: INTO tab_input(ind).transaction_batch_seq
960: FROM DUAL;
953: tab_input(ind).secondary_transaction_quantity := tab_input(ind).secondary_transaction_quantity * -1; -- Bug #4093379 INVCONV
954: END IF;
955:
956: IF (p_transaction_type_id = inv_globals.G_type_inv_lot_translate OR
957: p_transaction_type_id = inv_globals.G_type_inv_lot_split) THEN
958: SELECT MTL_MATERIAL_TRANSACTIONS_S.NEXTVAL
959: INTO tab_input(ind).transaction_batch_seq
960: FROM DUAL;
961: END IF;
961: END IF;
962:
963: END LOOP;
964:
965: IF ( p_transaction_type_id = inv_globals.G_type_inv_lot_merge) THEN
966: FOR ind IN REVERSE 1..tab_index
967: LOOP
968: SELECT MTL_MATERIAL_TRANSACTIONS_S.NEXTVAL
969: INTO tab_input(ind).transaction_batch_seq
970: FROM DUAL;
971: END LOOP;
972: END IF;
973:
974: IF ( p_transaction_type_id = inv_globals.G_type_inv_lot_split OR p_transaction_type_id = inv_globals.G_type_inv_lot_translate)
975: THEN
976: FOR ind IN 1..tab_index
977: LOOP
978: IF (l_debug = 1) THEN
1044:
1045: END LOOP;
1046: END IF;
1047:
1048: IF ( p_transaction_type_id = inv_globals.G_type_inv_lot_merge) THEN
1049: FOR ind IN REVERSE 1..tab_index
1050: LOOP
1051: IF (l_debug = 1) THEN
1052: INV_TRX_UTIL_PUB.trace(ind || ': Header_id ' || tab_input(ind).transaction_header_id,g_pkg_name,9);
1163: l_transaction_type_id MTL_TRANSACTION_TYPES.transaction_type_id%TYPE;
1164: CURSOR cur_trx_types IS
1165: SELECT transaction_type_name , transaction_type_id
1166: FROM mtl_transaction_types
1167: WHERE transaction_type_id IN ( INV_Globals.G_type_inv_lot_split,
1168: INV_Globals.G_type_inv_lot_merge,
1169: INV_Globals.G_type_inv_lot_translate);
1170: -- (82, 83, 84);
1171: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
1164: CURSOR cur_trx_types IS
1165: SELECT transaction_type_name , transaction_type_id
1166: FROM mtl_transaction_types
1167: WHERE transaction_type_id IN ( INV_Globals.G_type_inv_lot_split,
1168: INV_Globals.G_type_inv_lot_merge,
1169: INV_Globals.G_type_inv_lot_translate);
1170: -- (82, 83, 84);
1171: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
1172: BEGIN
1165: SELECT transaction_type_name , transaction_type_id
1166: FROM mtl_transaction_types
1167: WHERE transaction_type_id IN ( INV_Globals.G_type_inv_lot_split,
1168: INV_Globals.G_type_inv_lot_merge,
1169: INV_Globals.G_type_inv_lot_translate);
1170: -- (82, 83, 84);
1171: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
1172: BEGIN
1173: x_return_status := FND_API.G_RET_STS_SUCCESS;
1193: END LOOP;
1194: EXCEPTION
1195: WHEN NO_DATA_FOUND THEN
1196: FND_MESSAGE.SET_NAME('INV', 'INV_TRANSACTION_TYPE_ERROR');
1197: FND_MESSAGE.SET_TOKEN('ENTITY1', INV_Globals.G_type_inv_lot_split || ',' ||
1198: INV_Globals.G_type_inv_lot_merge || ',' ||
1199: INV_Globals.G_type_inv_lot_translate);
1200: FND_MSG_PUB.ADD;
1201: RAISE FND_API.G_EXC_ERROR ;
1194: EXCEPTION
1195: WHEN NO_DATA_FOUND THEN
1196: FND_MESSAGE.SET_NAME('INV', 'INV_TRANSACTION_TYPE_ERROR');
1197: FND_MESSAGE.SET_TOKEN('ENTITY1', INV_Globals.G_type_inv_lot_split || ',' ||
1198: INV_Globals.G_type_inv_lot_merge || ',' ||
1199: INV_Globals.G_type_inv_lot_translate);
1200: FND_MSG_PUB.ADD;
1201: RAISE FND_API.G_EXC_ERROR ;
1202:
1195: WHEN NO_DATA_FOUND THEN
1196: FND_MESSAGE.SET_NAME('INV', 'INV_TRANSACTION_TYPE_ERROR');
1197: FND_MESSAGE.SET_TOKEN('ENTITY1', INV_Globals.G_type_inv_lot_split || ',' ||
1198: INV_Globals.G_type_inv_lot_merge || ',' ||
1199: INV_Globals.G_type_inv_lot_translate);
1200: FND_MSG_PUB.ADD;
1201: RAISE FND_API.G_EXC_ERROR ;
1202:
1203: END;