DBA Data[Home] [Help]

APPS.GME_RELEASE_BATCH_PVT dependencies on GME_COMMON_PVT

Line 13: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

9: PROCEDURE release_batch
10: (p_batch_header_rec IN gme_batch_header%ROWTYPE
11: ,p_phantom_product_id IN NUMBER DEFAULT NULL
12: ,p_yield IN BOOLEAN DEFAULT NULL
13: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
14: ,x_batch_header_rec OUT NOCOPY gme_batch_header%ROWTYPE
15: ,x_return_status OUT NOCOPY VARCHAR2) IS
16:
17:

Line 22: AND line_type = gme_common_pvt.g_line_type_ing;

18: CURSOR Cur_batch_ingredients(v_batch_id NUMBER) IS
19: SELECT *
20: FROM gme_material_details
21: WHERE batch_id = v_batch_id
22: AND line_type = gme_common_pvt.g_line_type_ing;
23:
24: CURSOR Cur_associated_step(v_matl_dtl_id NUMBER) IS
25: SELECT s.*
26: FROM gme_batch_steps s, gme_batch_step_items item

Line 33: l_matl_dtl_tab gme_common_pvt.material_details_tab;

29:
30: l_api_name CONSTANT VARCHAR2 (30) := 'RELEASE_BATCH';
31:
32: l_step_rec gme_batch_steps%ROWTYPE;
33: l_matl_dtl_tab gme_common_pvt.material_details_tab;
34: l_matl_dtl_rec gme_material_details%ROWTYPE;
35: l_release_type NUMBER;
36: l_phantom_batch_rec gme_batch_header%ROWTYPE;
37: l_item_rec mtl_system_items_b%ROWTYPE;

Line 87: x_batch_header_rec.batch_status := gme_common_pvt.g_batch_wip;

83: IF l_return_status <> fnd_api.g_ret_sts_success THEN
84: RAISE error_unexp_phantom;
85: END IF;
86: -- set batch status
87: x_batch_header_rec.batch_status := gme_common_pvt.g_batch_wip;
88:
89: -- set actual start date...
90: -- this is expected to be populated and validated (from either user input or timestamp)
91: x_batch_header_rec.actual_start_date := p_batch_header_rec.actual_start_date;

Line 99: x_batch_header_rec.last_updated_by := gme_common_pvt.g_user_ident;

95: RAISE error_update_batch;
96: END IF;
97:
98: -- Update WHO columns for output structure
99: x_batch_header_rec.last_updated_by := gme_common_pvt.g_user_ident;
100: x_batch_header_rec.last_update_date := gme_common_pvt.g_timestamp;
101: x_batch_header_rec.last_update_login := gme_common_pvt.g_login_id;
102:
103: -- retrieve all ingredients, don't blindly exclude auto by step, because these can really be auto

Line 100: x_batch_header_rec.last_update_date := gme_common_pvt.g_timestamp;

96: END IF;
97:
98: -- Update WHO columns for output structure
99: x_batch_header_rec.last_updated_by := gme_common_pvt.g_user_ident;
100: x_batch_header_rec.last_update_date := gme_common_pvt.g_timestamp;
101: x_batch_header_rec.last_update_login := gme_common_pvt.g_login_id;
102:
103: -- retrieve all ingredients, don't blindly exclude auto by step, because these can really be auto
104: -- if not associated to a step...

Line 101: x_batch_header_rec.last_update_login := gme_common_pvt.g_login_id;

97:
98: -- Update WHO columns for output structure
99: x_batch_header_rec.last_updated_by := gme_common_pvt.g_user_ident;
100: x_batch_header_rec.last_update_date := gme_common_pvt.g_timestamp;
101: x_batch_header_rec.last_update_login := gme_common_pvt.g_login_id;
102:
103: -- retrieve all ingredients, don't blindly exclude auto by step, because these can really be auto
104: -- if not associated to a step...
105: OPEN Cur_batch_ingredients(p_batch_header_rec.batch_id);

Line 113: IF l_release_type = gme_common_pvt.g_mtl_autobystep_release THEN

109: FOR i IN 1..l_matl_dtl_tab.COUNT LOOP
110: l_matl_dtl_rec := l_matl_dtl_tab(i);
111:
112: l_release_type := l_matl_dtl_rec.release_type;
113: IF l_release_type = gme_common_pvt.g_mtl_autobystep_release THEN
114: OPEN Cur_associated_step(l_matl_dtl_rec.material_detail_id);
115: FETCH Cur_associated_step INTO l_step_rec;
116: IF Cur_associated_step%NOTFOUND THEN
117: l_release_type := gme_common_pvt.g_mtl_auto_release;

Line 117: l_release_type := gme_common_pvt.g_mtl_auto_release;

113: IF l_release_type = gme_common_pvt.g_mtl_autobystep_release THEN
114: OPEN Cur_associated_step(l_matl_dtl_rec.material_detail_id);
115: FETCH Cur_associated_step INTO l_step_rec;
116: IF Cur_associated_step%NOTFOUND THEN
117: l_release_type := gme_common_pvt.g_mtl_auto_release;
118: END IF;
119: CLOSE Cur_associated_step;
120: END IF;
121:

Line 122: IF l_release_type <> gme_common_pvt.g_mtl_autobystep_release THEN

118: END IF;
119: CLOSE Cur_associated_step;
120: END IF;
121:
122: IF l_release_type <> gme_common_pvt.g_mtl_autobystep_release THEN
123: IF l_release_type = gme_common_pvt.g_mtl_auto_release THEN
124: l_consume := TRUE;
125: ELSE
126: l_consume := FALSE;

Line 123: IF l_release_type = gme_common_pvt.g_mtl_auto_release THEN

119: CLOSE Cur_associated_step;
120: END IF;
121:
122: IF l_release_type <> gme_common_pvt.g_mtl_autobystep_release THEN
123: IF l_release_type = gme_common_pvt.g_mtl_auto_release THEN
124: l_consume := TRUE;
125: ELSE
126: l_consume := FALSE;
127: END IF;

Line 137: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN

