8: -- --------- ------ ------------------------------------------
9: -- pparthas 07/24/03 Created Package
10: --
11:
12: g_asn_debug VARCHAR2(1) := NVL(fnd_profile.VALUE('RCV_DEBUG_MODE'), 'N');
13:
14: PROCEDURE insert_rcv_lots_supply(
15: p_api_version IN NUMBER,
16: p_init_msg_list IN VARCHAR2,
91: l_txn_uom VARCHAR2(25);
92: l_primary_uom VARCHAR2(25);
93: l_to_org_id NUMBER;
94: BEGIN
95: IF (g_asn_debug = 'Y') THEN
96: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
97: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
98: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
99: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
92: l_primary_uom VARCHAR2(25);
93: l_to_org_id NUMBER;
94: BEGIN
95: IF (g_asn_debug = 'Y') THEN
96: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
97: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
98: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
99: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
100: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
93: l_to_org_id NUMBER;
94: BEGIN
95: IF (g_asn_debug = 'Y') THEN
96: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
97: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
98: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
99: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
100: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
101: END IF;
94: BEGIN
95: IF (g_asn_debug = 'Y') THEN
96: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
97: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
98: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
99: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
100: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
101: END IF;
102:
95: IF (g_asn_debug = 'Y') THEN
96: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
97: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
98: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
99: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
100: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
101: END IF;
102:
103: x_return_status := fnd_api.g_ret_sts_success;
96: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
97: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
98: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
99: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
100: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
101: END IF;
102:
103: x_return_status := fnd_api.g_ret_sts_success;
104:
116: IF (l_lot_count = 0) THEN
117: RETURN;
118: END IF;
119:
120: IF (g_asn_debug = 'Y') THEN
121: asn_debug.put_line('l_lot_count ' || l_lot_count);
122: END IF;
123:
124: /* We need to insert into rcv_lots_supply and
117: RETURN;
118: END IF;
119:
120: IF (g_asn_debug = 'Y') THEN
121: asn_debug.put_line('l_lot_count ' || l_lot_count);
122: END IF;
123:
124: /* We need to insert into rcv_lots_supply and
125: * rcv_serials_supply table only when we come through ROI
141: AND l_lpn_id = -999) THEN
142: RETURN;
143: END IF;
144:
145: IF (g_asn_debug = 'Y') THEN
146: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
147: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
148: END IF;
149:
142: RETURN;
143: END IF;
144:
145: IF (g_asn_debug = 'Y') THEN
146: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
147: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
148: END IF;
149:
150: SELECT transaction_id,
143: END IF;
144:
145: IF (g_asn_debug = 'Y') THEN
146: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
147: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
148: END IF;
149:
150: SELECT transaction_id,
151: organization_id
153: l_organization_id
154: FROM rcv_transactions rt
155: WHERE rt.interface_transaction_id = p_interface_transaction_id;
156:
157: IF (g_asn_debug = 'Y') THEN
158: asn_debug.put_line('before insert_lot_supply');
159: END IF;
160:
161: insert_lot_supply(p_interface_transaction_id,
154: FROM rcv_transactions rt
155: WHERE rt.interface_transaction_id = p_interface_transaction_id;
156:
157: IF (g_asn_debug = 'Y') THEN
158: asn_debug.put_line('before insert_lot_supply');
159: END IF;
160:
161: insert_lot_supply(p_interface_transaction_id,
162: 'RECEIVING',
163: p_supply_source_id,
164: x_return_status
165: );
166:
167: IF (g_asn_debug = 'Y') THEN
168: asn_debug.put_line('After insert_lot_supply');
169: END IF;
170:
171: /* If this is a receive for an internal shipment or interorg transfer
164: x_return_status
165: );
166:
167: IF (g_asn_debug = 'Y') THEN
168: asn_debug.put_line('After insert_lot_supply');
169: END IF;
170:
171: /* If this is a receive for an internal shipment or interorg transfer
172: * then we need to update the values for the shipment
187: * into multiple shipment_lines (when lpn has 2 lots for eg).
188: * So instead of using shipment_line_id to delete use
189: * shipment_header_id.
190: */
191: IF (g_asn_debug = 'Y') THEN
192: asn_debug.put_line('In insert rcv_lots_supply for source type code INVENTORY or REQ');
193: END IF;
194:
195: OPEN lot_numbers(p_interface_transaction_id);
188: * So instead of using shipment_line_id to delete use
189: * shipment_header_id.
190: */
191: IF (g_asn_debug = 'Y') THEN
192: asn_debug.put_line('In insert rcv_lots_supply for source type code INVENTORY or REQ');
193: END IF;
194:
195: OPEN lot_numbers(p_interface_transaction_id);
196:
193: END IF;
194:
195: OPEN lot_numbers(p_interface_transaction_id);
196:
197: IF (g_asn_debug = 'Y') THEN
198: asn_debug.put_line('Opened lot_numbers cursor');
199: END IF;
200:
201: LOOP --{
194:
195: OPEN lot_numbers(p_interface_transaction_id);
196:
197: IF (g_asn_debug = 'Y') THEN
198: asn_debug.put_line('Opened lot_numbers cursor');
199: END IF;
200:
201: LOOP --{
202: FETCH lot_numbers INTO l_lot_num,
207: l_txn_uom,
208: l_to_org_id;
209: EXIT WHEN lot_numbers%NOTFOUND;
210:
211: IF (g_asn_debug = 'Y') THEN
212: asn_debug.put_line('After fetch');
213: asn_debug.put_line('l_lot_num ' || l_lot_num);
214: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
215: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
208: l_to_org_id;
209: EXIT WHEN lot_numbers%NOTFOUND;
210:
211: IF (g_asn_debug = 'Y') THEN
212: asn_debug.put_line('After fetch');
213: asn_debug.put_line('l_lot_num ' || l_lot_num);
214: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
215: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
216: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
209: EXIT WHEN lot_numbers%NOTFOUND;
210:
211: IF (g_asn_debug = 'Y') THEN
212: asn_debug.put_line('After fetch');
213: asn_debug.put_line('l_lot_num ' || l_lot_num);
214: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
215: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
216: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
217: asn_debug.put_line('l_item_id ' || l_item_id);
210:
211: IF (g_asn_debug = 'Y') THEN
212: asn_debug.put_line('After fetch');
213: asn_debug.put_line('l_lot_num ' || l_lot_num);
214: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
215: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
216: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
217: asn_debug.put_line('l_item_id ' || l_item_id);
218: asn_debug.put_line('l_txn_uom ' || l_txn_uom);
211: IF (g_asn_debug = 'Y') THEN
212: asn_debug.put_line('After fetch');
213: asn_debug.put_line('l_lot_num ' || l_lot_num);
214: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
215: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
216: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
217: asn_debug.put_line('l_item_id ' || l_item_id);
218: asn_debug.put_line('l_txn_uom ' || l_txn_uom);
219: asn_debug.put_line('l_to_org_id ' || l_to_org_id);
212: asn_debug.put_line('After fetch');
213: asn_debug.put_line('l_lot_num ' || l_lot_num);
214: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
215: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
216: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
217: asn_debug.put_line('l_item_id ' || l_item_id);
218: asn_debug.put_line('l_txn_uom ' || l_txn_uom);
219: asn_debug.put_line('l_to_org_id ' || l_to_org_id);
220: END IF;
213: asn_debug.put_line('l_lot_num ' || l_lot_num);
214: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
215: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
216: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
217: asn_debug.put_line('l_item_id ' || l_item_id);
218: asn_debug.put_line('l_txn_uom ' || l_txn_uom);
219: asn_debug.put_line('l_to_org_id ' || l_to_org_id);
220: END IF;
221:
214: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
215: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
216: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
217: asn_debug.put_line('l_item_id ' || l_item_id);
218: asn_debug.put_line('l_txn_uom ' || l_txn_uom);
219: asn_debug.put_line('l_to_org_id ' || l_to_org_id);
220: END IF;
221:
222: SELECT MAX(primary_unit_of_measure)
215: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
216: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
217: asn_debug.put_line('l_item_id ' || l_item_id);
218: asn_debug.put_line('l_txn_uom ' || l_txn_uom);
219: asn_debug.put_line('l_to_org_id ' || l_to_org_id);
220: END IF;
221:
222: SELECT MAX(primary_unit_of_measure)
223: INTO l_primary_uom
224: FROM mtl_system_items
225: WHERE mtl_system_items.inventory_item_id = l_item_id
226: AND mtl_system_items.organization_id = l_to_org_id;
227:
228: IF (g_asn_debug = 'Y') THEN
229: asn_debug.put_line('l_primary_uom ' || l_primary_uom);
230: END IF;
231:
232: /* l_qty_to_be_updated shd be in
225: WHERE mtl_system_items.inventory_item_id = l_item_id
226: AND mtl_system_items.organization_id = l_to_org_id;
227:
228: IF (g_asn_debug = 'Y') THEN
229: asn_debug.put_line('l_primary_uom ' || l_primary_uom);
230: END IF;
231:
232: /* l_qty_to_be_updated shd be in
233: * terms of the parent's uom. For
238: l_shipment_header_id,
239: l_item_id
240: );
241:
242: IF (g_asn_debug = 'Y') THEN
243: asn_debug.put_line('Opened supply_quantity cursor');
244: END IF;
245:
246: LOOP --{
239: l_item_id
240: );
241:
242: IF (g_asn_debug = 'Y') THEN
243: asn_debug.put_line('Opened supply_quantity cursor');
244: END IF;
245:
246: LOOP --{
247: FETCH supply_quantity INTO l_rls_qty,
249: l_ship_line_id;
250: EXIT WHEN supply_quantity%NOTFOUND
251: OR l_primary_qty_to_be_updated = 0;
252:
253: IF (g_asn_debug = 'Y') THEN
254: asn_debug.put_line('l_rls_qty ' || l_rls_qty);
255: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
256: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
257: END IF;
250: EXIT WHEN supply_quantity%NOTFOUND
251: OR l_primary_qty_to_be_updated = 0;
252:
253: IF (g_asn_debug = 'Y') THEN
254: asn_debug.put_line('l_rls_qty ' || l_rls_qty);
255: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
256: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
257: END IF;
258:
251: OR l_primary_qty_to_be_updated = 0;
252:
253: IF (g_asn_debug = 'Y') THEN
254: asn_debug.put_line('l_rls_qty ' || l_rls_qty);
255: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
256: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
257: END IF;
258:
259: SELECT unit_of_measure
252:
253: IF (g_asn_debug = 'Y') THEN
254: asn_debug.put_line('l_rls_qty ' || l_rls_qty);
255: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
256: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
257: END IF;
258:
259: SELECT unit_of_measure
260: INTO l_parent_uom
260: INTO l_parent_uom
261: FROM rcv_shipment_lines
262: WHERE shipment_line_id = l_ship_line_id;
263:
264: IF (g_asn_debug = 'Y') THEN
265: asn_debug.put_line('l_parent_uom ' || l_parent_uom);
266: END IF;
267:
268: IF (l_txn_uom <> l_parent_uom) THEN
261: FROM rcv_shipment_lines
262: WHERE shipment_line_id = l_ship_line_id;
263:
264: IF (g_asn_debug = 'Y') THEN
265: asn_debug.put_line('l_parent_uom ' || l_parent_uom);
266: END IF;
267:
268: IF (l_txn_uom <> l_parent_uom) THEN
269: l_qty_to_be_updated := rcv_transactions_interface_sv.convert_into_correct_qty(l_primary_qty_to_be_updated,
272: l_parent_uom
273: );
274: END IF;
275:
276: IF (g_asn_debug = 'Y') THEN
277: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
278: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
279: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
280: END IF;
273: );
274: END IF;
275:
276: IF (g_asn_debug = 'Y') THEN
277: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
278: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
279: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
280: END IF;
281:
274: END IF;
275:
276: IF (g_asn_debug = 'Y') THEN
277: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
278: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
279: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
280: END IF;
281:
282: IF (l_rls_primary_qty >= l_primary_qty_to_be_updated) THEN --{
275:
276: IF (g_asn_debug = 'Y') THEN
277: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
278: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
279: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
280: END IF;
281:
282: IF (l_rls_primary_qty >= l_primary_qty_to_be_updated) THEN --{
283: IF (g_asn_debug = 'Y') THEN
279: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
280: END IF;
281:
282: IF (l_rls_primary_qty >= l_primary_qty_to_be_updated) THEN --{
283: IF (g_asn_debug = 'Y') THEN
284: asn_debug.put_line('rls primary qty greater');
285: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
286: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
287: asn_debug.put_line('l_lot_num ' || l_lot_num);
280: END IF;
281:
282: IF (l_rls_primary_qty >= l_primary_qty_to_be_updated) THEN --{
283: IF (g_asn_debug = 'Y') THEN
284: asn_debug.put_line('rls primary qty greater');
285: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
286: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
287: asn_debug.put_line('l_lot_num ' || l_lot_num);
288: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
281:
282: IF (l_rls_primary_qty >= l_primary_qty_to_be_updated) THEN --{
283: IF (g_asn_debug = 'Y') THEN
284: asn_debug.put_line('rls primary qty greater');
285: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
286: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
287: asn_debug.put_line('l_lot_num ' || l_lot_num);
288: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
289: END IF;
282: IF (l_rls_primary_qty >= l_primary_qty_to_be_updated) THEN --{
283: IF (g_asn_debug = 'Y') THEN
284: asn_debug.put_line('rls primary qty greater');
285: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
286: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
287: asn_debug.put_line('l_lot_num ' || l_lot_num);
288: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
289: END IF;
290:
283: IF (g_asn_debug = 'Y') THEN
284: asn_debug.put_line('rls primary qty greater');
285: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
286: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
287: asn_debug.put_line('l_lot_num ' || l_lot_num);
288: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
289: END IF;
290:
291: UPDATE rcv_lots_supply rls
284: asn_debug.put_line('rls primary qty greater');
285: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
286: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
287: asn_debug.put_line('l_lot_num ' || l_lot_num);
288: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
289: END IF;
290:
291: UPDATE rcv_lots_supply rls
292: SET quantity = quantity - l_qty_to_be_updated,
297:
298: l_qty_to_be_updated := 0;
299: l_primary_qty_to_be_updated := 0;
300: ELSE --}{
301: IF (g_asn_debug = 'Y') THEN
302: asn_debug.put_line('rls primary qty lesser');
303: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
304: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
305: asn_debug.put_line('l_lot_num ' || l_lot_num);
298: l_qty_to_be_updated := 0;
299: l_primary_qty_to_be_updated := 0;
300: ELSE --}{
301: IF (g_asn_debug = 'Y') THEN
302: asn_debug.put_line('rls primary qty lesser');
303: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
304: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
305: asn_debug.put_line('l_lot_num ' || l_lot_num);
306: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
299: l_primary_qty_to_be_updated := 0;
300: ELSE --}{
301: IF (g_asn_debug = 'Y') THEN
302: asn_debug.put_line('rls primary qty lesser');
303: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
304: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
305: asn_debug.put_line('l_lot_num ' || l_lot_num);
306: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
307: END IF;
300: ELSE --}{
301: IF (g_asn_debug = 'Y') THEN
302: asn_debug.put_line('rls primary qty lesser');
303: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
304: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
305: asn_debug.put_line('l_lot_num ' || l_lot_num);
306: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
307: END IF;
308:
301: IF (g_asn_debug = 'Y') THEN
302: asn_debug.put_line('rls primary qty lesser');
303: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
304: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
305: asn_debug.put_line('l_lot_num ' || l_lot_num);
306: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
307: END IF;
308:
309: UPDATE rcv_lots_supply rls
302: asn_debug.put_line('rls primary qty lesser');
303: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
304: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
305: asn_debug.put_line('l_lot_num ' || l_lot_num);
306: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
307: END IF;
308:
309: UPDATE rcv_lots_supply rls
310: SET quantity = 0,
315:
316: l_qty_to_be_updated := l_qty_to_be_updated - l_rls_qty;
317: l_primary_qty_to_be_updated := l_primary_qty_to_be_updated - l_rls_primary_qty;
318:
319: IF (g_asn_debug = 'Y') THEN
320: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
321: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
322: END IF;
323: END IF; --}
316: l_qty_to_be_updated := l_qty_to_be_updated - l_rls_qty;
317: l_primary_qty_to_be_updated := l_primary_qty_to_be_updated - l_rls_primary_qty;
318:
319: IF (g_asn_debug = 'Y') THEN
320: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
321: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
322: END IF;
323: END IF; --}
324: END LOOP; --}
317: l_primary_qty_to_be_updated := l_primary_qty_to_be_updated - l_rls_primary_qty;
318:
319: IF (g_asn_debug = 'Y') THEN
320: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
321: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
322: END IF;
323: END IF; --}
324: END LOOP; --}
325:
324: END LOOP; --}
325:
326: CLOSE supply_quantity;
327:
328: IF (g_asn_debug = 'Y') THEN
329: asn_debug.put_line('Close supply_quantity ');
330: END IF;
331: END LOOP; --}
332:
325:
326: CLOSE supply_quantity;
327:
328: IF (g_asn_debug = 'Y') THEN
329: asn_debug.put_line('Close supply_quantity ');
330: END IF;
331: END LOOP; --}
332:
333: CLOSE lot_numbers;
331: END LOOP; --}
332:
333: CLOSE lot_numbers;
334:
335: IF (g_asn_debug = 'Y') THEN
336: asn_debug.put_line('Close lot_numbers cursor for source type code INVENTORY or REQ');
337: END IF;
338: END IF; --}
339: /* END IF; */
332:
333: CLOSE lot_numbers;
334:
335: IF (g_asn_debug = 'Y') THEN
336: asn_debug.put_line('Close lot_numbers cursor for source type code INVENTORY or REQ');
337: END IF;
338: END IF; --}
339: /* END IF; */
340:
337: END IF;
338: END IF; --}
339: /* END IF; */
340:
341: IF (g_asn_debug = 'Y') THEN
342: asn_debug.put_line('Exit insert_rcv_lots_supply');
343: END IF;
344: EXCEPTION
345: WHEN NO_DATA_FOUND THEN
338: END IF; --}
339: /* END IF; */
340:
341: IF (g_asn_debug = 'Y') THEN
342: asn_debug.put_line('Exit insert_rcv_lots_supply');
343: END IF;
344: EXCEPTION
345: WHEN NO_DATA_FOUND THEN
346: IF (g_asn_debug = 'Y') THEN
342: asn_debug.put_line('Exit insert_rcv_lots_supply');
343: END IF;
344: EXCEPTION
345: WHEN NO_DATA_FOUND THEN
346: IF (g_asn_debug = 'Y') THEN
347: asn_debug.put_line('no_data_found insert_rcv_lots_supply');
348: END IF;
349:
350: x_return_status := fnd_api.g_ret_sts_error;
343: END IF;
344: EXCEPTION
345: WHEN NO_DATA_FOUND THEN
346: IF (g_asn_debug = 'Y') THEN
347: asn_debug.put_line('no_data_found insert_rcv_lots_supply');
348: END IF;
349:
350: x_return_status := fnd_api.g_ret_sts_error;
351:
379: rti.program_update_date
380: FROM rcv_transactions_interface rti
381: WHERE rti.interface_transaction_id = p_interface_transaction_id;
382: WHEN OTHERS THEN
383: IF (g_asn_debug = 'Y') THEN
384: asn_debug.put_line('others insert_rcv_lots_supply');
385: END IF;
386:
387: x_return_status := fnd_api.g_ret_sts_unexp_error;
380: FROM rcv_transactions_interface rti
381: WHERE rti.interface_transaction_id = p_interface_transaction_id;
382: WHEN OTHERS THEN
383: IF (g_asn_debug = 'Y') THEN
384: asn_debug.put_line('others insert_rcv_lots_supply');
385: END IF;
386:
387: x_return_status := fnd_api.g_ret_sts_unexp_error;
388:
458: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
459: l_shipment_header_id rcv_shipment_headers.shipment_header_id%TYPE;
460: l_item_id rcv_transactions_interface.item_id%TYPE;
461: BEGIN
462: IF (g_asn_debug = 'Y') THEN
463: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
464: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
465: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
466: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
459: l_shipment_header_id rcv_shipment_headers.shipment_header_id%TYPE;
460: l_item_id rcv_transactions_interface.item_id%TYPE;
461: BEGIN
462: IF (g_asn_debug = 'Y') THEN
463: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
464: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
465: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
466: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
467: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
460: l_item_id rcv_transactions_interface.item_id%TYPE;
461: BEGIN
462: IF (g_asn_debug = 'Y') THEN
463: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
464: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
465: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
466: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
467: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
468: END IF;
461: BEGIN
462: IF (g_asn_debug = 'Y') THEN
463: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
464: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
465: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
466: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
467: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
468: END IF;
469:
462: IF (g_asn_debug = 'Y') THEN
463: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
464: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
465: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
466: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
467: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
468: END IF;
469:
470: x_return_status := fnd_api.g_ret_sts_success;
463: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
464: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
465: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
466: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
467: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
468: END IF;
469:
470: x_return_status := fnd_api.g_ret_sts_success;
471:
483: IF (l_serial_count = 0) THEN
484: RETURN;
485: END IF;
486:
487: IF (g_asn_debug = 'Y') THEN
488: asn_debug.put_line('l_serial_count ' || l_serial_count);
489: END IF;
490:
491: /* We need to insert into rcv_lots_supply and
484: RETURN;
485: END IF;
486:
487: IF (g_asn_debug = 'Y') THEN
488: asn_debug.put_line('l_serial_count ' || l_serial_count);
489: END IF;
490:
491: /* We need to insert into rcv_lots_supply and
492: * rcv_serials_supply table only when we come through ROI
508: AND l_lpn_id = -999) THEN
509: RETURN;
510: END IF;
511:
512: IF (g_asn_debug = 'Y') THEN
513: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
514: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
515: END IF;
516:
509: RETURN;
510: END IF;
511:
512: IF (g_asn_debug = 'Y') THEN
513: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
514: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
515: END IF;
516:
517: OPEN select_serials(p_interface_transaction_id);
510: END IF;
511:
512: IF (g_asn_debug = 'Y') THEN
513: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
514: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
515: END IF;
516:
517: OPEN select_serials(p_interface_transaction_id);
518:
560: INTO l_transaction_id
561: FROM rcv_transactions rt
562: WHERE rt.interface_transaction_id = p_interface_transaction_id;
563:
564: IF (g_asn_debug = 'Y') THEN
565: asn_debug.put_line('l_range_numbers ' || l_range_numbers);
566: asn_debug.put_line('l_serial_num_length ' || l_serial_num_length);
567: asn_debug.put_line('l_prefix_length ' || l_prefix_length);
568: asn_debug.put_line('l_serial_suffix_length ' || l_serial_suffix_length);
561: FROM rcv_transactions rt
562: WHERE rt.interface_transaction_id = p_interface_transaction_id;
563:
564: IF (g_asn_debug = 'Y') THEN
565: asn_debug.put_line('l_range_numbers ' || l_range_numbers);
566: asn_debug.put_line('l_serial_num_length ' || l_serial_num_length);
567: asn_debug.put_line('l_prefix_length ' || l_prefix_length);
568: asn_debug.put_line('l_serial_suffix_length ' || l_serial_suffix_length);
569: END IF;
562: WHERE rt.interface_transaction_id = p_interface_transaction_id;
563:
564: IF (g_asn_debug = 'Y') THEN
565: asn_debug.put_line('l_range_numbers ' || l_range_numbers);
566: asn_debug.put_line('l_serial_num_length ' || l_serial_num_length);
567: asn_debug.put_line('l_prefix_length ' || l_prefix_length);
568: asn_debug.put_line('l_serial_suffix_length ' || l_serial_suffix_length);
569: END IF;
570:
563:
564: IF (g_asn_debug = 'Y') THEN
565: asn_debug.put_line('l_range_numbers ' || l_range_numbers);
566: asn_debug.put_line('l_serial_num_length ' || l_serial_num_length);
567: asn_debug.put_line('l_prefix_length ' || l_prefix_length);
568: asn_debug.put_line('l_serial_suffix_length ' || l_serial_suffix_length);
569: END IF;
570:
571: FOR i IN 1 .. l_range_numbers LOOP --{
564: IF (g_asn_debug = 'Y') THEN
565: asn_debug.put_line('l_range_numbers ' || l_range_numbers);
566: asn_debug.put_line('l_serial_num_length ' || l_serial_num_length);
567: asn_debug.put_line('l_prefix_length ' || l_prefix_length);
568: asn_debug.put_line('l_serial_suffix_length ' || l_serial_suffix_length);
569: END IF;
570:
571: FOR i IN 1 .. l_range_numbers LOOP --{
572: l_cur_serial_numeric := l_from_serial_number + i - 1;
575: l_serial_suffix_length,
576: '0'
577: );
578:
579: IF (g_asn_debug = 'Y') THEN
580: asn_debug.put_line('l_serial_prefix ' || l_serial_prefix);
581: asn_debug.put_line('l_cur_serial_numeric ' || l_cur_serial_numeric);
582: asn_debug.put_line('l_serial_suffix_length ' || l_serial_suffix_length);
583: asn_debug.put_line('l_cur_serial_number ' || l_serial_suffix_length);
576: '0'
577: );
578:
579: IF (g_asn_debug = 'Y') THEN
580: asn_debug.put_line('l_serial_prefix ' || l_serial_prefix);
581: asn_debug.put_line('l_cur_serial_numeric ' || l_cur_serial_numeric);
582: asn_debug.put_line('l_serial_suffix_length ' || l_serial_suffix_length);
583: asn_debug.put_line('l_cur_serial_number ' || l_serial_suffix_length);
584: END IF;
577: );
578:
579: IF (g_asn_debug = 'Y') THEN
580: asn_debug.put_line('l_serial_prefix ' || l_serial_prefix);
581: asn_debug.put_line('l_cur_serial_numeric ' || l_cur_serial_numeric);
582: asn_debug.put_line('l_serial_suffix_length ' || l_serial_suffix_length);
583: asn_debug.put_line('l_cur_serial_number ' || l_serial_suffix_length);
584: END IF;
585:
578:
579: IF (g_asn_debug = 'Y') THEN
580: asn_debug.put_line('l_serial_prefix ' || l_serial_prefix);
581: asn_debug.put_line('l_cur_serial_numeric ' || l_cur_serial_numeric);
582: asn_debug.put_line('l_serial_suffix_length ' || l_serial_suffix_length);
583: asn_debug.put_line('l_cur_serial_number ' || l_serial_suffix_length);
584: END IF;
585:
586: insert_serial_supply(p_interface_transaction_id,
579: IF (g_asn_debug = 'Y') THEN
580: asn_debug.put_line('l_serial_prefix ' || l_serial_prefix);
581: asn_debug.put_line('l_cur_serial_numeric ' || l_cur_serial_numeric);
582: asn_debug.put_line('l_serial_suffix_length ' || l_serial_suffix_length);
583: asn_debug.put_line('l_cur_serial_number ' || l_serial_suffix_length);
584: END IF;
585:
586: insert_serial_supply(p_interface_transaction_id,
587: l_select_serials.lot_number,
590: p_supply_source_id,
591: x_return_status
592: );
593:
594: IF (g_asn_debug = 'Y') THEN
595: asn_debug.put_line('After insert_serial_supply ');
596: END IF;
597: END LOOP; --}
598:
591: x_return_status
592: );
593:
594: IF (g_asn_debug = 'Y') THEN
595: asn_debug.put_line('After insert_serial_supply ');
596: END IF;
597: END LOOP; --}
598:
599: IF (g_asn_debug = 'Y') THEN
595: asn_debug.put_line('After insert_serial_supply ');
596: END IF;
597: END LOOP; --}
598:
599: IF (g_asn_debug = 'Y') THEN
600: asn_debug.put_line('l_delete_shipment_supply ' || l_delete_shipment_supply);
601: END IF;
602:
603: IF (l_delete_shipment_supply = 'Y') THEN
596: END IF;
597: END LOOP; --}
598:
599: IF (g_asn_debug = 'Y') THEN
600: asn_debug.put_line('l_delete_shipment_supply ' || l_delete_shipment_supply);
601: END IF;
602:
603: IF (l_delete_shipment_supply = 'Y') THEN
604: SELECT shipment_header_id,
634: END LOOP; --}
635:
636: CLOSE select_serials;
637:
638: IF (g_asn_debug = 'Y') THEN
639: asn_debug.put_line('Exit insert_rcv_serials_supply ');
640: END IF;
641: EXCEPTION
642: WHEN NO_DATA_FOUND THEN
635:
636: CLOSE select_serials;
637:
638: IF (g_asn_debug = 'Y') THEN
639: asn_debug.put_line('Exit insert_rcv_serials_supply ');
640: END IF;
641: EXCEPTION
642: WHEN NO_DATA_FOUND THEN
643: IF (g_asn_debug = 'Y') THEN
639: asn_debug.put_line('Exit insert_rcv_serials_supply ');
640: END IF;
641: EXCEPTION
642: WHEN NO_DATA_FOUND THEN
643: IF (g_asn_debug = 'Y') THEN
644: asn_debug.put_line('no_data_found insert_rcv_serials_supply ');
645: END IF;
646:
647: x_return_status := fnd_api.g_ret_sts_error;
640: END IF;
641: EXCEPTION
642: WHEN NO_DATA_FOUND THEN
643: IF (g_asn_debug = 'Y') THEN
644: asn_debug.put_line('no_data_found insert_rcv_serials_supply ');
645: END IF;
646:
647: x_return_status := fnd_api.g_ret_sts_error;
648:
676: rti.program_update_date
677: FROM rcv_transactions_interface rti
678: WHERE rti.interface_transaction_id = p_interface_transaction_id;
679: WHEN OTHERS THEN
680: IF (g_asn_debug = 'Y') THEN
681: asn_debug.put_line('others insert_rcv_serials_supply ');
682: END IF;
683:
684: x_return_status := fnd_api.g_ret_sts_unexp_error;
677: FROM rcv_transactions_interface rti
678: WHERE rti.interface_transaction_id = p_interface_transaction_id;
679: WHEN OTHERS THEN
680: IF (g_asn_debug = 'Y') THEN
681: asn_debug.put_line('others insert_rcv_serials_supply ');
682: END IF;
683:
684: x_return_status := fnd_api.g_ret_sts_unexp_error;
685:
874: l_txn_uom VARCHAR2(25);
875: l_primary_uom VARCHAR2(25);
876: l_to_org_id NUMBER;
877: BEGIN
878: IF (g_asn_debug = 'Y') THEN
879: asn_debug.put_line('Enter update_rcv_lots_supply ');
880: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
881: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
882: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
875: l_primary_uom VARCHAR2(25);
876: l_to_org_id NUMBER;
877: BEGIN
878: IF (g_asn_debug = 'Y') THEN
879: asn_debug.put_line('Enter update_rcv_lots_supply ');
880: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
881: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
882: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
883: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
876: l_to_org_id NUMBER;
877: BEGIN
878: IF (g_asn_debug = 'Y') THEN
879: asn_debug.put_line('Enter update_rcv_lots_supply ');
880: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
881: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
882: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
883: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
884: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
877: BEGIN
878: IF (g_asn_debug = 'Y') THEN
879: asn_debug.put_line('Enter update_rcv_lots_supply ');
880: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
881: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
882: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
883: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
884: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
885: asn_debug.put_line('p_correction_type ' || p_correction_type);
878: IF (g_asn_debug = 'Y') THEN
879: asn_debug.put_line('Enter update_rcv_lots_supply ');
880: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
881: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
882: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
883: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
884: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
885: asn_debug.put_line('p_correction_type ' || p_correction_type);
886: END IF;
879: asn_debug.put_line('Enter update_rcv_lots_supply ');
880: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
881: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
882: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
883: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
884: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
885: asn_debug.put_line('p_correction_type ' || p_correction_type);
886: END IF;
887:
880: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
881: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
882: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
883: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
884: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
885: asn_debug.put_line('p_correction_type ' || p_correction_type);
886: END IF;
887:
888: x_return_status := fnd_api.g_ret_sts_success;
881: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
882: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
883: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
884: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
885: asn_debug.put_line('p_correction_type ' || p_correction_type);
886: END IF;
887:
888: x_return_status := fnd_api.g_ret_sts_success;
889:
901: IF (l_lot_count = 0) THEN
902: RETURN;
903: END IF;
904:
905: IF (g_asn_debug = 'Y') THEN
906: asn_debug.put_line('l_lot_count ' || l_lot_count);
907: END IF;
908:
909: /* We need to insert into rcv_lots_supply and
902: RETURN;
903: END IF;
904:
905: IF (g_asn_debug = 'Y') THEN
906: asn_debug.put_line('l_lot_count ' || l_lot_count);
907: END IF;
908:
909: /* We need to insert into rcv_lots_supply and
910: * rcv_serials_supply table only when we come through ROI
926: AND l_lpn_id = -999) THEN
927: RETURN;
928: END IF;
929:
930: IF (g_asn_debug = 'Y') THEN
931: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
932: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
933: END IF;
934:
927: RETURN;
928: END IF;
929:
930: IF (g_asn_debug = 'Y') THEN
931: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
932: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
933: END IF;
934:
935: /* When we update rcv_supply, we call this procedure and set
928: END IF;
929:
930: IF (g_asn_debug = 'Y') THEN
931: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
932: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
933: END IF;
934:
935: /* When we update rcv_supply, we call this procedure and set
936: * the p_correction_type depending upon whether we need to add
955: IF (l_count = 0) THEN
956: RETURN;
957: END IF;
958:
959: IF (g_asn_debug = 'Y') THEN
960: asn_debug.put_line('l_count ' || l_count);
961: END IF;
962:
963: SELECT transaction_type,
956: RETURN;
957: END IF;
958:
959: IF (g_asn_debug = 'Y') THEN
960: asn_debug.put_line('l_count ' || l_count);
961: END IF;
962:
963: SELECT transaction_type,
964: organization_id,
983: l_update_shipment_supply := 'Y';
984: END IF; --}
985: /* END IF; */
986:
987: IF (g_asn_debug = 'Y') THEN
988: asn_debug.put_line('l_update_shipment_supply ' || l_update_shipment_supply);
989: asn_debug.put_line(' INVCONV , Update shipment supply for OPM transactions also.');
990: END IF;
991:
984: END IF; --}
985: /* END IF; */
986:
987: IF (g_asn_debug = 'Y') THEN
988: asn_debug.put_line('l_update_shipment_supply ' || l_update_shipment_supply);
989: asn_debug.put_line(' INVCONV , Update shipment supply for OPM transactions also.');
990: END IF;
991:
992: OPEN lot_cursor(p_interface_transaction_id);
985: /* END IF; */
986:
987: IF (g_asn_debug = 'Y') THEN
988: asn_debug.put_line('l_update_shipment_supply ' || l_update_shipment_supply);
989: asn_debug.put_line(' INVCONV , Update shipment supply for OPM transactions also.');
990: END IF;
991:
992: OPEN lot_cursor(p_interface_transaction_id);
993:
1004: l_txn_uom,
1005: l_to_org_id;
1006: EXIT WHEN lot_cursor%NOTFOUND;
1007:
1008: IF (g_asn_debug = 'Y') THEN
1009: asn_debug.put_line('Opened lot_cursor ');
1010: asn_debug.put_line('l_lot_num ' || l_lot_num);
1011: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply1 ');
1012: /*INVCONV*/
1005: l_to_org_id;
1006: EXIT WHEN lot_cursor%NOTFOUND;
1007:
1008: IF (g_asn_debug = 'Y') THEN
1009: asn_debug.put_line('Opened lot_cursor ');
1010: asn_debug.put_line('l_lot_num ' || l_lot_num);
1011: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply1 ');
1012: /*INVCONV*/
1013: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1006: EXIT WHEN lot_cursor%NOTFOUND;
1007:
1008: IF (g_asn_debug = 'Y') THEN
1009: asn_debug.put_line('Opened lot_cursor ');
1010: asn_debug.put_line('l_lot_num ' || l_lot_num);
1011: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply1 ');
1012: /*INVCONV*/
1013: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1014: /*end , INVCONV*/
1007:
1008: IF (g_asn_debug = 'Y') THEN
1009: asn_debug.put_line('Opened lot_cursor ');
1010: asn_debug.put_line('l_lot_num ' || l_lot_num);
1011: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply1 ');
1012: /*INVCONV*/
1013: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1014: /*end , INVCONV*/
1015: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1009: asn_debug.put_line('Opened lot_cursor ');
1010: asn_debug.put_line('l_lot_num ' || l_lot_num);
1011: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply1 ');
1012: /*INVCONV*/
1013: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1014: /*end , INVCONV*/
1015: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1016: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1017: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1011: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply1 ');
1012: /*INVCONV*/
1013: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1014: /*end , INVCONV*/
1015: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1016: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1017: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1018: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
1019: asn_debug.put_line('l_item_id ' || l_item_id);
1012: /*INVCONV*/
1013: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1014: /*end , INVCONV*/
1015: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1016: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1017: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1018: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
1019: asn_debug.put_line('l_item_id ' || l_item_id);
1020: asn_debug.put_line('l_txn_uom, ' || l_txn_uom);
1013: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1014: /*end , INVCONV*/
1015: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1016: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1017: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1018: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
1019: asn_debug.put_line('l_item_id ' || l_item_id);
1020: asn_debug.put_line('l_txn_uom, ' || l_txn_uom);
1021: asn_debug.put_line('l_to_org_id ' || l_to_org_id);
1014: /*end , INVCONV*/
1015: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1016: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1017: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1018: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
1019: asn_debug.put_line('l_item_id ' || l_item_id);
1020: asn_debug.put_line('l_txn_uom, ' || l_txn_uom);
1021: asn_debug.put_line('l_to_org_id ' || l_to_org_id);
1022: END IF;
1015: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1016: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1017: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1018: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
1019: asn_debug.put_line('l_item_id ' || l_item_id);
1020: asn_debug.put_line('l_txn_uom, ' || l_txn_uom);
1021: asn_debug.put_line('l_to_org_id ' || l_to_org_id);
1022: END IF;
1023:
1016: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1017: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1018: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
1019: asn_debug.put_line('l_item_id ' || l_item_id);
1020: asn_debug.put_line('l_txn_uom, ' || l_txn_uom);
1021: asn_debug.put_line('l_to_org_id ' || l_to_org_id);
1022: END IF;
1023:
1024: /* If there is already a row existing for this lot_num, update
1017: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1018: asn_debug.put_line('l_shipment_header_id ' || l_shipment_header_id);
1019: asn_debug.put_line('l_item_id ' || l_item_id);
1020: asn_debug.put_line('l_txn_uom, ' || l_txn_uom);
1021: asn_debug.put_line('l_to_org_id ' || l_to_org_id);
1022: END IF;
1023:
1024: /* If there is already a row existing for this lot_num, update
1025: * the quantity. Else insert a new one since this might be a
1043: */
1044: /*end , INVCONV*/
1045: AND supply_type_code = 'RECEIVING';
1046:
1047: IF (g_asn_debug = 'Y') THEN
1048: asn_debug.put_line('l_count1 ' || l_count1);
1049: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply2 ');
1050: END IF;
1051:
1044: /*end , INVCONV*/
1045: AND supply_type_code = 'RECEIVING';
1046:
1047: IF (g_asn_debug = 'Y') THEN
1048: asn_debug.put_line('l_count1 ' || l_count1);
1049: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply2 ');
1050: END IF;
1051:
1052: IF (l_count1 = 0) THEN --{
1045: AND supply_type_code = 'RECEIVING';
1046:
1047: IF (g_asn_debug = 'Y') THEN
1048: asn_debug.put_line('l_count1 ' || l_count1);
1049: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply2 ');
1050: END IF;
1051:
1052: IF (l_count1 = 0) THEN --{
1053: IF (g_asn_debug = 'Y') THEN
1049: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply2 ');
1050: END IF;
1051:
1052: IF (l_count1 = 0) THEN --{
1053: IF (g_asn_debug = 'Y') THEN
1054: asn_debug.put_line('Before insert_lot_supply ' || l_count1);
1055: END IF;
1056:
1057: insert_lot_supply(p_interface_transaction_id,
1050: END IF;
1051:
1052: IF (l_count1 = 0) THEN --{
1053: IF (g_asn_debug = 'Y') THEN
1054: asn_debug.put_line('Before insert_lot_supply ' || l_count1);
1055: END IF;
1056:
1057: insert_lot_supply(p_interface_transaction_id,
1058: 'RECEIVING',
1059: p_parent_supply_id,
1060: x_return_status
1061: );
1062:
1063: IF (g_asn_debug = 'Y') THEN
1064: asn_debug.put_line('After insert_lot_supply ' || l_count1);
1065: END IF;
1066: ELSE --}{
1067: /** OPM Change Bug# 3061052 add sublot_num check **/
1060: x_return_status
1061: );
1062:
1063: IF (g_asn_debug = 'Y') THEN
1064: asn_debug.put_line('After insert_lot_supply ' || l_count1);
1065: END IF;
1066: ELSE --}{
1067: /** OPM Change Bug# 3061052 add sublot_num check **/
1068: IF (g_asn_debug = 'Y') THEN
1064: asn_debug.put_line('After insert_lot_supply ' || l_count1);
1065: END IF;
1066: ELSE --}{
1067: /** OPM Change Bug# 3061052 add sublot_num check **/
1068: IF (g_asn_debug = 'Y') THEN
1069: asn_debug.put_line('Else update rcv_lots_supply');
1070: END IF;
1071:
1072: SELECT MAX(primary_unit_of_measure)
1065: END IF;
1066: ELSE --}{
1067: /** OPM Change Bug# 3061052 add sublot_num check **/
1068: IF (g_asn_debug = 'Y') THEN
1069: asn_debug.put_line('Else update rcv_lots_supply');
1070: END IF;
1071:
1072: SELECT MAX(primary_unit_of_measure)
1073: INTO l_primary_uom
1074: FROM mtl_system_items
1075: WHERE mtl_system_items.inventory_item_id = l_item_id
1076: AND mtl_system_items.organization_id = l_to_org_id;
1077:
1078: IF (g_asn_debug = 'Y') THEN
1079: asn_debug.put_line('l_primary_uom ' || l_primary_uom);
1080: END IF;
1081:
1082: /* l_qty_to_be_updated shd be in
1075: WHERE mtl_system_items.inventory_item_id = l_item_id
1076: AND mtl_system_items.organization_id = l_to_org_id;
1077:
1078: IF (g_asn_debug = 'Y') THEN
1079: asn_debug.put_line('l_primary_uom ' || l_primary_uom);
1080: END IF;
1081:
1082: /* l_qty_to_be_updated shd be in
1083: * terms of the parent's uom. For
1091: l_parent_uom
1092: );
1093: END IF;
1094:
1095: IF (g_asn_debug = 'Y') THEN
1096: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1097: asn_debug.put_line('l_factor ' || l_factor);
1098: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1099: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1092: );
1093: END IF;
1094:
1095: IF (g_asn_debug = 'Y') THEN
1096: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1097: asn_debug.put_line('l_factor ' || l_factor);
1098: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1099: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1100: asn_debug.put_line('l_lot_num ' || l_lot_num);
1093: END IF;
1094:
1095: IF (g_asn_debug = 'Y') THEN
1096: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1097: asn_debug.put_line('l_factor ' || l_factor);
1098: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1099: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1100: asn_debug.put_line('l_lot_num ' || l_lot_num);
1101: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1094:
1095: IF (g_asn_debug = 'Y') THEN
1096: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1097: asn_debug.put_line('l_factor ' || l_factor);
1098: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1099: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1100: asn_debug.put_line('l_lot_num ' || l_lot_num);
1101: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1102: /* INVCONV*/
1095: IF (g_asn_debug = 'Y') THEN
1096: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1097: asn_debug.put_line('l_factor ' || l_factor);
1098: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1099: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1100: asn_debug.put_line('l_lot_num ' || l_lot_num);
1101: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1102: /* INVCONV*/
1103: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1096: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1097: asn_debug.put_line('l_factor ' || l_factor);
1098: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1099: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1100: asn_debug.put_line('l_lot_num ' || l_lot_num);
1101: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1102: /* INVCONV*/
1103: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1104: /*end , INVCONV*/
1097: asn_debug.put_line('l_factor ' || l_factor);
1098: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1099: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1100: asn_debug.put_line('l_lot_num ' || l_lot_num);
1101: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1102: /* INVCONV*/
1103: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1104: /*end , INVCONV*/
1105: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply3 ');
1099: asn_debug.put_line('l_secondary_qty_to_be_updated ' || l_secondary_qty_to_be_updated);
1100: asn_debug.put_line('l_lot_num ' || l_lot_num);
1101: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1102: /* INVCONV*/
1103: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1104: /*end , INVCONV*/
1105: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply3 ');
1106: END IF;
1107:
1101: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1102: /* INVCONV*/
1103: /* asn_debug.put_line('l_sublot_num ' || l_sublot_num); */
1104: /*end , INVCONV*/
1105: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply3 ');
1106: END IF;
1107:
1108: /* INVCONV , Remove sublot_num. Punit Kumar */
1109:
1123: /* end , INVCONV */
1124:
1125: END IF; --}
1126:
1127: IF (g_asn_debug = 'Y') THEN
1128: asn_debug.put_line('l_update_shipment_supply ' || l_update_shipment_supply);
1129: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply4 ');
1130: END IF;
1131:
1124:
1125: END IF; --}
1126:
1127: IF (g_asn_debug = 'Y') THEN
1128: asn_debug.put_line('l_update_shipment_supply ' || l_update_shipment_supply);
1129: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply4 ');
1130: END IF;
1131:
1132: IF (l_update_shipment_supply = 'Y') THEN --{
1125: END IF; --}
1126:
1127: IF (g_asn_debug = 'Y') THEN
1128: asn_debug.put_line('l_update_shipment_supply ' || l_update_shipment_supply);
1129: asn_debug.put_line('INVCONV, Subllot_num has been removed in update_lot_supply4 ');
1130: END IF;
1131:
1132: IF (l_update_shipment_supply = 'Y') THEN --{
1133: SELECT COUNT(*)
1136: WHERE shipment_line_id = p_shipment_line_id
1137: AND supply_type_code = 'SHIPMENT'
1138: AND lot_num = l_lot_num;
1139:
1140: IF (g_asn_debug = 'Y') THEN
1141: asn_debug.put_line('l_count2 ' || l_count2);
1142: END IF;
1143:
1144: /* If correction type is positive, then there would
1137: AND supply_type_code = 'SHIPMENT'
1138: AND lot_num = l_lot_num;
1139:
1140: IF (g_asn_debug = 'Y') THEN
1141: asn_debug.put_line('l_count2 ' || l_count2);
1142: END IF;
1143:
1144: /* If correction type is positive, then there would
1145: * definitely be a row for shipment supply else we will
1178: l_shipment_header_id,
1179: l_item_id
1180: );
1181:
1182: IF (g_asn_debug = 'Y') THEN
1183: asn_debug.put_line('Opened shipment_supply_quantity ');
1184: END IF;
1185:
1186: LOOP --{
1179: l_item_id
1180: );
1181:
1182: IF (g_asn_debug = 'Y') THEN
1183: asn_debug.put_line('Opened shipment_supply_quantity ');
1184: END IF;
1185:
1186: LOOP --{
1187: FETCH shipment_supply_quantity INTO l_rls_qty,
1189: l_ship_line_id;
1190: EXIT WHEN shipment_supply_quantity%NOTFOUND
1191: OR l_primary_qty_to_be_updated = 0;
1192:
1193: IF (g_asn_debug = 'Y') THEN
1194: asn_debug.put_line('l_rls_qty ' || l_rls_qty);
1195: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
1196: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1197: END IF;
1190: EXIT WHEN shipment_supply_quantity%NOTFOUND
1191: OR l_primary_qty_to_be_updated = 0;
1192:
1193: IF (g_asn_debug = 'Y') THEN
1194: asn_debug.put_line('l_rls_qty ' || l_rls_qty);
1195: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
1196: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1197: END IF;
1198:
1191: OR l_primary_qty_to_be_updated = 0;
1192:
1193: IF (g_asn_debug = 'Y') THEN
1194: asn_debug.put_line('l_rls_qty ' || l_rls_qty);
1195: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
1196: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1197: END IF;
1198:
1199: SELECT unit_of_measure
1192:
1193: IF (g_asn_debug = 'Y') THEN
1194: asn_debug.put_line('l_rls_qty ' || l_rls_qty);
1195: asn_debug.put_line('l_rls_primary_qty ' || l_rls_primary_qty);
1196: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1197: END IF;
1198:
1199: SELECT unit_of_measure
1200: INTO l_parent_uom
1200: INTO l_parent_uom
1201: FROM rcv_shipment_lines
1202: WHERE shipment_line_id = l_ship_line_id;
1203:
1204: IF (g_asn_debug = 'Y') THEN
1205: asn_debug.put_line('l_parent_uom ' || l_parent_uom);
1206: END IF;
1207:
1208: IF (l_txn_uom <> l_parent_uom) THEN
1201: FROM rcv_shipment_lines
1202: WHERE shipment_line_id = l_ship_line_id;
1203:
1204: IF (g_asn_debug = 'Y') THEN
1205: asn_debug.put_line('l_parent_uom ' || l_parent_uom);
1206: END IF;
1207:
1208: IF (l_txn_uom <> l_parent_uom) THEN
1209: l_qty_to_be_updated := rcv_transactions_interface_sv.convert_into_correct_qty(l_primary_qty_to_be_updated,
1213: );
1214: END IF;
1215:
1216: IF (l_rls_primary_qty >= l_primary_qty_to_be_updated) THEN --{
1217: IF (g_asn_debug = 'Y') THEN
1218: asn_debug.put_line('rls_primary_qty is greater ');
1219: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1220: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1221: asn_debug.put_line('l_lot_num ' || l_lot_num);
1214: END IF;
1215:
1216: IF (l_rls_primary_qty >= l_primary_qty_to_be_updated) THEN --{
1217: IF (g_asn_debug = 'Y') THEN
1218: asn_debug.put_line('rls_primary_qty is greater ');
1219: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1220: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1221: asn_debug.put_line('l_lot_num ' || l_lot_num);
1222: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1215:
1216: IF (l_rls_primary_qty >= l_primary_qty_to_be_updated) THEN --{
1217: IF (g_asn_debug = 'Y') THEN
1218: asn_debug.put_line('rls_primary_qty is greater ');
1219: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1220: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1221: asn_debug.put_line('l_lot_num ' || l_lot_num);
1222: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1223: END IF;
1216: IF (l_rls_primary_qty >= l_primary_qty_to_be_updated) THEN --{
1217: IF (g_asn_debug = 'Y') THEN
1218: asn_debug.put_line('rls_primary_qty is greater ');
1219: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1220: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1221: asn_debug.put_line('l_lot_num ' || l_lot_num);
1222: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1223: END IF;
1224:
1217: IF (g_asn_debug = 'Y') THEN
1218: asn_debug.put_line('rls_primary_qty is greater ');
1219: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1220: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1221: asn_debug.put_line('l_lot_num ' || l_lot_num);
1222: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1223: END IF;
1224:
1225: UPDATE rcv_lots_supply rls
1218: asn_debug.put_line('rls_primary_qty is greater ');
1219: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1220: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1221: asn_debug.put_line('l_lot_num ' || l_lot_num);
1222: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1223: END IF;
1224:
1225: UPDATE rcv_lots_supply rls
1226: SET quantity = quantity -(l_qty_to_be_updated * l_factor),
1231:
1232: l_qty_to_be_updated := 0;
1233: l_primary_qty_to_be_updated := 0;
1234: ELSE --}{
1235: IF (g_asn_debug = 'Y') THEN
1236: asn_debug.put_line('rls_primary_qty is lesser ');
1237: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1238: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1239: asn_debug.put_line('l_lot_num ' || l_lot_num);
1232: l_qty_to_be_updated := 0;
1233: l_primary_qty_to_be_updated := 0;
1234: ELSE --}{
1235: IF (g_asn_debug = 'Y') THEN
1236: asn_debug.put_line('rls_primary_qty is lesser ');
1237: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1238: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1239: asn_debug.put_line('l_lot_num ' || l_lot_num);
1240: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1233: l_primary_qty_to_be_updated := 0;
1234: ELSE --}{
1235: IF (g_asn_debug = 'Y') THEN
1236: asn_debug.put_line('rls_primary_qty is lesser ');
1237: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1238: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1239: asn_debug.put_line('l_lot_num ' || l_lot_num);
1240: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1241: END IF;
1234: ELSE --}{
1235: IF (g_asn_debug = 'Y') THEN
1236: asn_debug.put_line('rls_primary_qty is lesser ');
1237: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1238: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1239: asn_debug.put_line('l_lot_num ' || l_lot_num);
1240: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1241: END IF;
1242:
1235: IF (g_asn_debug = 'Y') THEN
1236: asn_debug.put_line('rls_primary_qty is lesser ');
1237: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1238: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1239: asn_debug.put_line('l_lot_num ' || l_lot_num);
1240: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1241: END IF;
1242:
1243: UPDATE rcv_lots_supply rls
1236: asn_debug.put_line('rls_primary_qty is lesser ');
1237: asn_debug.put_line('l_qty_to_be_updated ' || l_qty_to_be_updated);
1238: asn_debug.put_line('l_primary_qty_to_be_updated ' || l_primary_qty_to_be_updated);
1239: asn_debug.put_line('l_lot_num ' || l_lot_num);
1240: asn_debug.put_line('l_ship_line_id ' || l_ship_line_id);
1241: END IF;
1242:
1243: UPDATE rcv_lots_supply rls
1244: SET quantity = quantity -(quantity * l_factor),
1253: END LOOP; --}
1254:
1255: CLOSE shipment_supply_quantity;
1256:
1257: IF (g_asn_debug = 'Y') THEN
1258: asn_debug.put_line('Close shipment_supply_quantity ');
1259: END IF;
1260: /*
1261: select shipment_header_id,item_id
1254:
1255: CLOSE shipment_supply_quantity;
1256:
1257: IF (g_asn_debug = 'Y') THEN
1258: asn_debug.put_line('Close shipment_supply_quantity ');
1259: END IF;
1260: /*
1261: select shipment_header_id,item_id
1262: into l_shipment_header_id,l_item_id
1292: END LOOP; --}
1293:
1294: CLOSE lot_cursor;
1295:
1296: IF (g_asn_debug = 'Y') THEN
1297: asn_debug.put_line('Close lot_cursor ');
1298: END IF;
1299:
1300: IF (g_asn_debug = 'Y') THEN
1293:
1294: CLOSE lot_cursor;
1295:
1296: IF (g_asn_debug = 'Y') THEN
1297: asn_debug.put_line('Close lot_cursor ');
1298: END IF;
1299:
1300: IF (g_asn_debug = 'Y') THEN
1301: asn_debug.put_line('Exit update_rcv_lots_supply ');
1296: IF (g_asn_debug = 'Y') THEN
1297: asn_debug.put_line('Close lot_cursor ');
1298: END IF;
1299:
1300: IF (g_asn_debug = 'Y') THEN
1301: asn_debug.put_line('Exit update_rcv_lots_supply ');
1302: END IF;
1303: EXCEPTION
1304: WHEN NO_DATA_FOUND THEN
1297: asn_debug.put_line('Close lot_cursor ');
1298: END IF;
1299:
1300: IF (g_asn_debug = 'Y') THEN
1301: asn_debug.put_line('Exit update_rcv_lots_supply ');
1302: END IF;
1303: EXCEPTION
1304: WHEN NO_DATA_FOUND THEN
1305: IF (g_asn_debug = 'Y') THEN
1301: asn_debug.put_line('Exit update_rcv_lots_supply ');
1302: END IF;
1303: EXCEPTION
1304: WHEN NO_DATA_FOUND THEN
1305: IF (g_asn_debug = 'Y') THEN
1306: asn_debug.put_line('no_data_found update_rcv_lots_supply ');
1307: END IF;
1308:
1309: x_return_status := fnd_api.g_ret_sts_error;
1302: END IF;
1303: EXCEPTION
1304: WHEN NO_DATA_FOUND THEN
1305: IF (g_asn_debug = 'Y') THEN
1306: asn_debug.put_line('no_data_found update_rcv_lots_supply ');
1307: END IF;
1308:
1309: x_return_status := fnd_api.g_ret_sts_error;
1310:
1338: rti.program_update_date
1339: FROM rcv_transactions_interface rti
1340: WHERE rti.interface_transaction_id = p_interface_transaction_id;
1341: WHEN OTHERS THEN
1342: IF (g_asn_debug = 'Y') THEN
1343: asn_debug.put_line('others update_rcv_lots_supply ');
1344: END IF;
1345:
1346: x_return_status := fnd_api.g_ret_sts_unexp_error;
1339: FROM rcv_transactions_interface rti
1340: WHERE rti.interface_transaction_id = p_interface_transaction_id;
1341: WHEN OTHERS THEN
1342: IF (g_asn_debug = 'Y') THEN
1343: asn_debug.put_line('others update_rcv_lots_supply ');
1344: END IF;
1345:
1346: x_return_status := fnd_api.g_ret_sts_unexp_error;
1347:
1420: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
1421: l_shipment_header_id rcv_shipment_headers.shipment_header_id%TYPE;
1422: l_item_id rcv_transactions_interface.item_id%TYPE;
1423: BEGIN
1424: IF (g_asn_debug = 'Y') THEN
1425: asn_debug.put_line('Enter update_rcv_serials_supply ');
1426: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1427: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
1428: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
1421: l_shipment_header_id rcv_shipment_headers.shipment_header_id%TYPE;
1422: l_item_id rcv_transactions_interface.item_id%TYPE;
1423: BEGIN
1424: IF (g_asn_debug = 'Y') THEN
1425: asn_debug.put_line('Enter update_rcv_serials_supply ');
1426: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1427: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
1428: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
1429: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
1422: l_item_id rcv_transactions_interface.item_id%TYPE;
1423: BEGIN
1424: IF (g_asn_debug = 'Y') THEN
1425: asn_debug.put_line('Enter update_rcv_serials_supply ');
1426: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1427: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
1428: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
1429: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
1430: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1423: BEGIN
1424: IF (g_asn_debug = 'Y') THEN
1425: asn_debug.put_line('Enter update_rcv_serials_supply ');
1426: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1427: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
1428: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
1429: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
1430: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1431: asn_debug.put_line('p_correction_type ' || p_correction_type);
1424: IF (g_asn_debug = 'Y') THEN
1425: asn_debug.put_line('Enter update_rcv_serials_supply ');
1426: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1427: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
1428: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
1429: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
1430: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1431: asn_debug.put_line('p_correction_type ' || p_correction_type);
1432: END IF;
1425: asn_debug.put_line('Enter update_rcv_serials_supply ');
1426: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1427: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
1428: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
1429: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
1430: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1431: asn_debug.put_line('p_correction_type ' || p_correction_type);
1432: END IF;
1433:
1426: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1427: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
1428: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
1429: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
1430: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1431: asn_debug.put_line('p_correction_type ' || p_correction_type);
1432: END IF;
1433:
1434: x_return_status := fnd_api.g_ret_sts_success;
1427: asn_debug.put_line('p_transaction_type ' || p_transaction_type);
1428: asn_debug.put_line('p_shipment_line_id ' || p_shipment_line_id);
1429: asn_debug.put_line('p_source_type_code ' || p_source_type_code);
1430: asn_debug.put_line('p_parent_supply_id ' || p_parent_supply_id);
1431: asn_debug.put_line('p_correction_type ' || p_correction_type);
1432: END IF;
1433:
1434: x_return_status := fnd_api.g_ret_sts_success;
1435:
1447: IF (l_serial_count = 0) THEN
1448: RETURN;
1449: END IF;
1450:
1451: IF (g_asn_debug = 'Y') THEN
1452: asn_debug.put_line('l_Serial_count ' || l_serial_count);
1453: END IF;
1454:
1455: /* We need to insert into rcv_lots_supply and
1448: RETURN;
1449: END IF;
1450:
1451: IF (g_asn_debug = 'Y') THEN
1452: asn_debug.put_line('l_Serial_count ' || l_serial_count);
1453: END IF;
1454:
1455: /* We need to insert into rcv_lots_supply and
1456: * rcv_serials_supply table only when we come through ROI
1472: AND l_lpn_id = -999) THEN
1473: RETURN;
1474: END IF;
1475:
1476: IF (g_asn_debug = 'Y') THEN
1477: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
1478: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
1479: END IF;
1480:
1473: RETURN;
1474: END IF;
1475:
1476: IF (g_asn_debug = 'Y') THEN
1477: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
1478: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
1479: END IF;
1480:
1481: OPEN select_serials(p_interface_transaction_id);
1474: END IF;
1475:
1476: IF (g_asn_debug = 'Y') THEN
1477: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
1478: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
1479: END IF;
1480:
1481: OPEN select_serials(p_interface_transaction_id);
1482:
1498: ELSIF(p_correction_type = 'NEGATIVE') THEN --}{
1499: l_delete_serial := 'Y';
1500: END IF; --}
1501:
1502: IF (g_asn_debug = 'Y') THEN
1503: asn_debug.put_line('l_insert_serial ' || l_insert_serial);
1504: asn_debug.put_line('l_delete_serial ' || l_delete_serial);
1505: END IF;
1506:
1499: l_delete_serial := 'Y';
1500: END IF; --}
1501:
1502: IF (g_asn_debug = 'Y') THEN
1503: asn_debug.put_line('l_insert_serial ' || l_insert_serial);
1504: asn_debug.put_line('l_delete_serial ' || l_delete_serial);
1505: END IF;
1506:
1507: SELECT transaction_type
1500: END IF; --}
1501:
1502: IF (g_asn_debug = 'Y') THEN
1503: asn_debug.put_line('l_insert_serial ' || l_insert_serial);
1504: asn_debug.put_line('l_delete_serial ' || l_delete_serial);
1505: END IF;
1506:
1507: SELECT transaction_type
1508: INTO l_parent_trans_type
1514: AND p_source_type_code IN('INVENTORY', 'REQ')) THEN --{
1515: l_update_shipment_supply := 'Y';
1516: END IF; --}
1517:
1518: IF (g_asn_debug = 'Y') THEN
1519: asn_debug.put_line('l_update_shipment_supply ' || l_update_shipment_supply);
1520: END IF;
1521:
1522: LOOP --{
1515: l_update_shipment_supply := 'Y';
1516: END IF; --}
1517:
1518: IF (g_asn_debug = 'Y') THEN
1519: asn_debug.put_line('l_update_shipment_supply ' || l_update_shipment_supply);
1520: END IF;
1521:
1522: LOOP --{
1523: FETCH select_serials INTO l_select_serials;
1547: END IF;
1548:
1549: /* End Bug#3359105 */
1550: IF (l_delete_serial = 'Y') THEN --{
1551: IF (g_asn_debug = 'Y') THEN
1552: asn_debug.put_line('l_serial_prefix ' || l_serial_prefix);
1553: asn_debug.put_line('l_from_serial_number ' || l_from_serial_number);
1554: asn_debug.put_line('l_to_serial_number ' || l_to_serial_number);
1555: END IF;
1548:
1549: /* End Bug#3359105 */
1550: IF (l_delete_serial = 'Y') THEN --{
1551: IF (g_asn_debug = 'Y') THEN
1552: asn_debug.put_line('l_serial_prefix ' || l_serial_prefix);
1553: asn_debug.put_line('l_from_serial_number ' || l_from_serial_number);
1554: asn_debug.put_line('l_to_serial_number ' || l_to_serial_number);
1555: END IF;
1556:
1549: /* End Bug#3359105 */
1550: IF (l_delete_serial = 'Y') THEN --{
1551: IF (g_asn_debug = 'Y') THEN
1552: asn_debug.put_line('l_serial_prefix ' || l_serial_prefix);
1553: asn_debug.put_line('l_from_serial_number ' || l_from_serial_number);
1554: asn_debug.put_line('l_to_serial_number ' || l_to_serial_number);
1555: END IF;
1556:
1557: DELETE FROM rcv_serials_supply
1550: IF (l_delete_serial = 'Y') THEN --{
1551: IF (g_asn_debug = 'Y') THEN
1552: asn_debug.put_line('l_serial_prefix ' || l_serial_prefix);
1553: asn_debug.put_line('l_from_serial_number ' || l_from_serial_number);
1554: asn_debug.put_line('l_to_serial_number ' || l_to_serial_number);
1555: END IF;
1556:
1557: DELETE FROM rcv_serials_supply
1558: WHERE transaction_id = p_parent_supply_id
1576: '0'
1577: );
1578:
1579: IF (l_insert_serial = 'Y') THEN --{
1580: IF (g_asn_debug = 'Y') THEN
1581: asn_debug.put_line('Before insert_serial_supply ');
1582: END IF;
1583:
1584: insert_serial_supply(p_interface_transaction_id,
1577: );
1578:
1579: IF (l_insert_serial = 'Y') THEN --{
1580: IF (g_asn_debug = 'Y') THEN
1581: asn_debug.put_line('Before insert_serial_supply ');
1582: END IF;
1583:
1584: insert_serial_supply(p_interface_transaction_id,
1585: l_select_serials.lot_number,
1588: p_parent_supply_id,
1589: x_return_status
1590: );
1591:
1592: IF (g_asn_debug = 'Y') THEN
1593: asn_debug.put_line('After insert_serial_supply ');
1594: END IF;
1595: END IF; --}
1596:
1589: x_return_status
1590: );
1591:
1592: IF (g_asn_debug = 'Y') THEN
1593: asn_debug.put_line('After insert_serial_supply ');
1594: END IF;
1595: END IF; --}
1596:
1597: IF ( (l_update_shipment_supply = 'Y')
1595: END IF; --}
1596:
1597: IF ( (l_update_shipment_supply = 'Y')
1598: AND (l_delete_serial = 'Y')) THEN --{
1599: IF (g_asn_debug = 'Y') THEN
1600: asn_debug.put_line('Before insert_serial_supply when update and delete serial is Y');
1601: END IF;
1602:
1603: insert_serial_supply(p_interface_transaction_id,
1596:
1597: IF ( (l_update_shipment_supply = 'Y')
1598: AND (l_delete_serial = 'Y')) THEN --{
1599: IF (g_asn_debug = 'Y') THEN
1600: asn_debug.put_line('Before insert_serial_supply when update and delete serial is Y');
1601: END IF;
1602:
1603: insert_serial_supply(p_interface_transaction_id,
1604: l_select_serials.lot_number,
1607: p_parent_supply_id,
1608: x_return_status
1609: );
1610:
1611: IF (g_asn_debug = 'Y') THEN
1612: asn_debug.put_line('After insert_serial_supply when update and delete serial is Y');
1613: END IF;
1614: END IF; --}
1615: END LOOP; --}
1608: x_return_status
1609: );
1610:
1611: IF (g_asn_debug = 'Y') THEN
1612: asn_debug.put_line('After insert_serial_supply when update and delete serial is Y');
1613: END IF;
1614: END IF; --}
1615: END LOOP; --}
1616:
1615: END LOOP; --}
1616:
1617: IF ( (l_update_shipment_supply = 'Y')
1618: AND (l_insert_serial = 'Y')) THEN --{
1619: IF (g_asn_debug = 'Y') THEN
1620: asn_debug.put_line('Before delete when update and insert serial is Y');
1621: END IF;
1622:
1623: SELECT shipment_header_id,
1616:
1617: IF ( (l_update_shipment_supply = 'Y')
1618: AND (l_insert_serial = 'Y')) THEN --{
1619: IF (g_asn_debug = 'Y') THEN
1620: asn_debug.put_line('Before delete when update and insert serial is Y');
1621: END IF;
1622:
1623: SELECT shipment_header_id,
1624: item_id
1649: WHERE rsl.shipment_header_id = l_shipment_header_id
1650: AND rsl.shipment_line_id = rss.shipment_line_id
1651: AND rsl.item_id = l_item_id);
1652:
1653: IF (g_asn_debug = 'Y') THEN
1654: asn_debug.put_line('After delete when update and insert serial is Y');
1655: END IF;
1656: END IF; --}
1657: END LOOP; --}
1650: AND rsl.shipment_line_id = rss.shipment_line_id
1651: AND rsl.item_id = l_item_id);
1652:
1653: IF (g_asn_debug = 'Y') THEN
1654: asn_debug.put_line('After delete when update and insert serial is Y');
1655: END IF;
1656: END IF; --}
1657: END LOOP; --}
1658:
1658:
1659: CLOSE select_serials;
1660: EXCEPTION
1661: WHEN NO_DATA_FOUND THEN
1662: IF (g_asn_debug = 'Y') THEN
1663: asn_debug.put_line('no_data_found update_rcv_serials_supply');
1664: END IF;
1665:
1666: x_return_status := fnd_api.g_ret_sts_error;
1659: CLOSE select_serials;
1660: EXCEPTION
1661: WHEN NO_DATA_FOUND THEN
1662: IF (g_asn_debug = 'Y') THEN
1663: asn_debug.put_line('no_data_found update_rcv_serials_supply');
1664: END IF;
1665:
1666: x_return_status := fnd_api.g_ret_sts_error;
1667:
1695: rti.program_update_date
1696: FROM rcv_transactions_interface rti
1697: WHERE rti.interface_transaction_id = p_interface_transaction_id;
1698: WHEN OTHERS THEN
1699: IF (g_asn_debug = 'Y') THEN
1700: asn_debug.put_line('others update_rcv_serials_supply');
1701: END IF;
1702:
1703: x_return_status := fnd_api.g_ret_sts_unexp_error;
1696: FROM rcv_transactions_interface rti
1697: WHERE rti.interface_transaction_id = p_interface_transaction_id;
1698: WHEN OTHERS THEN
1699: IF (g_asn_debug = 'Y') THEN
1700: asn_debug.put_line('others update_rcv_serials_supply');
1701: END IF;
1702:
1703: x_return_status := fnd_api.g_ret_sts_unexp_error;
1704:
1749: l_lot_count NUMBER;
1750: l_lpn_id rcv_supply.lpn_id%TYPE;
1751: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
1752: BEGIN
1753: IF (g_asn_debug = 'Y') THEN
1754: asn_debug.put_line('Enter insert_lots_supply');
1755: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1756: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1757: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
1750: l_lpn_id rcv_supply.lpn_id%TYPE;
1751: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
1752: BEGIN
1753: IF (g_asn_debug = 'Y') THEN
1754: asn_debug.put_line('Enter insert_lots_supply');
1755: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1756: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1757: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
1758: END IF;
1751: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
1752: BEGIN
1753: IF (g_asn_debug = 'Y') THEN
1754: asn_debug.put_line('Enter insert_lots_supply');
1755: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1756: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1757: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
1758: END IF;
1759:
1752: BEGIN
1753: IF (g_asn_debug = 'Y') THEN
1754: asn_debug.put_line('Enter insert_lots_supply');
1755: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1756: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1757: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
1758: END IF;
1759:
1760: x_return_status := fnd_api.g_ret_sts_success;
1753: IF (g_asn_debug = 'Y') THEN
1754: asn_debug.put_line('Enter insert_lots_supply');
1755: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1756: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1757: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
1758: END IF;
1759:
1760: x_return_status := fnd_api.g_ret_sts_success;
1761:
1773: IF (l_lot_count = 0) THEN
1774: RETURN;
1775: END IF;
1776:
1777: IF (g_asn_debug = 'Y') THEN
1778: asn_debug.put_line('l_lot_count ' || l_lot_count);
1779: END IF;
1780:
1781: /* We need to insert into rcv_lots_supply and
1774: RETURN;
1775: END IF;
1776:
1777: IF (g_asn_debug = 'Y') THEN
1778: asn_debug.put_line('l_lot_count ' || l_lot_count);
1779: END IF;
1780:
1781: /* We need to insert into rcv_lots_supply and
1782: * rcv_serials_supply table only when we come through ROI
1798: AND l_lpn_id = -999) THEN
1799: RETURN;
1800: END IF;
1801:
1802: IF (g_asn_debug = 'Y') THEN
1803: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
1804: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
1805: END IF;
1806: /* INVCONV, Remove sublot_num . Punit Kumar*/
1799: RETURN;
1800: END IF;
1801:
1802: IF (g_asn_debug = 'Y') THEN
1803: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
1804: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
1805: END IF;
1806: /* INVCONV, Remove sublot_num . Punit Kumar*/
1807:
1800: END IF;
1801:
1802: IF (g_asn_debug = 'Y') THEN
1803: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
1804: asn_debug.put_line('l_lpn_id ' || l_lpn_id);
1805: END IF;
1806: /* INVCONV, Remove sublot_num . Punit Kumar*/
1807:
1808: INSERT INTO rcv_lots_supply
1877: WHERE ( mtltview.product_transaction_id = p_interface_transaction_id
1878: AND mtltview.product_code = 'RCV'
1879: AND rs.supply_source_id = p_supply_source_id);
1880:
1881: IF (g_asn_debug = 'Y') THEN
1882: asn_debug.put_line('After insert into rcv_lots_supply ');
1883: asn_debug.put_line('INVCONV, Subllot_num has been removed in insert_lot_supply1 ');
1884: END IF;
1885:
1878: AND mtltview.product_code = 'RCV'
1879: AND rs.supply_source_id = p_supply_source_id);
1880:
1881: IF (g_asn_debug = 'Y') THEN
1882: asn_debug.put_line('After insert into rcv_lots_supply ');
1883: asn_debug.put_line('INVCONV, Subllot_num has been removed in insert_lot_supply1 ');
1884: END IF;
1885:
1886: OPEN c;
1879: AND rs.supply_source_id = p_supply_source_id);
1880:
1881: IF (g_asn_debug = 'Y') THEN
1882: asn_debug.put_line('After insert into rcv_lots_supply ');
1883: asn_debug.put_line('INVCONV, Subllot_num has been removed in insert_lot_supply1 ');
1884: END IF;
1885:
1886: OPEN c;
1887: FETCH c INTO l_rowid;
1892: END IF;
1893:
1894: CLOSE c;
1895:
1896: IF (g_asn_debug = 'Y') THEN
1897: asn_debug.put_line('Exit insert_lots_supply ');
1898: END IF;
1899: EXCEPTION
1900: WHEN NO_DATA_FOUND THEN
1893:
1894: CLOSE c;
1895:
1896: IF (g_asn_debug = 'Y') THEN
1897: asn_debug.put_line('Exit insert_lots_supply ');
1898: END IF;
1899: EXCEPTION
1900: WHEN NO_DATA_FOUND THEN
1901: IF (g_asn_debug = 'Y') THEN
1897: asn_debug.put_line('Exit insert_lots_supply ');
1898: END IF;
1899: EXCEPTION
1900: WHEN NO_DATA_FOUND THEN
1901: IF (g_asn_debug = 'Y') THEN
1902: asn_debug.put_line('no_data_found insert_lots_supply ');
1903: END IF;
1904:
1905: x_return_status := fnd_api.g_ret_sts_error;
1898: END IF;
1899: EXCEPTION
1900: WHEN NO_DATA_FOUND THEN
1901: IF (g_asn_debug = 'Y') THEN
1902: asn_debug.put_line('no_data_found insert_lots_supply ');
1903: END IF;
1904:
1905: x_return_status := fnd_api.g_ret_sts_error;
1906: RAISE;
1904:
1905: x_return_status := fnd_api.g_ret_sts_error;
1906: RAISE;
1907: WHEN OTHERS THEN
1908: IF (g_asn_debug = 'Y') THEN
1909: asn_debug.put_line('others insert_lots_supply ');
1910: END IF;
1911:
1912: x_return_status := fnd_api.g_ret_sts_unexp_error;
1905: x_return_status := fnd_api.g_ret_sts_error;
1906: RAISE;
1907: WHEN OTHERS THEN
1908: IF (g_asn_debug = 'Y') THEN
1909: asn_debug.put_line('others insert_lots_supply ');
1910: END IF;
1911:
1912: x_return_status := fnd_api.g_ret_sts_unexp_error;
1913: RAISE;
1930: l_serial_count NUMBER;
1931: l_lpn_id rcv_supply.lpn_id%TYPE;
1932: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
1933: BEGIN
1934: IF (g_asn_debug = 'Y') THEN
1935: asn_debug.put_line('Enter insert_serial_supply ');
1936: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1937: asn_debug.put_line('p_serial_number ' || p_serial_number);
1938: asn_debug.put_line('p_lot_number ' || p_lot_number);
1931: l_lpn_id rcv_supply.lpn_id%TYPE;
1932: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
1933: BEGIN
1934: IF (g_asn_debug = 'Y') THEN
1935: asn_debug.put_line('Enter insert_serial_supply ');
1936: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1937: asn_debug.put_line('p_serial_number ' || p_serial_number);
1938: asn_debug.put_line('p_lot_number ' || p_lot_number);
1939: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1932: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
1933: BEGIN
1934: IF (g_asn_debug = 'Y') THEN
1935: asn_debug.put_line('Enter insert_serial_supply ');
1936: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1937: asn_debug.put_line('p_serial_number ' || p_serial_number);
1938: asn_debug.put_line('p_lot_number ' || p_lot_number);
1939: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1940: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
1933: BEGIN
1934: IF (g_asn_debug = 'Y') THEN
1935: asn_debug.put_line('Enter insert_serial_supply ');
1936: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1937: asn_debug.put_line('p_serial_number ' || p_serial_number);
1938: asn_debug.put_line('p_lot_number ' || p_lot_number);
1939: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1940: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
1941: END IF;
1934: IF (g_asn_debug = 'Y') THEN
1935: asn_debug.put_line('Enter insert_serial_supply ');
1936: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1937: asn_debug.put_line('p_serial_number ' || p_serial_number);
1938: asn_debug.put_line('p_lot_number ' || p_lot_number);
1939: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1940: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
1941: END IF;
1942:
1935: asn_debug.put_line('Enter insert_serial_supply ');
1936: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1937: asn_debug.put_line('p_serial_number ' || p_serial_number);
1938: asn_debug.put_line('p_lot_number ' || p_lot_number);
1939: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1940: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
1941: END IF;
1942:
1943: x_return_status := fnd_api.g_ret_sts_success;
1936: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
1937: asn_debug.put_line('p_serial_number ' || p_serial_number);
1938: asn_debug.put_line('p_lot_number ' || p_lot_number);
1939: asn_debug.put_line('p_supply_type_code ' || p_supply_type_code);
1940: asn_debug.put_line('p_supply_source_id ' || p_supply_source_id);
1941: END IF;
1942:
1943: x_return_status := fnd_api.g_ret_sts_success;
1944:
1956: IF (l_serial_count = 0) THEN
1957: RETURN;
1958: END IF;
1959:
1960: IF (g_asn_debug = 'Y') THEN
1961: asn_debug.put_line('l_serial_count ' || l_serial_count);
1962: END IF;
1963:
1964: /* We need to insert into rcv_lots_supply and
1957: RETURN;
1958: END IF;
1959:
1960: IF (g_asn_debug = 'Y') THEN
1961: asn_debug.put_line('l_serial_count ' || l_serial_count);
1962: END IF;
1963:
1964: /* We need to insert into rcv_lots_supply and
1965: * rcv_serials_supply table only when we come through ROI
1981: AND l_lpn_id = -999) THEN
1982: RETURN;
1983: END IF;
1984:
1985: IF (g_asn_debug = 'Y') THEN
1986: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
1987: asn_debug.put_line(' l_lpn_id ' || l_lpn_id);
1988: END IF;
1989:
1982: RETURN;
1983: END IF;
1984:
1985: IF (g_asn_debug = 'Y') THEN
1986: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
1987: asn_debug.put_line(' l_lpn_id ' || l_lpn_id);
1988: END IF;
1989:
1990: /* We can only use rcv_transactions but in cases of direct deliver
1983: END IF;
1984:
1985: IF (g_asn_debug = 'Y') THEN
1986: asn_debug.put_line('l_validation_flag ' || l_validation_flag);
1987: asn_debug.put_line(' l_lpn_id ' || l_lpn_id);
1988: END IF;
1989:
1990: /* We can only use rcv_transactions but in cases of direct deliver
1991: * there will be two rows in rt with same interface_txn_id. Hence
2026: rs.program_update_date
2027: FROM rcv_supply rs
2028: WHERE rs.supply_source_id = p_supply_source_id;
2029:
2030: IF (g_asn_debug = 'Y') THEN
2031: asn_debug.put_line(' After insert into rcv_serials_supply');
2032: END IF;
2033:
2034: OPEN c;
2027: FROM rcv_supply rs
2028: WHERE rs.supply_source_id = p_supply_source_id;
2029:
2030: IF (g_asn_debug = 'Y') THEN
2031: asn_debug.put_line(' After insert into rcv_serials_supply');
2032: END IF;
2033:
2034: OPEN c;
2035: FETCH c INTO l_rowid;
2040: END IF;
2041:
2042: CLOSE c;
2043:
2044: IF (g_asn_debug = 'Y') THEN
2045: asn_debug.put_line(' Exit insert_serial_supply');
2046: END IF;
2047: EXCEPTION
2048: WHEN NO_DATA_FOUND THEN
2041:
2042: CLOSE c;
2043:
2044: IF (g_asn_debug = 'Y') THEN
2045: asn_debug.put_line(' Exit insert_serial_supply');
2046: END IF;
2047: EXCEPTION
2048: WHEN NO_DATA_FOUND THEN
2049: IF (g_asn_debug = 'Y') THEN
2045: asn_debug.put_line(' Exit insert_serial_supply');
2046: END IF;
2047: EXCEPTION
2048: WHEN NO_DATA_FOUND THEN
2049: IF (g_asn_debug = 'Y') THEN
2050: asn_debug.put_line(' no_data_found insert_serial_supply');
2051: END IF;
2052:
2053: x_return_status := fnd_api.g_ret_sts_error;
2046: END IF;
2047: EXCEPTION
2048: WHEN NO_DATA_FOUND THEN
2049: IF (g_asn_debug = 'Y') THEN
2050: asn_debug.put_line(' no_data_found insert_serial_supply');
2051: END IF;
2052:
2053: x_return_status := fnd_api.g_ret_sts_error;
2054: RAISE;
2052:
2053: x_return_status := fnd_api.g_ret_sts_error;
2054: RAISE;
2055: WHEN OTHERS THEN
2056: IF (g_asn_debug = 'Y') THEN
2057: asn_debug.put_line(' others insert_serial_supply');
2058: END IF;
2059:
2060: x_return_status := fnd_api.g_ret_sts_unexp_error;
2053: x_return_status := fnd_api.g_ret_sts_error;
2054: RAISE;
2055: WHEN OTHERS THEN
2056: IF (g_asn_debug = 'Y') THEN
2057: asn_debug.put_line(' others insert_serial_supply');
2058: END IF;
2059:
2060: x_return_status := fnd_api.g_ret_sts_unexp_error;
2061: RAISE;
2073: l_lot_count NUMBER;
2074: l_lpn_id rcv_supply.lpn_id%TYPE;
2075: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
2076: BEGIN
2077: IF (g_asn_debug = 'Y') THEN
2078: asn_debug.put_line(' enter insert_lot_transactions');
2079: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
2080: asn_debug.put_line('p_lot_context ' || p_lot_context);
2081: asn_debug.put_line('p_lot_context_id ' || p_lot_context_id);
2074: l_lpn_id rcv_supply.lpn_id%TYPE;
2075: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
2076: BEGIN
2077: IF (g_asn_debug = 'Y') THEN
2078: asn_debug.put_line(' enter insert_lot_transactions');
2079: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
2080: asn_debug.put_line('p_lot_context ' || p_lot_context);
2081: asn_debug.put_line('p_lot_context_id ' || p_lot_context_id);
2082: asn_debug.put_line('p_source_transaction_id ' || p_source_transaction_id);
2075: l_validation_flag rcv_transactions_interface.validation_flag%TYPE;
2076: BEGIN
2077: IF (g_asn_debug = 'Y') THEN
2078: asn_debug.put_line(' enter insert_lot_transactions');
2079: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
2080: asn_debug.put_line('p_lot_context ' || p_lot_context);
2081: asn_debug.put_line('p_lot_context_id ' || p_lot_context_id);
2082: asn_debug.put_line('p_source_transaction_id ' || p_source_transaction_id);
2083: asn_debug.put_line('p_correction_transaction_id ' || p_correction_transaction_id);
2076: BEGIN
2077: IF (g_asn_debug = 'Y') THEN
2078: asn_debug.put_line(' enter insert_lot_transactions');
2079: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
2080: asn_debug.put_line('p_lot_context ' || p_lot_context);
2081: asn_debug.put_line('p_lot_context_id ' || p_lot_context_id);
2082: asn_debug.put_line('p_source_transaction_id ' || p_source_transaction_id);
2083: asn_debug.put_line('p_correction_transaction_id ' || p_correction_transaction_id);
2084: asn_debug.put_line('p_negate_qty ' || p_negate_qty);
2077: IF (g_asn_debug = 'Y') THEN
2078: asn_debug.put_line(' enter insert_lot_transactions');
2079: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
2080: asn_debug.put_line('p_lot_context ' || p_lot_context);
2081: asn_debug.put_line('p_lot_context_id ' || p_lot_context_id);
2082: asn_debug.put_line('p_source_transaction_id ' || p_source_transaction_id);
2083: asn_debug.put_line('p_correction_transaction_id ' || p_correction_transaction_id);
2084: asn_debug.put_line('p_negate_qty ' || p_negate_qty);
2085: END IF;
2078: asn_debug.put_line(' enter insert_lot_transactions');
2079: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
2080: asn_debug.put_line('p_lot_context ' || p_lot_context);
2081: asn_debug.put_line('p_lot_context_id ' || p_lot_context_id);
2082: asn_debug.put_line('p_source_transaction_id ' || p_source_transaction_id);
2083: asn_debug.put_line('p_correction_transaction_id ' || p_correction_transaction_id);
2084: asn_debug.put_line('p_negate_qty ' || p_negate_qty);
2085: END IF;
2086:
2079: asn_debug.put_line('p_interface_transaction_id ' || p_interface_transaction_id);
2080: asn_debug.put_line('p_lot_context ' || p_lot_context);
2081: asn_debug.put_line('p_lot_context_id ' || p_lot_context_id);
2082: asn_debug.put_line('p_source_transaction_id ' || p_source_transaction_id);
2083: asn_debug.put_line('p_correction_transaction_id ' || p_correction_transaction_id);
2084: asn_debug.put_line('p_negate_qty ' || p_negate_qty);
2085: END IF;
2086:
2087: x_return_status := fnd_api.g_ret_sts_success;
2080: asn_debug.put_line('p_lot_context ' || p_lot_context);
2081: asn_debug.put_line('p_lot_context_id ' || p_lot_context_id);
2082: asn_debug.put_line('p_source_transaction_id ' || p_source_transaction_id);
2083: asn_debug.put_line('p_correction_transaction_id ' || p_correction_transaction_id);
2084: asn_debug.put_line('p_negate_qty ' || p_negate_qty);
2085: END IF;
2086:
2087: x_return_status := fnd_api.g_ret_sts_success;
2088:
2194: WHERE mtltview.product_transaction_id = p_interface_transaction_id
2195: AND mtltview.product_code = 'RCV'
2196: AND rti.interface_transaction_id = mtltview.product_transaction_id;
2197:
2198: IF (g_asn_debug = 'Y') THEN
2199: asn_debug.put_line('Exit insert_lot_transactions ');
2200: asn_debug.put_line('INVCONV , sublot_num has not been inserted in rcv_lot_transactions');
2201: END IF;
2202: EXCEPTION
2195: AND mtltview.product_code = 'RCV'
2196: AND rti.interface_transaction_id = mtltview.product_transaction_id;
2197:
2198: IF (g_asn_debug = 'Y') THEN
2199: asn_debug.put_line('Exit insert_lot_transactions ');
2200: asn_debug.put_line('INVCONV , sublot_num has not been inserted in rcv_lot_transactions');
2201: END IF;
2202: EXCEPTION
2203: WHEN NO_DATA_FOUND THEN
2196: AND rti.interface_transaction_id = mtltview.product_transaction_id;
2197:
2198: IF (g_asn_debug = 'Y') THEN
2199: asn_debug.put_line('Exit insert_lot_transactions ');
2200: asn_debug.put_line('INVCONV , sublot_num has not been inserted in rcv_lot_transactions');
2201: END IF;
2202: EXCEPTION
2203: WHEN NO_DATA_FOUND THEN
2204: IF (g_asn_debug = 'Y') THEN
2200: asn_debug.put_line('INVCONV , sublot_num has not been inserted in rcv_lot_transactions');
2201: END IF;
2202: EXCEPTION
2203: WHEN NO_DATA_FOUND THEN
2204: IF (g_asn_debug = 'Y') THEN
2205: asn_debug.put_line('no_data_found insert_lot_transactions ');
2206: END IF;
2207:
2208: x_return_status := fnd_api.g_ret_sts_error;
2201: END IF;
2202: EXCEPTION
2203: WHEN NO_DATA_FOUND THEN
2204: IF (g_asn_debug = 'Y') THEN
2205: asn_debug.put_line('no_data_found insert_lot_transactions ');
2206: END IF;
2207:
2208: x_return_status := fnd_api.g_ret_sts_error;
2209: RAISE;
2207:
2208: x_return_status := fnd_api.g_ret_sts_error;
2209: RAISE;
2210: WHEN OTHERS THEN
2211: IF (g_asn_debug = 'Y') THEN
2212: asn_debug.put_line('others insert_lot_transactions ');
2213: END IF;
2214:
2215: x_return_status := fnd_api.g_ret_sts_unexp_error;
2208: x_return_status := fnd_api.g_ret_sts_error;
2209: RAISE;
2210: WHEN OTHERS THEN
2211: IF (g_asn_debug = 'Y') THEN
2212: asn_debug.put_line('others insert_lot_transactions ');
2213: END IF;
2214:
2215: x_return_status := fnd_api.g_ret_sts_unexp_error;
2216: RAISE;
2231: x_fail_if_one_line_fails VARCHAR2(1) := 'N';
2232: x_interface_type VARCHAR2(25) := 'RCV-856';
2233: x_dummy_flag VARCHAR2(1) := 'Y';
2234: BEGIN
2235: IF (g_asn_debug = 'Y') THEN
2236: asn_debug.put_line('Enter validate_lpn_groups ');
2237: asn_debug.put_line('group_id ' || p_group_id);
2238: asn_debug.put_line('p_request_id ' || p_request_id);
2239: END IF;
2232: x_interface_type VARCHAR2(25) := 'RCV-856';
2233: x_dummy_flag VARCHAR2(1) := 'Y';
2234: BEGIN
2235: IF (g_asn_debug = 'Y') THEN
2236: asn_debug.put_line('Enter validate_lpn_groups ');
2237: asn_debug.put_line('group_id ' || p_group_id);
2238: asn_debug.put_line('p_request_id ' || p_request_id);
2239: END IF;
2240:
2233: x_dummy_flag VARCHAR2(1) := 'Y';
2234: BEGIN
2235: IF (g_asn_debug = 'Y') THEN
2236: asn_debug.put_line('Enter validate_lpn_groups ');
2237: asn_debug.put_line('group_id ' || p_group_id);
2238: asn_debug.put_line('p_request_id ' || p_request_id);
2239: END IF;
2240:
2241: fnd_profile.get('RCV_FAIL_IF_LINE_FAILS', x_fail_if_one_line_fails);
2234: BEGIN
2235: IF (g_asn_debug = 'Y') THEN
2236: asn_debug.put_line('Enter validate_lpn_groups ');
2237: asn_debug.put_line('group_id ' || p_group_id);
2238: asn_debug.put_line('p_request_id ' || p_request_id);
2239: END IF;
2240:
2241: fnd_profile.get('RCV_FAIL_IF_LINE_FAILS', x_fail_if_one_line_fails);
2242: OPEN rcv_processor_pvt.lpn_grps_cur(p_request_id, p_group_id);
2245: FETCH rcv_processor_pvt.lpn_grps_cur INTO l_lpn_group_id;
2246: EXIT WHEN rcv_processor_pvt.lpn_grps_cur%NOTFOUND;
2247:
2248: IF l_lpn_group_id IS NOT NULL THEN --{
2249: IF (g_asn_debug = 'Y') THEN
2250: asn_debug.put_line('Before calling inv api ');
2251: END IF;
2252:
2253: l_return := inv_rcv_integration_apis.validate_lpn_info(1.0,
2246: EXIT WHEN rcv_processor_pvt.lpn_grps_cur%NOTFOUND;
2247:
2248: IF l_lpn_group_id IS NOT NULL THEN --{
2249: IF (g_asn_debug = 'Y') THEN
2250: asn_debug.put_line('Before calling inv api ');
2251: END IF;
2252:
2253: l_return := inv_rcv_integration_apis.validate_lpn_info(1.0,
2254: fnd_api.g_true,
2258: inv_rcv_integration_apis.g_exists_or_create,
2259: l_lpn_group_id
2260: );
2261:
2262: IF (g_asn_debug = 'Y') THEN
2263: asn_debug.put_line('After calling inv api ');
2264: END IF;
2265:
2266: --If l_ret_status <> fnd_api.g_ret_sts_success then --
2259: l_lpn_group_id
2260: );
2261:
2262: IF (g_asn_debug = 'Y') THEN
2263: asn_debug.put_line('After calling inv api ');
2264: END IF;
2265:
2266: --If l_ret_status <> fnd_api.g_ret_sts_success then --
2267: IF (l_return <> TRUE) THEN --{
2264: END IF;
2265:
2266: --If l_ret_status <> fnd_api.g_ret_sts_success then --
2267: IF (l_return <> TRUE) THEN --{
2268: IF (g_asn_debug = 'Y') THEN
2269: asn_debug.put_line('l_return is false ');
2270: END IF;
2271:
2272: IF (x_fail_if_one_line_fails = 'Y') THEN
2265:
2266: --If l_ret_status <> fnd_api.g_ret_sts_success then --
2267: IF (l_return <> TRUE) THEN --{
2268: IF (g_asn_debug = 'Y') THEN
2269: asn_debug.put_line('l_return is false ');
2270: END IF;
2271:
2272: IF (x_fail_if_one_line_fails = 'Y') THEN
2273: IF (g_asn_debug = 'Y') THEN
2269: asn_debug.put_line('l_return is false ');
2270: END IF;
2271:
2272: IF (x_fail_if_one_line_fails = 'Y') THEN
2273: IF (g_asn_debug = 'Y') THEN
2274: asn_debug.put_line(' fail line is Y');
2275: END IF;
2276:
2277: SELECT NVL(header_interface_id, -999),
2270: END IF;
2271:
2272: IF (x_fail_if_one_line_fails = 'Y') THEN
2273: IF (g_asn_debug = 'Y') THEN
2274: asn_debug.put_line(' fail line is Y');
2275: END IF;
2276:
2277: SELECT NVL(header_interface_id, -999),
2278: auto_transact_code,
2293: we must delete the shipment_header if it exists
2294: update the rhi and rti to error for the shipment_headerid */
2295: IF l_header_id <> -999
2296: AND l_asn_type = 'SHIP' THEN --{
2297: IF (g_asn_debug = 'Y') THEN
2298: asn_debug.put_line(' This is an ASN');
2299: END IF;
2300:
2301: UPDATE rcv_headers_interface
2294: update the rhi and rti to error for the shipment_headerid */
2295: IF l_header_id <> -999
2296: AND l_asn_type = 'SHIP' THEN --{
2297: IF (g_asn_debug = 'Y') THEN
2298: asn_debug.put_line(' This is an ASN');
2299: END IF;
2300:
2301: UPDATE rcv_headers_interface
2302: SET processing_status_code = 'ERROR'
2309: );
2310: ELSE
2311: /* for non-ASN transactions we should update the corresponding lpn group
2312: to error */
2313: IF (g_asn_debug = 'Y') THEN
2314: asn_debug.put_line(' Before updating rti error');
2315: END IF;
2316:
2317: rcv_roi_preprocessor.update_rti_error(p_group_id => p_group_id,
2310: ELSE
2311: /* for non-ASN transactions we should update the corresponding lpn group
2312: to error */
2313: IF (g_asn_debug = 'Y') THEN
2314: asn_debug.put_line(' Before updating rti error');
2315: END IF;
2316:
2317: rcv_roi_preprocessor.update_rti_error(p_group_id => p_group_id,
2318: p_interface_id => NULL,
2331: END LOOP; --}
2332:
2333: CLOSE rcv_processor_pvt.lpn_grps_cur;
2334:
2335: IF (g_asn_debug = 'Y') THEN
2336: asn_debug.put_line(' Exit validate_lpn_groups');
2337: END IF;
2338: END validate_lpn_groups;
2339: END rcv_processor_pvt;
2332:
2333: CLOSE rcv_processor_pvt.lpn_grps_cur;
2334:
2335: IF (g_asn_debug = 'Y') THEN
2336: asn_debug.put_line(' Exit validate_lpn_groups');
2337: END IF;
2338: END validate_lpn_groups;
2339: END rcv_processor_pvt;