21:
22: BEGIN
23:
24:
25: --Call proc to update lots with the latest migrated lot number in rcv_lot_Transactions.
26: Update_rcv_lot_transactions;
27:
28: --Call proc to update secondary unit of measure and secondary quantity in rcv_supply.
29: Update_rcv_supply;
22: BEGIN
23:
24:
25: --Call proc to update lots with the latest migrated lot number in rcv_lot_Transactions.
26: Update_rcv_lot_transactions;
27:
28: --Call proc to update secondary unit of measure and secondary quantity in rcv_supply.
29: Update_rcv_supply;
30:
35:
36:
37: /*===========================================================================
38: -- PROCEDURE:
39: -- update_rcv_lot_transactions
40: --
41: -- DESCRIPTION:
42: -- This PL/SQL procedure is used to Update RCV_LOT_TRANSACTIONS for LOT_NUM.
43: --
38: -- PROCEDURE:
39: -- update_rcv_lot_transactions
40: --
41: -- DESCRIPTION:
42: -- This PL/SQL procedure is used to Update RCV_LOT_TRANSACTIONS for LOT_NUM.
43: --
44: -- PARAMETERS:
45: -- None
46: --
44: -- PARAMETERS:
45: -- None
46: --
47: -- SYNOPSIS:
48: -- update_rcv_lot_transactions;
49: --
50: -- HISTORY
51: -- P. Bamb 10-May-2005 Created
52: --=========================================================================== */
49: --
50: -- HISTORY
51: -- P. Bamb 10-May-2005 Created
52: --=========================================================================== */
53: PROCEDURE update_rcv_lot_transactions IS
54:
55: Cursor CR_GET_TRX_LOTS IS
56: SELECT rlt.rowid,
57: rlt.transaction_id transaction_id,
65: rt.subinventory subinventory,
66: rt.locator_id locator_id,
67: rlt.correction_transaction_id
68: FROM rcv_transactions rt ,
69: rcv_lot_transactions rlt,
70: mtl_parameters mp
71: WHERE rlt.lot_transaction_type = 'TRANSACTION'
72: and rlt.source_transaction_id = rt.transaction_id
73: and (rlt.sublot_num <> '-1' or rlt.sublot_num is NULL)
75: and mp.process_enabled_flag = 'Y'
76: and not exists
77: (SELECT 'x'
78: FROM GML_RCV_LOTS_MIGRATION glm
79: WHERE table_name = 'RCV_LOT_TRANSACTIONS'
80: AND glm.source_transaction_id = rlt.source_transaction_id
81: AND glm.transaction_id = rlt.transaction_id
82: AND glm.correction_transaction_id = rlt.correction_transaction_id);
83:
93: rsl.to_subinventory subinventory,
94: rsl.locator_id locator_id,
95: rlt.correction_transaction_id,
96: rlt.source_transaction_id
97: FROM rcv_lot_transactions rlt ,
98: rcv_shipment_lines rsl,
99: mtl_parameters mp
100: WHERE rlt.lot_transaction_type = 'SHIPMENT'
101: and rsl.shipment_line_id = rlt.shipment_line_id
103: and rsl.to_organization_id = mp.organization_id
104: and mp.process_enabled_flag = 'Y'
105: and not exists
106: (SELECT 'x' from GML_RCV_LOTS_MIGRATION glm
107: WHERE table_name = 'RCV_LOT_TRANSACTIONS'
108: And glm.shipment_line_id = rlt.shipment_line_id);
109:
110: l_lot_num VARCHAR2(80);
111: l_parent_lot_num VARCHAR2(80);
132: );
133:
134: --Call INVENTORY API that returns the new Lot number for the item, organization, lot, sublot,
135: -- Subinventory and Locator
136: --For any errors raise exception rcv_lot_transactions_data;
137:
138: Update rcv_lot_transactions
139: set LOT_NUM = l_lot_num
140: where rowid = cr_rec.rowid;
134: --Call INVENTORY API that returns the new Lot number for the item, organization, lot, sublot,
135: -- Subinventory and Locator
136: --For any errors raise exception rcv_lot_transactions_data;
137:
138: Update rcv_lot_transactions
139: set LOT_NUM = l_lot_num
140: where rowid = cr_rec.rowid;
141:
142:
150: CREATED_BY,
151: CREATION_DATE,
152: LAST_UPDATED_BY,
153: LAST_UPDATE_DATE)
154: VALUES ( 'RCV_LOT_TRANSACTIONS',
155: cr_rec.transaction_id,
156: cr_rec.source_transaction_id,
157: cr_rec.shipment_line_id,
158: cr_rec.correction_transaction_id,
170: column_name,table_name,error_message,
171: creation_date,last_update_date)
172: values ('CONVERGENCE',NULL, NULL, NULL,
173: cr_rec.transaction_id, cr_rec.shipment_header_id, cr_rec.shipment_line_id,
174: 'LOT_NUM','RCV_LOT_TRANSACTIONS',
175: 'ERROR DERIVING NEW LOT NUM-'||substr(l_errm,1,1970),sysdate,sysdate);
176: END;
177: END LOOP;
178:
195: );
196:
197: --Call INVENTORY API that returns the new Lot number for the item, organization, lot, sublot,
198: -- Subinventory and Locator
199: --For any errors raise exception rcv_lot_transactions_data;
200:
201: UPDATE rcv_lot_transactions
202: SET LOT_NUM = l_lot_num
203: where rowid = cr_rec1.rowid;
197: --Call INVENTORY API that returns the new Lot number for the item, organization, lot, sublot,
198: -- Subinventory and Locator
199: --For any errors raise exception rcv_lot_transactions_data;
200:
201: UPDATE rcv_lot_transactions
202: SET LOT_NUM = l_lot_num
203: where rowid = cr_rec1.rowid;
204:
205: INSERT INTO GML_RCV_LOTS_MIGRATION
211: CREATED_BY,
212: CREATION_DATE,
213: LAST_UPDATED_BY,
214: LAST_UPDATE_DATE)
215: VALUES ( 'RCV_LOT_TRANSACTIONS',
216: cr_rec1.transaction_id,
217: cr_rec1.source_transaction_id,
218: cr_rec1.shipment_line_id,
219: cr_rec1.correction_transaction_id,
231: column_name,table_name,error_message,
232: creation_date,last_update_date)
233: values ('CONVERGENCE',NULL, NULL, NULL,
234: cr_rec1.transaction_id, cr_rec1.shipment_header_id, cr_rec1.shipment_line_id,
235: 'LOT_NUM','RCV_LOT_TRANSACTIONS',
236: 'ERROR DERIVING NEW LOT NUM-'||substr(l_errm,1,1970),sysdate,sysdate);
237: END;
238: END LOOP;
239:
237: END;
238: END LOOP;
239:
240: COMMIT;
241: END Update_rcv_lot_transactions;
242:
243:
244: /*===========================================================================
245: -- PROCEDURE:
463: END IF;
464:
465: --Call INVENTORY API that returns the new Lot number for the item, organization, lot, sublot,
466: -- Subinventory and Locator
467: --For any errors raise exception rcv_lot_transactions_data;
468:
469: UPDATE rcv_lots_supply
470: SET LOT_NUM = l_lot_num,
471: REASON_ID = l_reason_id
531: END IF;
532:
533: --Call INVENTORY API that returns the new Lot number for the item, organization, lot, sublot,
534: -- Subinventory and Locator
535: --For any errors raise exception rcv_lot_transactions_data;
536:
537: UPDATE rcv_lots_supply
538: SET LOT_NUM = l_lot_num,
539: REASON_ID = l_reason_id