133: ,p_update_inv_ind => x_batch_header_rec.update_inventory_ind
134: ,x_exception_material_tbl => x_exception_material_tbl
135: ,x_return_status => l_return_status);
136:
137: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
138: x_return_status := l_return_status;
139: RAISE error_process_ingredient;
140: END IF;
141:

Line 142: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

138: x_return_status := l_return_status;
139: RAISE error_process_ingredient;
140: END IF;
141:
142: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
143: x_return_status := gme_common_pvt.g_exceptions_err;
144: END IF;
145: END IF; -- IF l_release_type <> gme_common_pvt.g_mtl_autobystep_release THEN
146: END LOOP;

Line 143: x_return_status := gme_common_pvt.g_exceptions_err;

139: RAISE error_process_ingredient;
140: END IF;
141:
142: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
143: x_return_status := gme_common_pvt.g_exceptions_err;
144: END IF;
145: END IF; -- IF l_release_type <> gme_common_pvt.g_mtl_autobystep_release THEN
146: END LOOP;
147:

Line 145: END IF; -- IF l_release_type <> gme_common_pvt.g_mtl_autobystep_release THEN

141:
142: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
143: x_return_status := gme_common_pvt.g_exceptions_err;
144: END IF;
145: END IF; -- IF l_release_type <> gme_common_pvt.g_mtl_autobystep_release THEN
146: END LOOP;
147:
148: -- Yield the phantom product for this batch... that will also take care of the phantom ingredient
149: IF p_phantom_product_id IS NOT NULL THEN

Line 188: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN

184: ,x_exception_material_tbl => x_exception_material_tbl
185: ,x_actual_qty => l_actual_qty
186: ,x_return_status => l_return_status);
187:
188: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
189: x_return_status := l_return_status;
190: RAISE error_yield_material;
191: END IF;
192:

Line 193: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

189: x_return_status := l_return_status;
190: RAISE error_yield_material;
191: END IF;
192:
193: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
194: x_return_status := gme_common_pvt.g_exceptions_err;
195: END IF;
196:
197: l_matl_dtl_rec.actual_qty := l_actual_qty;

Line 194: x_return_status := gme_common_pvt.g_exceptions_err;

190: RAISE error_yield_material;
191: END IF;
192:
193: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
194: x_return_status := gme_common_pvt.g_exceptions_err;
195: END IF;
196:
197: l_matl_dtl_rec.actual_qty := l_actual_qty;
198: ELSE

Line 214: last_updated_by = gme_common_pvt.g_user_ident,

210: -- Update the phantom product
211: UPDATE gme_material_details
212: SET actual_qty = l_matl_dtl_rec.actual_qty,
213: wip_plan_qty = l_matl_dtl_rec.wip_plan_qty,
214: last_updated_by = gme_common_pvt.g_user_ident,
215: last_update_date = gme_common_pvt.g_timestamp,
216: last_update_login = gme_common_pvt.g_login_id
217: WHERE material_detail_id = l_matl_dtl_rec.material_detail_id;
218:

Line 215: last_update_date = gme_common_pvt.g_timestamp,

211: UPDATE gme_material_details
212: SET actual_qty = l_matl_dtl_rec.actual_qty,
213: wip_plan_qty = l_matl_dtl_rec.wip_plan_qty,
214: last_updated_by = gme_common_pvt.g_user_ident,
215: last_update_date = gme_common_pvt.g_timestamp,
216: last_update_login = gme_common_pvt.g_login_id
217: WHERE material_detail_id = l_matl_dtl_rec.material_detail_id;
218:
219: -- Update the phantom ingredient actual_qty and WIP plan qty...

Line 216: last_update_login = gme_common_pvt.g_login_id

212: SET actual_qty = l_matl_dtl_rec.actual_qty,
213: wip_plan_qty = l_matl_dtl_rec.wip_plan_qty,
214: last_updated_by = gme_common_pvt.g_user_ident,
215: last_update_date = gme_common_pvt.g_timestamp,
216: last_update_login = gme_common_pvt.g_login_id
217: WHERE material_detail_id = l_matl_dtl_rec.material_detail_id;
218:
219: -- Update the phantom ingredient actual_qty and WIP plan qty...
220: -- the transaction would have been taken care of

Line 224: last_updated_by = gme_common_pvt.g_user_ident,

220: -- the transaction would have been taken care of
221: UPDATE gme_material_details
222: SET actual_qty = l_matl_dtl_rec.actual_qty,
223: wip_plan_qty = l_matl_dtl_rec.wip_plan_qty,
224: last_updated_by = gme_common_pvt.g_user_ident,
225: last_update_date = gme_common_pvt.g_timestamp,
226: last_update_login = gme_common_pvt.g_login_id
227: WHERE material_detail_id = l_matl_dtl_rec.phantom_line_id;
228:

Line 225: last_update_date = gme_common_pvt.g_timestamp,

221: UPDATE gme_material_details
222: SET actual_qty = l_matl_dtl_rec.actual_qty,
223: wip_plan_qty = l_matl_dtl_rec.wip_plan_qty,
224: last_updated_by = gme_common_pvt.g_user_ident,
225: last_update_date = gme_common_pvt.g_timestamp,
226: last_update_login = gme_common_pvt.g_login_id
227: WHERE material_detail_id = l_matl_dtl_rec.phantom_line_id;
228:
229: END IF;

Line 226: last_update_login = gme_common_pvt.g_login_id

222: SET actual_qty = l_matl_dtl_rec.actual_qty,
223: wip_plan_qty = l_matl_dtl_rec.wip_plan_qty,
224: last_updated_by = gme_common_pvt.g_user_ident,
225: last_update_date = gme_common_pvt.g_timestamp,
226: last_update_login = gme_common_pvt.g_login_id
227: WHERE material_detail_id = l_matl_dtl_rec.phantom_line_id;
228:
229: END IF;
230:

Line 236: IF NOT gme_common_pvt.create_history

232: SET wip_plan_qty = plan_qty
233: WHERE batch_id = p_batch_header_rec.batch_id
234: AND wip_plan_qty is NULL;
235:
236: IF NOT gme_common_pvt.create_history
237: (p_batch_header_rec => x_batch_header_rec
238: ,p_original_status => gme_common_pvt.g_batch_pending
239: ,p_event_id => NVL(gme_common_pvt.g_transaction_header_id,-9999)) THEN
240: IF g_debug <= gme_debug.g_log_procedure THEN

Line 238: ,p_original_status => gme_common_pvt.g_batch_pending

234: AND wip_plan_qty is NULL;
235:
236: IF NOT gme_common_pvt.create_history
237: (p_batch_header_rec => x_batch_header_rec
238: ,p_original_status => gme_common_pvt.g_batch_pending
239: ,p_event_id => NVL(gme_common_pvt.g_transaction_header_id,-9999)) THEN
240: IF g_debug <= gme_debug.g_log_procedure THEN
241: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' create history returned error');
242: END IF;

Line 239: ,p_event_id => NVL(gme_common_pvt.g_transaction_header_id,-9999)) THEN

235:
236: IF NOT gme_common_pvt.create_history
237: (p_batch_header_rec => x_batch_header_rec
238: ,p_original_status => gme_common_pvt.g_batch_pending
239: ,p_event_id => NVL(gme_common_pvt.g_transaction_header_id,-9999)) THEN
240: IF g_debug <= gme_debug.g_log_procedure THEN
241: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' create history returned error');
242: END IF;
243: END IF;

Line 277: --gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR', SQLERRM);

273: x_return_status := FND_API.G_RET_STS_ERROR;
274:
275: WHEN error_update_batch OR error_update_row OR error_fetch_material THEN
276: /* Bug 5554841 No need to set messsage it is set by called APIs */
277: --gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR', SQLERRM);
278: x_return_status := FND_API.g_ret_sts_unexp_error;
279: WHEN error_process_ingredient OR error_consume_material OR error_yield_material OR error_get_item THEN
280: NULL;
281: WHEN error_unexp_phantom THEN

Line 282: gme_common_pvt.log_message ('PM_UNEXPLODED_PHANTOMS');

278: x_return_status := FND_API.g_ret_sts_unexp_error;
279: WHEN error_process_ingredient OR error_consume_material OR error_yield_material OR error_get_item THEN
280: NULL;
281: WHEN error_unexp_phantom THEN
282: gme_common_pvt.log_message ('PM_UNEXPLODED_PHANTOMS');
283: x_return_status := FND_API.G_RET_STS_ERROR;
284: WHEN OTHERS THEN
285: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
286: IF g_debug <= gme_debug.g_log_procedure THEN

Line 297: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

293: (p_material_detail_rec IN gme_material_details%ROWTYPE
294: ,p_consume IN BOOLEAN
295: ,p_trans_date IN DATE
296: ,p_update_inv_ind IN VARCHAR2
297: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
298: ,x_return_status OUT NOCOPY VARCHAR2) IS
299:
300:
301: l_api_name CONSTANT VARCHAR2 (30) := 'process_ingredient';

Line 360: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN

356: ,x_batch_header_rec => l_phantom_batch_rec
357: ,x_return_status => l_return_status
358: ,x_exception_material_tbl => x_exception_material_tbl);
359:
360: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
361: x_return_status := l_return_status;
362: RAISE error_release_batch;
363: END IF;
364:

Line 365: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

361: x_return_status := l_return_status;
362: RAISE error_release_batch;
363: END IF;
364:
365: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
366: x_return_status := gme_common_pvt.g_exceptions_err;
367: END IF;
368:
369: l_update_matl := FALSE;

Line 366: x_return_status := gme_common_pvt.g_exceptions_err;

362: RAISE error_release_batch;
363: END IF;
364:
365: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
366: x_return_status := gme_common_pvt.g_exceptions_err;
367: END IF;
368:
369: l_update_matl := FALSE;
370:

Line 412: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN

408: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
409: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' after consume_material; it returned actual_qty='||l_actual_qty);
410: END IF;
411:
412: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
413: x_return_status := l_return_status;
414: RAISE error_consume_material;
415: END IF;
416:

Line 417: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

413: x_return_status := l_return_status;
414: RAISE error_consume_material;
415: END IF;
416:
417: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
418: x_return_status := gme_common_pvt.g_exceptions_err;
419: END IF;
420: ELSE
421: l_matl_dtl_rec.actual_qty := l_matl_dtl_rec.plan_qty;

Line 418: x_return_status := gme_common_pvt.g_exceptions_err;

414: RAISE error_consume_material;
415: END IF;
416:
417: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
418: x_return_status := gme_common_pvt.g_exceptions_err;
419: END IF;
420: ELSE
421: l_matl_dtl_rec.actual_qty := l_matl_dtl_rec.plan_qty;
422: END IF;

Line 453: gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR', SQLERRM);

449: END IF;
450:
451: EXCEPTION
452: WHEN error_update_row OR error_fetch_batch THEN
453: gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR', SQLERRM);
454: x_return_status := FND_API.g_ret_sts_unexp_error;
455: WHEN error_release_batch OR error_consume_material OR error_get_item THEN
456: NULL;
457: WHEN error_dispense_non_reserve THEN

Line 458: gme_common_pvt.log_message ('GME_DISPENSE_NON_RESERVE');

454: x_return_status := FND_API.g_ret_sts_unexp_error;
455: WHEN error_release_batch OR error_consume_material OR error_get_item THEN
456: NULL;
457: WHEN error_dispense_non_reserve THEN
458: gme_common_pvt.log_message ('GME_DISPENSE_NON_RESERVE');
459: x_return_status := fnd_api.g_ret_sts_error;
460: WHEN OTHERS THEN
461: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
462: IF g_debug <= gme_debug.g_log_procedure THEN

Line 473: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

469: PROCEDURE consume_material(p_material_dtl_rec IN gme_material_details%ROWTYPE
470: ,p_consume_qty IN NUMBER := NULL
471: ,p_trans_date IN DATE := NULL
472: ,p_item_rec IN mtl_system_items_b%ROWTYPE
473: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
474: ,x_actual_qty OUT NOCOPY NUMBER
475: ,x_return_status OUT NOCOPY VARCHAR2) IS
476:
477: l_api_name CONSTANT VARCHAR2 (30) := 'CONSUME_MATERIAL';

Line 480: l_reservation_tab gme_common_pvt.reservations_tab;

476:
477: l_api_name CONSTANT VARCHAR2 (30) := 'CONSUME_MATERIAL';
478:
479: l_reservation_rec mtl_reservations%ROWTYPE;
480: l_reservation_tab gme_common_pvt.reservations_tab;
481: i NUMBER;
482: l_rsrv_type NUMBER;
483: l_start_actual_qty NUMBER;
484:

Line 485: l_PLR_tab gme_common_pvt.reservations_tab;

481: i NUMBER;
482: l_rsrv_type NUMBER;
483: l_start_actual_qty NUMBER;
484:
485: l_PLR_tab gme_common_pvt.reservations_tab;
486: j NUMBER;
487: l_try_PLR BOOLEAN;
488: l_partial_rec mtl_reservations%ROWTYPE;
489: l_pending_mo_ind BOOLEAN := NULL;

Line 524: AND effectivity_date <= gme_common_pvt.g_timestamp

520: SELECT revision
521: FROM mtl_item_revisions_b
522: WHERE inventory_item_id = v_item_id
523: AND organization_id = v_org_id
524: AND effectivity_date <= gme_common_pvt.g_timestamp
525: ORDER BY effectivity_date desc;
526:
527: error_get_item EXCEPTION;
528: error_build_trxn EXCEPTION;

Line 566: IF gme_common_pvt.g_auto_consume_supply_sub_only = 1 THEN

562: -- If consume from supply sub is set to Yes and there's no supply sub, then return with exceptions... can't do anything
563: -- If consume from supply sub is set to No and there's no supply sub, then consume DLR, and return with exceptions (if appl)
564: -- If reservable is set to No don't bother to retrieve the reservations... there aren't any...
565:
566: IF gme_common_pvt.g_auto_consume_supply_sub_only = 1 THEN
567: IF p_material_dtl_rec.subinventory IS NULL THEN
568: l_pending_mo_ind := FALSE; -- can't have move order if sub is NULL
569: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
570: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' auto consume from supply sub is ON and subinv on material is NULL; cant consume anything; get exceptions');

Line 607: l_trans_date := NVL(p_trans_date, gme_common_pvt.g_timestamp);

603: ELSE
604: l_consume_qty := NVL(p_consume_qty, p_material_dtl_rec.plan_qty);
605: END IF;
606:
607: l_trans_date := NVL(p_trans_date, gme_common_pvt.g_timestamp);
608:
609: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
610: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
611: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(p_trans_date

Line 615: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' auto consume from supply sub='||gme_common_pvt.g_auto_consume_supply_sub_only);

611: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(p_trans_date
612: ,'YYYY-MON-DD HH24:MI:SS'));
613: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
614: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' number of reservations='||l_reservation_tab.COUNT);
615: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' auto consume from supply sub='||gme_common_pvt.g_auto_consume_supply_sub_only);
616: END IF;
617:
618: i := 1;
619: j := 1;

Line 655: gme_common_pvt.log_message (p_product_code => 'INV',

651: AND LOT_NUMBER = l_reservation_rec.lot_number
652: AND ORGANIZATION_ID = l_reservation_rec.organization_id;
653:
654: IF (p_trans_date < l_lot_orig_date) THEN
655: gme_common_pvt.log_message (p_product_code => 'INV',
656: p_message_code => 'INV_INT_TDATECODE');
657: RAISE error_bad_trans_date;
658: END IF;
659: END IF;

Line 682: IF (gme_common_pvt.g_auto_consume_supply_sub_only = 0) OR

678: -- save these for later; if there's not enough DLR, PLR will be filled in and used
679: l_PLR_tab(j) := l_reservation_rec;
680: j := j + 1;
681: ELSE -- detailed level reservation
682: IF (gme_common_pvt.g_auto_consume_supply_sub_only = 0) OR
683: (gme_common_pvt.g_auto_consume_supply_sub_only = 1 AND
684: l_reservation_rec.subinventory_code = l_subinv) THEN
685: -- GMO Changes
686: IF ((NVL(p_material_dtl_rec.dispense_ind,'N') = 'Y' AND

Line 683: (gme_common_pvt.g_auto_consume_supply_sub_only = 1 AND

679: l_PLR_tab(j) := l_reservation_rec;
680: j := j + 1;
681: ELSE -- detailed level reservation
682: IF (gme_common_pvt.g_auto_consume_supply_sub_only = 0) OR
683: (gme_common_pvt.g_auto_consume_supply_sub_only = 1 AND
684: l_reservation_rec.subinventory_code = l_subinv) THEN
685: -- GMO Changes
686: IF ((NVL(p_material_dtl_rec.dispense_ind,'N') = 'Y' AND
687: l_reservation_rec.external_source_line_id IS NOT NULL ) OR

Line 701: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN

697: ,p_secondary_uom_code => p_item_rec.secondary_uom_code
698: ,x_actual_qty => x_actual_qty
699: ,x_return_status => l_return_status);
700:
701: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN
702: x_return_status := l_return_status;
703: RAISE error_build_trxn;
704: END IF;
705: END IF; -- p_material_dtl_rec.dispense_ind = 'Y'

Line 706: END IF; -- IF (gme_common_pvt.g_auto_consume_supply_sub_only = 0) OR...

702: x_return_status := l_return_status;
703: RAISE error_build_trxn;
704: END IF;
705: END IF; -- p_material_dtl_rec.dispense_ind = 'Y'
706: END IF; -- IF (gme_common_pvt.g_auto_consume_supply_sub_only = 0) OR...
707: END IF; -- IF l_rsrv_type = ...
708: i := i + 1; -- move on to the next reservation
709: END LOOP;
710:

Line 719: IF (gme_common_pvt.g_auto_consume_supply_sub_only = 0 AND l_subinv IS NULL) THEN

715: -- done!
716: RAISE consume_done;
717: END IF;
718:
719: IF (gme_common_pvt.g_auto_consume_supply_sub_only = 0 AND l_subinv IS NULL) THEN
720: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' exception; qty not met; consume from supply sub is FALSE and material subinv is NULL');
722: END IF;
723: RAISE error_get_exception;

Line 742: IF gme_common_pvt.g_auto_consume_supply_sub_only = 1 THEN -- auto consume -> Yes

738: ,p_batch_id => p_material_dtl_rec.batch_id
739: ,p_material_detail_id => p_material_dtl_rec.material_detail_id);
740:
741: IF p_item_rec.lot_control_code = 2 THEN -- lot control
742: IF gme_common_pvt.g_auto_consume_supply_sub_only = 1 THEN -- auto consume -> Yes
743: IF l_pending_mo_ind THEN
744: l_try_PLR := FALSE;
745: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
746: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' consume from supply sub ON; pending MO TRUE: l_try_PLR := FALSE; get batch exception');

Line 808: ,p_demand_source_type_id => gme_common_pvt.g_txn_source_type

804: ,p_inventory_item_id => p_material_dtl_rec.inventory_item_id
805: ,p_tree_mode => inv_quantity_tree_pub.g_transaction_mode
806: ,p_is_serial_control => FALSE
807: ,p_grade_code => NULL
808: ,p_demand_source_type_id => gme_common_pvt.g_txn_source_type
809: ,p_demand_source_header_id => p_material_dtl_rec.batch_id
810: ,p_demand_source_line_id => p_material_dtl_rec.material_detail_id
811: ,p_demand_source_name => NULL
812: ,p_lot_expiration_date => NULL

Line 862: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN

858: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
859: gme_debug.put_line ('after build and create');
860: END IF;
861:
862: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN
863: x_return_status := l_return_status;
864: RAISE error_build_trxn;
865: END IF;
866:

Line 920: gme_common_pvt.eff_locator_control

916: IF l_locator_id IS NULL THEN
917: -- check if it's locator control, we need a locator...
918: /* Bug 5441643 Added NVL condition for location control code*/
919: l_eff_locator_control :=
920: gme_common_pvt.eff_locator_control
921: (p_organization_id => p_material_dtl_rec.organization_id
922: ,p_org_control => gme_common_pvt.g_org_locator_control
923: ,p_subinventory => p_material_dtl_rec.subinventory
924: ,p_item_control => NVL(p_item_rec.location_control_code,1)

Line 922: ,p_org_control => gme_common_pvt.g_org_locator_control

918: /* Bug 5441643 Added NVL condition for location control code*/
919: l_eff_locator_control :=
920: gme_common_pvt.eff_locator_control
921: (p_organization_id => p_material_dtl_rec.organization_id
922: ,p_org_control => gme_common_pvt.g_org_locator_control
923: ,p_subinventory => p_material_dtl_rec.subinventory
924: ,p_item_control => NVL(p_item_rec.location_control_code,1)
925: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
926: ,p_action => gme_common_pvt.g_ing_issue_txn_action);

Line 926: ,p_action => gme_common_pvt.g_ing_issue_txn_action);

922: ,p_org_control => gme_common_pvt.g_org_locator_control
923: ,p_subinventory => p_material_dtl_rec.subinventory
924: ,p_item_control => NVL(p_item_rec.location_control_code,1)
925: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
926: ,p_action => gme_common_pvt.g_ing_issue_txn_action);
927: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
928: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
929: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);

Line 930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);

926: ,p_action => gme_common_pvt.g_ing_issue_txn_action);
927: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
928: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
929: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
932: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
933: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
934: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);

Line 935: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_ing_issue_txn_action);

931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
932: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
933: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
934: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
935: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_ing_issue_txn_action);
936: END IF;
937: IF l_eff_locator_control <> 1 THEN
938: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
939: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' locator on material is NULL and material is eff locator control; cant get quantities from inventory; get exceptions');

Line 957: ,p_demand_source_type_id => gme_common_pvt.g_txn_source_type

953: ,p_inventory_item_id => p_material_dtl_rec.inventory_item_id
954: ,p_tree_mode => inv_quantity_tree_pub.g_transaction_mode
955: ,p_is_serial_control => FALSE
956: ,p_grade_code => NULL
957: ,p_demand_source_type_id => gme_common_pvt.g_txn_source_type
958: ,p_demand_source_header_id => p_material_dtl_rec.batch_id
959: ,p_demand_source_line_id => p_material_dtl_rec.material_detail_id
960: ,p_demand_source_name => NULL
961: ,p_lot_expiration_date => NULL

Line 998: IF l_att > 0 AND gme_common_pvt.g_allow_neg_inv = 2 THEN

994:
995: -- Bug 7709971 - Restructure this condition to handle orgs that allow negative inventory.
996: -- g_allow_neg_inv: 2 means do not allow neg inv whereas 1 means allow it.
997: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
998: IF l_att > 0 AND gme_common_pvt.g_allow_neg_inv = 2 THEN
999: build_and_create_transaction
1000: (p_rsrv_rec => NULL
1001: ,p_subinv => l_subinv
1002: ,p_locator_id => l_locator_id

Line 1014: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN

1010: ,p_secondary_uom_code => p_item_rec.secondary_uom_code
1011: ,x_actual_qty => x_actual_qty
1012: ,x_return_status => l_return_status);
1013:
1014: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN
1015: x_return_status := l_return_status;
1016: RAISE error_build_trxn;
1017: END IF;
1018: ELSIF gme_common_pvt.g_allow_neg_inv = 1 THEN

Line 1018: ELSIF gme_common_pvt.g_allow_neg_inv = 1 THEN

1014: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN
1015: x_return_status := l_return_status;
1016: RAISE error_build_trxn;
1017: END IF;
1018: ELSIF gme_common_pvt.g_allow_neg_inv = 1 THEN
1019: -- If we are here, we are going to build a transaction based on the l_consume_qty
1020: -- even if this drives inventory negative or if inventory is already negative.
1021:
1022: -- Let's set the secondary_qty to consumed if the user is working in secondary UOM.

Line 1046: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN

1042: ,p_revision => l_revision
1043: ,p_secondary_uom_code => p_item_rec.secondary_uom_code
1044: ,x_actual_qty => x_actual_qty
1045: ,x_return_status => l_return_status);
1046: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN
1047: x_return_status := l_return_status;
1048: RAISE error_build_trxn;
1049: END IF;
1050: -- done!

Line 1127: l_lot_rec gme_common_pvt.mtl_trans_lots_inter_tbl;

1123:
1124: l_api_name CONSTANT VARCHAR2 (30) := 'build_and_create_transaction';
1125:
1126: l_transaction_rec mtl_transactions_interface%ROWTYPE;
1127: l_lot_rec gme_common_pvt.mtl_trans_lots_inter_tbl;
1128: l_rsrv_mode BOOLEAN;
1129: l_trxn_qty NUMBER;
1130: l_dtl_qty NUMBER;
1131: l_prim_qty NUMBER;

Line 1258: ,precision => gme_common_pvt.g_precision

1254:
1255: -- We need to derive secondary from the dtl qty
1256: l_sec_qty := inv_convert.inv_um_convert
1257: (item_id => p_mtl_dtl_rec.inventory_item_id
1258: ,precision => gme_common_pvt.g_precision
1259: ,from_quantity => l_dtl_qty
1260: ,from_unit => l_dtl_um
1261: ,to_unit => p_secondary_uom_code
1262: ,from_name => NULL

Line 1280: ,precision => gme_common_pvt.g_precision

1276:
1277: -- This means that we need to derive the dtl qty from the secondary qty.
1278: l_dtl_qty := inv_convert.inv_um_convert
1279: (item_id => p_mtl_dtl_rec.inventory_item_id
1280: ,precision => gme_common_pvt.g_precision
1281: ,from_quantity => l_sec_qty
1282: ,from_unit => p_secondary_uom_code
1283: ,to_unit => l_dtl_um
1284: ,from_name => NULL

Line 1329: ,precision => gme_common_pvt.g_precision

1325: -- Bug 8741777 changed assignment from l_dtl_qty to l_prim_qty
1326: -- as it is conversion to primary qty
1327: l_prim_qty := inv_convert.inv_um_convert
1328: (item_id => p_mtl_dtl_rec.inventory_item_id
1329: ,precision => gme_common_pvt.g_precision
1330: ,from_quantity => l_dtl_qty
1331: ,from_unit => l_dtl_um
1332: ,to_unit => l_primary_um
1333: ,from_name => NULL

Line 1362: ,precision => gme_common_pvt.g_precision

1358: l_to_um := l_dtl_um;
1359:
1360: l_dtl_qty := inv_convert.inv_um_convert
1361: (item_id => p_mtl_dtl_rec.inventory_item_id
1362: ,precision => gme_common_pvt.g_precision
1363: ,from_quantity => l_prim_qty
1364: ,from_unit => l_primary_um
1365: ,to_unit => l_dtl_um
1366: ,from_name => NULL

Line 1453: l_transaction_rec.transaction_type_id := gme_common_pvt.g_ing_issue;

1449: l_prim_qty := NULL;
1450: l_sec_qty := NULL;
1451: END IF;
1452:
1453: l_transaction_rec.transaction_type_id := gme_common_pvt.g_ing_issue;
1454: l_transaction_rec.transaction_date := p_trans_date;
1455: l_transaction_rec.transaction_quantity := l_trxn_qty;
1456: l_transaction_rec.secondary_uom_code := p_secondary_uom_code;
1457:

Line 1519: ,precision => gme_common_pvt.g_precision

1515: l_from_um := p_mtl_dtl_rec.dtl_um;
1516: l_to_um := p_rsrv_rec.primary_uom_code;
1517: l_prim_qty := inv_convert.inv_um_convert
1518: (item_id => p_mtl_dtl_rec.inventory_item_id
1519: ,precision => gme_common_pvt.g_precision
1520: ,from_quantity => l_trxn_qty
1521: ,from_unit => l_from_um
1522: ,to_unit => l_to_um
1523: ,from_name => NULL

Line 1552: IF l_transaction_rec.transaction_type_id = gme_common_pvt.g_ing_issue THEN

1548: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'ext sour line_id'||p_rsrv_rec.external_source_line_id);
1549:
1550: END IF;
1551: IF NVL(p_dispense_ind,'N') = 'Y' THEN
1552: IF l_transaction_rec.transaction_type_id = gme_common_pvt.g_ing_issue THEN
1553: -- For consume
1554: GMO_DISPENSE_GRP.CHANGE_DISPENSE_STATUS
1555: (p_api_version => 1.0,
1556: p_init_msg_list => 'F',

Line 1606: ,x_mmli_tbl OUT NOCOPY gme_common_pvt.mtl_trans_lots_inter_tbl

1602:
1603: PROCEDURE constr_mmti_from_reservation
1604: (p_rsrv_rec IN mtl_reservations%ROWTYPE
1605: ,x_mmti_rec OUT NOCOPY mtl_transactions_interface%ROWTYPE
1606: ,x_mmli_tbl OUT NOCOPY gme_common_pvt.mtl_trans_lots_inter_tbl
1607: ,x_return_status OUT NOCOPY VARCHAR2) IS
1608:
1609: l_api_name CONSTANT VARCHAR2 (30) := 'CONSTR_MMTI_FROM_RESERVATION';
1610: BEGIN

Line 1711: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

1707: ,p_pending_rsrv_ind IN BOOLEAN := NULL
1708: ,p_transacted_qty IN NUMBER := NULL
1709: ,p_exception_qty IN NUMBER := NULL
1710: ,p_force_unconsumed IN VARCHAR2 := fnd_api.g_true
1711: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
1712: ,x_return_status OUT NOCOPY VARCHAR2) IS
1713:
1714: l_api_name CONSTANT VARCHAR2 (30) := 'create_batch_exception';
1715:

Line 1770: IF gme_common_pvt.g_display_unconsumed_material = 1 THEN

1766:
1767: IF p_force_unconsumed = fnd_api.g_true THEN
1768: l_display_unconsumed := fnd_api.g_true;
1769: ELSIF p_force_unconsumed = fnd_api.g_false THEN
1770: IF gme_common_pvt.g_display_unconsumed_material = 1 THEN
1771: l_display_unconsumed := fnd_api.g_true;
1772: ELSE
1773: l_display_unconsumed := fnd_api.g_false;
1774: END IF;

Line 1777: IF p_material_dtl_rec.line_type = gme_common_pvt.g_line_type_ing AND p_material_dtl_rec.phantom_line_id IS NOT NULL THEN

1773: l_display_unconsumed := fnd_api.g_false;
1774: END IF;
1775: END IF;
1776:
1777: IF p_material_dtl_rec.line_type = gme_common_pvt.g_line_type_ing AND p_material_dtl_rec.phantom_line_id IS NOT NULL THEN
1778: -- don't report the phantom ingredients; just return; phantom products will be reported
1779: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1780: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' called for phantom ingredient... returning, only report for phantom product');
1781: END IF;

Line 1785: IF p_pending_move_order_ind IS NULL AND p_material_dtl_rec.line_type = gme_common_pvt.g_line_type_ing THEN

1781: END IF;
1782: RAISE error_no_exception;
1783: END IF;
1784:
1785: IF p_pending_move_order_ind IS NULL AND p_material_dtl_rec.line_type = gme_common_pvt.g_line_type_ing THEN
1786: l_pending_mo_ind := gme_move_orders_pvt.pending_move_orders_exist
1787: (p_organization_id => p_material_dtl_rec.organization_id
1788: ,p_batch_id => p_material_dtl_rec.batch_id
1789: ,p_material_detail_id => p_material_dtl_rec.material_detail_id);

Line 1795: IF p_material_dtl_rec.line_type = gme_common_pvt.g_line_type_ing THEN

1791: l_pending_mo_ind := NVL(p_pending_move_order_ind, FALSE);
1792: END IF;
1793:
1794: IF p_pending_rsrv_ind IS NULL THEN
1795: IF p_material_dtl_rec.line_type = gme_common_pvt.g_line_type_ing THEN
1796: l_pending_rsrv_ind:= gme_reservations_pvt.pending_reservations_exist
1797: (p_organization_id => p_material_dtl_rec.organization_id
1798: ,p_batch_id => p_material_dtl_rec.batch_id
1799: ,p_material_detail_id => p_material_dtl_rec.material_detail_id);

Line 1827: l_exceptions_rec.exception_qty := ROUND(l_exceptions_rec.exception_qty, gme_common_pvt.g_precision);

1823: l_exceptions_rec.material_detail_id := p_material_dtl_rec.material_detail_id;
1824: l_exceptions_rec.batch_id := p_material_dtl_rec.batch_id;
1825: l_exceptions_rec.transacted_qty := NVL(p_transacted_qty, p_material_dtl_rec.actual_qty);
1826: l_exceptions_rec.exception_qty := NVL(p_exception_qty, p_material_dtl_rec.plan_qty - p_material_dtl_rec.actual_qty);
1827: l_exceptions_rec.exception_qty := ROUND(l_exceptions_rec.exception_qty, gme_common_pvt.g_precision);
1828:
1829: IF l_pending_rsrv_ind OR l_pending_mo_ind OR
1830: (l_display_unconsumed = FND_API.g_true AND l_exceptions_rec.exception_qty > 0) OR
1831: -- next line is for negative IB

Line 1836: IF NOT gme_common_pvt.insert_exceptions(p_exception_rec => l_exceptions_rec) THEN

1832: (l_display_unconsumed = FND_API.g_true AND p_exception_qty < 0) THEN
1833: i := x_exception_material_tbl.COUNT + 1;
1834: x_exception_material_tbl(i) := l_exceptions_rec;
1835:
1836: IF NOT gme_common_pvt.insert_exceptions(p_exception_rec => l_exceptions_rec) THEN
1837: RAISE error_insert_exceptions;
1838: END IF;
1839:
1840: x_return_status := gme_common_pvt.g_exceptions_err;

Line 1840: x_return_status := gme_common_pvt.g_exceptions_err;

1836: IF NOT gme_common_pvt.insert_exceptions(p_exception_rec => l_exceptions_rec) THEN
1837: RAISE error_insert_exceptions;
1838: END IF;
1839:
1840: x_return_status := gme_common_pvt.g_exceptions_err;
1841: ELSE
1842: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1843: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception not found');
1844: END IF;

Line 1879: AND line_type = gme_common_pvt.g_line_type_ing

1875: CURSOR cur_get_phantom_ingred(v_batch_id NUMBER) IS
1876: SELECT *
1877: FROM gme_material_details
1878: WHERE batch_id = v_batch_id
1879: AND line_type = gme_common_pvt.g_line_type_ing
1880: AND phantom_type <> 0;
1881:
1882: CURSOR Cur_associated_step(v_matl_dtl_id NUMBER) IS
1883: SELECT s.batchstep_id

Line 1892: l_matl_dtl_tab gme_common_pvt.material_details_tab;

1888: l_api_name CONSTANT VARCHAR2 (30) := 'check_unexploded_phantom';
1889:
1890: l_step_id NUMBER;
1891:
1892: l_matl_dtl_tab gme_common_pvt.material_details_tab;
1893:
1894: l_matl_dtl_id NUMBER;
1895: l_phantom_id NUMBER;
1896: l_release_type NUMBER;

Line 1925: IF p_auto_by_step IN (0,1) AND l_release_type = gme_common_pvt.g_mtl_autobystep_release THEN

1921: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' phantom ingredient found: material_detail_id='||l_matl_dtl_id);
1922: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' partner phantom batch id: batch_id='||l_phantom_id);
1923: END IF;
1924:
1925: IF p_auto_by_step IN (0,1) AND l_release_type = gme_common_pvt.g_mtl_autobystep_release THEN
1926: OPEN Cur_associated_step(l_matl_dtl_id);
1927: FETCH Cur_associated_step INTO l_step_id;
1928: IF Cur_associated_step%NOTFOUND THEN
1929: l_release_type := gme_common_pvt.g_mtl_auto_release;

Line 1929: l_release_type := gme_common_pvt.g_mtl_auto_release;

1925: IF p_auto_by_step IN (0,1) AND l_release_type = gme_common_pvt.g_mtl_autobystep_release THEN
1926: OPEN Cur_associated_step(l_matl_dtl_id);
1927: FETCH Cur_associated_step INTO l_step_id;
1928: IF Cur_associated_step%NOTFOUND THEN
1929: l_release_type := gme_common_pvt.g_mtl_auto_release;
1930: END IF;
1931: CLOSE Cur_associated_step;
1932: END IF;
1933:

Line 1934: IF ((p_auto_by_step = 0 AND l_release_type <> gme_common_pvt.g_mtl_autobystep_release) OR

1930: END IF;
1931: CLOSE Cur_associated_step;
1932: END IF;
1933:
1934: IF ((p_auto_by_step = 0 AND l_release_type <> gme_common_pvt.g_mtl_autobystep_release) OR
1935: (p_auto_by_step = 1 AND
1936: l_step_id = p_batchstep_id AND
1937: l_release_type = gme_common_pvt.g_mtl_autobystep_release) OR
1938: (p_auto_by_step = 2)) THEN

Line 1937: l_release_type = gme_common_pvt.g_mtl_autobystep_release) OR

1933:
1934: IF ((p_auto_by_step = 0 AND l_release_type <> gme_common_pvt.g_mtl_autobystep_release) OR
1935: (p_auto_by_step = 1 AND
1936: l_step_id = p_batchstep_id AND
1937: l_release_type = gme_common_pvt.g_mtl_autobystep_release) OR
1938: (p_auto_by_step = 2)) THEN
1939: IF l_phantom_id IS NULL THEN
1940: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1941: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' phantom ingredient unexploded: material_detail_id='||l_matl_dtl_id);

Line 1965: gme_common_pvt.log_message ('PM_UNEXPLODED_PHANTOMS');

1961: END IF;
1962:
1963: EXCEPTION
1964: WHEN error_unexp_phantom THEN
1965: gme_common_pvt.log_message ('PM_UNEXPLODED_PHANTOMS');
1966: x_return_status := FND_API.G_RET_STS_ERROR;
1967: WHEN error_unexp_downstream THEN
1968: NULL;
1969: WHEN OTHERS THEN

Line 2021: IF p_batch_header_rec.batch_type = gme_common_pvt.g_doc_type_fpo THEN

2017:
2018: -- set output structure
2019: x_batch_header_rec := p_batch_header_rec;
2020:
2021: IF p_batch_header_rec.batch_type = gme_common_pvt.g_doc_type_fpo THEN
2022: RAISE error_batch_type;
2023: END IF;
2024:
2025: IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_pending THEN

Line 2025: IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_pending THEN

2021: IF p_batch_header_rec.batch_type = gme_common_pvt.g_doc_type_fpo THEN
2022: RAISE error_batch_type;
2023: END IF;
2024:
2025: IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_pending THEN
2026: RAISE error_batch_status;
2027: END IF;
2028:
2029: -- set actual start date if it's not passed

Line 2067: IF NOT gme_common_pvt.check_validity_rule_dates (

2063: RAISE error_vr_dates;
2064: END IF;*/
2065: --sunitha ch. Bug 5336007 aded call to check_validity_rule_dates and passed p_validate_plan_dates_ind=1
2066: --to validate planned start date against validate rule dates
2067: IF NOT gme_common_pvt.check_validity_rule_dates (
2068: p_validity_rule_id => p_batch_header_rec.recipe_validity_rule_id
2069: ,p_start_date => p_batch_header_rec.actual_start_date
2070: ,p_cmplt_date => p_batch_header_rec.actual_cmplt_date
2071: ,p_batch_header_rec => p_batch_header_rec

Line 2108: gme_common_pvt.log_message ('GME_VALIDITY_OBSO_OR_ONHOLD');

2104: NULL;
2105: WHEN error_vr_dates THEN
2106: x_return_status := FND_API.G_RET_STS_ERROR;
2107: WHEN error_validity_status THEN
2108: gme_common_pvt.log_message ('GME_VALIDITY_OBSO_OR_ONHOLD');
2109: x_return_status := FND_API.G_RET_STS_ERROR;
2110: WHEN error_vr_not_found THEN
2111: gme_common_pvt.log_message ('GME_API_INVALID_VALIDITY');
2112: x_return_status := FND_API.G_RET_STS_ERROR;

Line 2111: gme_common_pvt.log_message ('GME_API_INVALID_VALIDITY');

2107: WHEN error_validity_status THEN
2108: gme_common_pvt.log_message ('GME_VALIDITY_OBSO_OR_ONHOLD');
2109: x_return_status := FND_API.G_RET_STS_ERROR;
2110: WHEN error_vr_not_found THEN
2111: gme_common_pvt.log_message ('GME_API_INVALID_VALIDITY');
2112: x_return_status := FND_API.G_RET_STS_ERROR;
2113: WHEN error_phantom THEN
2114: gme_common_pvt.log_message ('PM_INVALID_PHANTOM_ACTION');
2115: x_return_status := FND_API.G_RET_STS_ERROR;

Line 2114: gme_common_pvt.log_message ('PM_INVALID_PHANTOM_ACTION');

2110: WHEN error_vr_not_found THEN
2111: gme_common_pvt.log_message ('GME_API_INVALID_VALIDITY');
2112: x_return_status := FND_API.G_RET_STS_ERROR;
2113: WHEN error_phantom THEN
2114: gme_common_pvt.log_message ('PM_INVALID_PHANTOM_ACTION');
2115: x_return_status := FND_API.G_RET_STS_ERROR;
2116: WHEN error_batch_type OR error_batch_status THEN
2117: gme_common_pvt.log_message('GME_API_INVALID_BATCH_REL');
2118: x_return_status := fnd_api.g_ret_sts_error;

Line 2117: gme_common_pvt.log_message('GME_API_INVALID_BATCH_REL');

2113: WHEN error_phantom THEN
2114: gme_common_pvt.log_message ('PM_INVALID_PHANTOM_ACTION');
2115: x_return_status := FND_API.G_RET_STS_ERROR;
2116: WHEN error_batch_type OR error_batch_status THEN
2117: gme_common_pvt.log_message('GME_API_INVALID_BATCH_REL');
2118: x_return_status := fnd_api.g_ret_sts_error;
2119: WHEN error_future_date THEN
2120: fnd_message.set_name ('GMA', 'SY_NOFUTUREDATE');
2121: fnd_msg_pub.ADD;