85:
86: PRAGMA exception_init (locked_by_other_user, -54);
87:
88: BEGIN
89: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
90: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
91: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Completing batch_id='||p_batch_header_rec.batch_id);
92: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' actual_cmplt_date='||to_char(p_batch_header_rec.actual_cmplt_date, 'YYYY-MON-DD HH24:MI:SS'));
93: END IF;
86: PRAGMA exception_init (locked_by_other_user, -54);
87:
88: BEGIN
89: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
90: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
91: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Completing batch_id='||p_batch_header_rec.batch_id);
92: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' actual_cmplt_date='||to_char(p_batch_header_rec.actual_cmplt_date, 'YYYY-MON-DD HH24:MI:SS'));
93: END IF;
94:
87:
88: BEGIN
89: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
90: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
91: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Completing batch_id='||p_batch_header_rec.batch_id);
92: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' actual_cmplt_date='||to_char(p_batch_header_rec.actual_cmplt_date, 'YYYY-MON-DD HH24:MI:SS'));
93: END IF;
94:
95: /* Set the return status to success initially */
88: BEGIN
89: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
90: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
91: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Completing batch_id='||p_batch_header_rec.batch_id);
92: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' actual_cmplt_date='||to_char(p_batch_header_rec.actual_cmplt_date, 'YYYY-MON-DD HH24:MI:SS'));
93: END IF;
94:
95: /* Set the return status to success initially */
96: x_return_status := FND_API.G_RET_STS_SUCCESS;
211: IF l_exception_qty < 0 THEN
212: l_exception_qty := 0;
213: END IF;
214:
215: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
216: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
217: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
218: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
219: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
212: l_exception_qty := 0;
213: END IF;
214:
215: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
216: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
217: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
218: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
219: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
220: END IF;
213: END IF;
214:
215: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
216: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
217: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
218: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
219: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
220: END IF;
221:
214:
215: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
216: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
217: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
218: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
219: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
220: END IF;
221:
222: gme_release_batch_pvt.create_batch_exception
215: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
216: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
217: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
218: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
219: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
220: END IF;
221:
222: gme_release_batch_pvt.create_batch_exception
223: (p_material_dtl_rec => l_matl_dtl_rec
326: IF l_exception_qty < 0 THEN
327: l_exception_qty := 0;
328: END IF;
329:
330: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
331: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
332: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
333: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
334: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
327: l_exception_qty := 0;
328: END IF;
329:
330: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
331: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
332: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
333: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
334: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
335: END IF;
328: END IF;
329:
330: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
331: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
332: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
333: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
334: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
335: END IF;
336:
329:
330: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
331: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
332: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
333: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
334: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
335: END IF;
336:
337: gme_release_batch_pvt.create_batch_exception
330: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
331: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
332: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
333: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
334: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
335: END IF;
336:
337: gme_release_batch_pvt.create_batch_exception
338: (p_material_dtl_rec => l_matl_dtl_rec
361: -- (p_batch_header_rec => p_batch_header_rec
362: (p_batch_header_rec => x_batch_header_rec
363: ,p_original_status => gme_common_pvt.g_batch_wip
364: ,p_event_id => NVL(gme_common_pvt.g_transaction_header_id,-9999)) THEN
365: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
366: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' create history returned error');
367: END IF;
368: END IF;
369:
362: (p_batch_header_rec => x_batch_header_rec
363: ,p_original_status => gme_common_pvt.g_batch_wip
364: ,p_event_id => NVL(gme_common_pvt.g_transaction_header_id,-9999)) THEN
365: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
366: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' create history returned error');
367: END IF;
368: END IF;
369:
370: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
366: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' create history returned error');
367: END IF;
368: END IF;
369:
370: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
371: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
372: END IF;
373:
374: EXCEPTION
367: END IF;
368: END IF;
369:
370: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
371: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
372: END IF;
373:
374: EXCEPTION
375: WHEN error_update_batch THEN
387: );
388: x_return_status := FND_API.G_RET_STS_ERROR;
389: WHEN OTHERS THEN
390: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
391: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
392: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
393: END IF;
394: x_return_status := FND_API.g_ret_sts_unexp_error;
395: END complete_batch;
388: x_return_status := FND_API.G_RET_STS_ERROR;
389: WHEN OTHERS THEN
390: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
391: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
392: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
393: END IF;
394: x_return_status := FND_API.g_ret_sts_unexp_error;
395: END complete_batch;
396:
425:
426:
427: BEGIN
428:
429: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
430: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
431: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Processing material material_detail_id='||p_material_detail_rec.material_detail_id);
432: END IF;
433:
426:
427: BEGIN
428:
429: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
430: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
431: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Processing material material_detail_id='||p_material_detail_rec.material_detail_id);
432: END IF;
433:
434: /* Set the return status to success initially */
427: BEGIN
428:
429: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
430: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
431: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Processing material material_detail_id='||p_material_detail_rec.material_detail_id);
432: END IF;
433:
434: /* Set the return status to success initially */
435: x_return_status := FND_API.G_RET_STS_SUCCESS;
450: RAISE error_fetch_batch;
451: END IF;
452:
453: IF l_phantom_batch_rec.batch_status IN (gme_common_pvt.g_batch_pending, gme_common_pvt.g_batch_wip) THEN
454: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
455: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' processing phantom ingredient material_detail_id='||l_matl_dtl_rec.material_detail_id);
456: END IF;
457: -- pass in the phantom line id so that release batch will know to yield that product
458: l_in_phantom_batch_rec := l_phantom_batch_rec;
451: END IF;
452:
453: IF l_phantom_batch_rec.batch_status IN (gme_common_pvt.g_batch_pending, gme_common_pvt.g_batch_wip) THEN
454: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
455: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' processing phantom ingredient material_detail_id='||l_matl_dtl_rec.material_detail_id);
456: END IF;
457: -- pass in the phantom line id so that release batch will know to yield that product
458: l_in_phantom_batch_rec := l_phantom_batch_rec;
459:
512:
513: -- if actual qty is met, we still need to see if there are pending product lots...
514: -- this is not required in yield material... it's a requirement of complete batch
515: IF l_matl_dtl_rec.actual_qty >= l_matl_dtl_rec.wip_plan_qty THEN
516: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
517: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception after yield_material not for unyielded but for possibility of pplots for material_detail_id='||l_matl_dtl_rec.material_detail_id);
518: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
519: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
520: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_matl_dtl_rec.actual_qty - l_matl_dtl_rec.wip_plan_qty));
513: -- if actual qty is met, we still need to see if there are pending product lots...
514: -- this is not required in yield material... it's a requirement of complete batch
515: IF l_matl_dtl_rec.actual_qty >= l_matl_dtl_rec.wip_plan_qty THEN
516: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
517: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception after yield_material not for unyielded but for possibility of pplots for material_detail_id='||l_matl_dtl_rec.material_detail_id);
518: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
519: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
520: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_matl_dtl_rec.actual_qty - l_matl_dtl_rec.wip_plan_qty));
521: END IF;
514: -- this is not required in yield material... it's a requirement of complete batch
515: IF l_matl_dtl_rec.actual_qty >= l_matl_dtl_rec.wip_plan_qty THEN
516: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
517: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception after yield_material not for unyielded but for possibility of pplots for material_detail_id='||l_matl_dtl_rec.material_detail_id);
518: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
519: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
520: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_matl_dtl_rec.actual_qty - l_matl_dtl_rec.wip_plan_qty));
521: END IF;
522:
515: IF l_matl_dtl_rec.actual_qty >= l_matl_dtl_rec.wip_plan_qty THEN
516: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
517: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception after yield_material not for unyielded but for possibility of pplots for material_detail_id='||l_matl_dtl_rec.material_detail_id);
518: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
519: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
520: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_matl_dtl_rec.actual_qty - l_matl_dtl_rec.wip_plan_qty));
521: END IF;
522:
523: gme_release_batch_pvt.create_batch_exception
516: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
517: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception after yield_material not for unyielded but for possibility of pplots for material_detail_id='||l_matl_dtl_rec.material_detail_id);
518: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
519: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
520: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_matl_dtl_rec.actual_qty - l_matl_dtl_rec.wip_plan_qty));
521: END IF;
522:
523: gme_release_batch_pvt.create_batch_exception
524: (p_material_dtl_rec => l_matl_dtl_rec
561: IF l_exception_qty < 0 THEN
562: l_exception_qty := 0;
563: END IF;
564:
565: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
566: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
567: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
568: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
569: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
562: l_exception_qty := 0;
563: END IF;
564:
565: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
566: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
567: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
568: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
569: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
570: END IF;
563: END IF;
564:
565: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
566: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
567: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
568: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
569: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
570: END IF;
571:
564:
565: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
566: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
567: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
568: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
569: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
570: END IF;
571:
572: gme_release_batch_pvt.create_batch_exception
565: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
566: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calling create_batch_exception for material_detail_id='||l_matl_dtl_rec.material_detail_id);
567: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
568: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
569: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
570: END IF;
571:
572: gme_release_batch_pvt.create_batch_exception
573: (p_material_dtl_rec => l_matl_dtl_rec
597: IF NOT gme_material_details_dbl.update_row (l_matl_dtl_rec) THEN
598: RAISE error_update_row;
599: END IF;
600:
601: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
602: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
603: END IF;
604:
605: EXCEPTION
598: RAISE error_update_row;
599: END IF;
600:
601: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
602: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
603: END IF;
604:
605: EXCEPTION
606: WHEN error_fetch_batch OR error_update_row THEN
609: WHEN error_complete_batch OR error_yield_material OR error_get_item OR error_batch_exception THEN
610: NULL;
611: WHEN OTHERS THEN
612: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
613: IF g_debug <= gme_debug.g_log_procedure THEN
614: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
615: END IF;
616: x_return_status := FND_API.g_ret_sts_unexp_error;
617: END process_material;
610: NULL;
611: WHEN OTHERS THEN
612: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
613: IF g_debug <= gme_debug.g_log_procedure THEN
614: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
615: END IF;
616: x_return_status := FND_API.g_ret_sts_unexp_error;
617: END process_material;
618:
657: no_yield_required EXCEPTION;
658:
659: BEGIN
660:
661: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
662: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
663: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
664: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
665: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
658:
659: BEGIN
660:
661: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
662: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
663: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
664: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
665: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
666: 'YYYY-MON-DD HH24:MI:SS'));
659: BEGIN
660:
661: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
662: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
663: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
664: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
665: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
666: 'YYYY-MON-DD HH24:MI:SS'));
667: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
660:
661: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
662: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
663: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
664: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
665: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
666: 'YYYY-MON-DD HH24:MI:SS'));
667: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
668: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
661: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
662: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
663: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
664: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
665: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
666: 'YYYY-MON-DD HH24:MI:SS'));
667: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
668: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
669: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_force_unconsumed='||p_force_unconsumed);
663: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
664: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
665: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
666: 'YYYY-MON-DD HH24:MI:SS'));
667: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
668: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
669: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_force_unconsumed='||p_force_unconsumed);
670: END IF;
671:
664: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
665: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
666: 'YYYY-MON-DD HH24:MI:SS'));
667: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
668: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
669: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_force_unconsumed='||p_force_unconsumed);
670: END IF;
671:
672: /* Set the return status to success initially */
665: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
666: 'YYYY-MON-DD HH24:MI:SS'));
667: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
668: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
669: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_force_unconsumed='||p_force_unconsumed);
670: END IF;
671:
672: /* Set the return status to success initially */
673: x_return_status := FND_API.G_RET_STS_SUCCESS;
689: l_trans_date := NVL(p_trans_date, gme_common_pvt.g_timestamp);
690:
691: l_start_actual_qty := x_actual_qty;
692:
693: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
694: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
695: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(l_trans_date, 'YYYY-MON-DD HH24:MI:SS'));
696: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
697: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
690:
691: l_start_actual_qty := x_actual_qty;
692:
693: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
694: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
695: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(l_trans_date, 'YYYY-MON-DD HH24:MI:SS'));
696: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
697: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
698: END IF;
691: l_start_actual_qty := x_actual_qty;
692:
693: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
694: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
695: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(l_trans_date, 'YYYY-MON-DD HH24:MI:SS'));
696: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
697: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
698: END IF;
699:
692:
693: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
694: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
695: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(l_trans_date, 'YYYY-MON-DD HH24:MI:SS'));
696: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
697: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
698: END IF;
699:
700: IF l_yield_qty <= x_actual_qty THEN
693: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
694: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
695: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(l_trans_date, 'YYYY-MON-DD HH24:MI:SS'));
696: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
697: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
698: END IF;
699:
700: IF l_yield_qty <= x_actual_qty THEN
701: -- this returns as success for now; there's nothing additional to yield
702: RAISE error_nothing_to_yield;
703: END IF;
704:
705: IF p_material_dtl_rec.subinventory IS NULL THEN
706: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
707: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinv on material is NULL; cant yield anything; get exceptions');
708: END IF;
709: RAISE error_get_exception;
710: END IF;
703: END IF;
704:
705: IF p_material_dtl_rec.subinventory IS NULL THEN
706: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
707: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinv on material is NULL; cant yield anything; get exceptions');
708: END IF;
709: RAISE error_get_exception;
710: END IF;
711:
719: ,p_subinventory => p_material_dtl_rec.subinventory
720: ,p_item_control => NVL(p_item_rec.location_control_code,1)
721: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
722: ,p_action => gme_common_pvt.g_prod_comp_txn_action);
723: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
725: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
726: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
727: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
720: ,p_item_control => NVL(p_item_rec.location_control_code,1)
721: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
722: ,p_action => gme_common_pvt.g_prod_comp_txn_action);
723: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
725: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
726: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
727: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
721: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
722: ,p_action => gme_common_pvt.g_prod_comp_txn_action);
723: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
725: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
726: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
727: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
722: ,p_action => gme_common_pvt.g_prod_comp_txn_action);
723: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
725: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
726: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
727: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
723: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
725: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
726: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
727: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
731: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
725: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
726: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
727: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
731: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
732: END IF;
725: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
726: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
727: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
731: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
732: END IF;
733: IF l_eff_locator_control <> 1 THEN
726: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
727: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
731: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
732: END IF;
733: IF l_eff_locator_control <> 1 THEN
734: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
727: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
731: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
732: END IF;
733: IF l_eff_locator_control <> 1 THEN
734: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
735: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' locator on material is NULL and material is eff locator control; cant yield anything; get exceptions');
730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
731: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
732: END IF;
733: IF l_eff_locator_control <> 1 THEN
734: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
735: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' locator on material is NULL and material is eff locator control; cant yield anything; get exceptions');
736: END IF;
737: RAISE error_get_exception;
738: END IF;
731: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
732: END IF;
733: IF l_eff_locator_control <> 1 THEN
734: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
735: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' locator on material is NULL and material is eff locator control; cant yield anything; get exceptions');
736: END IF;
737: RAISE error_get_exception;
738: END IF;
739: END IF;
752: END IF;
753: END IF; -- IF p_revision_qty_control_code = 2
754:
755: IF p_item_rec.lot_control_code = 1 THEN -- not lot control
756: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
757: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' item not lot control');
758: END IF;
759:
760: build_and_create_transaction
753: END IF; -- IF p_revision_qty_control_code = 2
754:
755: IF p_item_rec.lot_control_code = 1 THEN -- not lot control
756: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
757: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' item not lot control');
758: END IF;
759:
760: build_and_create_transaction
761: (p_mtl_dtl_rec => p_material_dtl_rec
784: END IF;
785:
786: i := 1;
787:
788: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
789: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
791: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' count from pplot='||l_pending_product_lot_tab.COUNT);
792: END IF;
785:
786: i := 1;
787:
788: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
789: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
791: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' count from pplot='||l_pending_product_lot_tab.COUNT);
792: END IF;
793:
786: i := 1;
787:
788: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
789: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
791: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' count from pplot='||l_pending_product_lot_tab.COUNT);
792: END IF;
793:
794: WHILE l_yield_qty > x_actual_qty AND i <= l_pending_product_lot_tab.COUNT LOOP
787:
788: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
789: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
791: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' count from pplot='||l_pending_product_lot_tab.COUNT);
792: END IF;
793:
794: WHILE l_yield_qty > x_actual_qty AND i <= l_pending_product_lot_tab.COUNT LOOP
795:
792: END IF;
793:
794: WHILE l_yield_qty > x_actual_qty AND i <= l_pending_product_lot_tab.COUNT LOOP
795:
796: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
797: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop i='||i);
798: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop x_actual_qty='||x_actual_qty);
799: END IF;
800:
793:
794: WHILE l_yield_qty > x_actual_qty AND i <= l_pending_product_lot_tab.COUNT LOOP
795:
796: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
797: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop i='||i);
798: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop x_actual_qty='||x_actual_qty);
799: END IF;
800:
801: l_pp_lot_rec := l_pending_product_lot_tab(i);
794: WHILE l_yield_qty > x_actual_qty AND i <= l_pending_product_lot_tab.COUNT LOOP
795:
796: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
797: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop i='||i);
798: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop x_actual_qty='||x_actual_qty);
799: END IF;
800:
801: l_pp_lot_rec := l_pending_product_lot_tab(i);
802:
823: IF x_actual_qty < l_yield_qty THEN
824: RAISE error_get_exception;
825: END IF;
826:
827: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
828: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
829: END IF;
830:
831:
824: RAISE error_get_exception;
825: END IF;
826:
827: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
828: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
829: END IF;
830:
831:
832: EXCEPTION
832: EXCEPTION
833: WHEN error_build_trxn OR error_get_pplot OR no_yield_required THEN
834: NULL;
835: WHEN error_nothing_to_yield THEN
836: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exiting without yield because actual_qty= '||x_actual_qty||' and target yield qty = '||l_yield_qty);
838: END IF;
839:
840: WHEN error_get_exception THEN
833: WHEN error_build_trxn OR error_get_pplot OR no_yield_required THEN
834: NULL;
835: WHEN error_nothing_to_yield THEN
836: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exiting without yield because actual_qty= '||x_actual_qty||' and target yield qty = '||l_yield_qty);
838: END IF;
839:
840: WHEN error_get_exception THEN
841: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exiting without yield because actual_qty= '||x_actual_qty||' and target yield qty = '||l_yield_qty);
838: END IF;
839:
840: WHEN error_get_exception THEN
841: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
843: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
844: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
845: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
838: END IF;
839:
840: WHEN error_get_exception THEN
841: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
843: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
844: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
845: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
846: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_yield_qty - x_actual_qty));
839:
840: WHEN error_get_exception THEN
841: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
843: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
844: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
845: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
846: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_yield_qty - x_actual_qty));
847: END IF;
840: WHEN error_get_exception THEN
841: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
843: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
844: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
845: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
846: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_yield_qty - x_actual_qty));
847: END IF;
848:
841: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
843: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
844: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
845: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
846: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_yield_qty - x_actual_qty));
847: END IF;
848:
849: gme_release_batch_pvt.create_batch_exception
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
843: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
844: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
845: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
846: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_yield_qty - x_actual_qty));
847: END IF;
848:
849: gme_release_batch_pvt.create_batch_exception
850: (p_material_dtl_rec => p_material_dtl_rec
857: ,x_return_status => x_return_status);
858:
859: WHEN OTHERS THEN
860: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
861: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
862: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
863: END IF;
864: x_return_status := FND_API.g_ret_sts_unexp_error;
865: END yield_material;
858:
859: WHEN OTHERS THEN
860: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
861: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
862: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
863: END IF;
864: x_return_status := FND_API.g_ret_sts_unexp_error;
865: END yield_material;
866:
904: error_create_trxn EXCEPTION;
905: error_relieve_pp_lot EXCEPTION;
906:
907: BEGIN
908: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
909: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
910: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
911: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
912: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
905: error_relieve_pp_lot EXCEPTION;
906:
907: BEGIN
908: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
909: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
910: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
911: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
912: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
913: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
906:
907: BEGIN
908: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
909: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
910: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
911: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
912: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
913: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
914: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
907: BEGIN
908: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
909: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
910: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
911: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
912: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
913: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
914: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
915: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
908: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
909: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
910: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
911: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
912: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
913: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
914: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
915: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
916: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
909: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
910: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
911: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
912: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
913: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
914: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
915: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
916: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
917: END IF;
910: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
911: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
912: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
913: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
914: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
915: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
916: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
917: END IF;
918:
911: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
912: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
913: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
914: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
915: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
916: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
917: END IF;
918:
919: /* Set the return status to success initially */
912: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
913: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
914: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
915: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
916: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
917: END IF;
918:
919: /* Set the return status to success initially */
920: x_return_status := FND_API.G_RET_STS_SUCCESS;
934: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
935: RAISE error_build_mmti;
936: END IF;
937:
938: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
939: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_dtl_qty := '||l_dtl_qty);
940: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_sec_qty := '||l_sec_qty);
941: END IF;
942:
935: RAISE error_build_mmti;
936: END IF;
937:
938: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
939: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_dtl_qty := '||l_dtl_qty);
940: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_sec_qty := '||l_sec_qty);
941: END IF;
942:
943: -- Bug 11725091 - Let's fetch this data right up front even though it may not be used.
936: END IF;
937:
938: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
939: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_dtl_qty := '||l_dtl_qty);
940: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_sec_qty := '||l_sec_qty);
941: END IF;
942:
943: -- Bug 11725091 - Let's fetch this data right up front even though it may not be used.
944: OPEN item_no_cursor(p_mtl_dtl_rec.inventory_item_id, p_mtl_dtl_rec.organization_id);
963: ,from_name => NULL
964: ,to_name => NULL);
965:
966: IF l_sec_qty = -99999 THEN
967: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
968: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' inv_convert.inv_um_convert returned error');
969: END IF;
970: l_from_um := p_mtl_dtl_rec.dtl_um;
971: l_to_um := p_sec_uom_code;
964: ,to_name => NULL);
965:
966: IF l_sec_qty = -99999 THEN
967: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
968: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' inv_convert.inv_um_convert returned error');
969: END IF;
970: l_from_um := p_mtl_dtl_rec.dtl_um;
971: l_to_um := p_sec_uom_code;
972: RAISE um_convert_error;
973: END IF;
974: END IF;
975: END IF;
976:
977: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
978: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_trxn_qty := '||l_trxn_qty);
979: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_sec_qty := '||l_sec_qty);
980: END IF;
981:
974: END IF;
975: END IF;
976:
977: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
978: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_trxn_qty := '||l_trxn_qty);
979: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_sec_qty := '||l_sec_qty);
980: END IF;
981:
982: IF p_mtl_dtl_rec.line_type = gme_common_pvt.g_line_type_prod THEN
975: END IF;
976:
977: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
978: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_trxn_qty := '||l_trxn_qty);
979: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_sec_qty := '||l_sec_qty);
980: END IF;
981:
982: IF p_mtl_dtl_rec.line_type = gme_common_pvt.g_line_type_prod THEN
983: l_transaction_rec.transaction_type_id := gme_common_pvt.g_prod_completion;
984: ELSE
985: l_transaction_rec.transaction_type_id := gme_common_pvt.g_byprod_completion;
986: END IF;
987:
988: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
989: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_transaction_rec.transaction_type_id := '||l_transaction_rec.transaction_type_id);
990: END IF;
991:
992: l_transaction_rec.transaction_date := p_trans_date;
985: l_transaction_rec.transaction_type_id := gme_common_pvt.g_byprod_completion;
986: END IF;
987:
988: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
989: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_transaction_rec.transaction_type_id := '||l_transaction_rec.transaction_type_id);
990: END IF;
991:
992: l_transaction_rec.transaction_date := p_trans_date;
993: l_transaction_rec.transaction_quantity := l_trxn_qty;
996: IF l_sec_qty IS NOT NULL THEN
997: l_transaction_rec.secondary_transaction_quantity := l_sec_qty;
998: END IF;
999:
1000: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1001: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_date='||to_char(l_transaction_rec.transaction_date
1002: ,'YYYY-MON-DD HH24:MI:SS'));
1003: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_qty='||l_transaction_rec.transaction_quantity);
1004: END IF;
997: l_transaction_rec.secondary_transaction_quantity := l_sec_qty;
998: END IF;
999:
1000: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1001: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_date='||to_char(l_transaction_rec.transaction_date
1002: ,'YYYY-MON-DD HH24:MI:SS'));
1003: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_qty='||l_transaction_rec.transaction_quantity);
1004: END IF;
1005:
999:
1000: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1001: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_date='||to_char(l_transaction_rec.transaction_date
1002: ,'YYYY-MON-DD HH24:MI:SS'));
1003: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_qty='||l_transaction_rec.transaction_quantity);
1004: END IF;
1005:
1006: l_transaction_rec.transaction_uom := p_mtl_dtl_rec.dtl_um;
1007:
1019: ,from_name => NULL
1020: ,to_name => NULL);
1021:
1022: IF l_prim_qty = -99999 THEN
1023: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1024: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' inv_convert.inv_um_convert returned error');
1025: END IF;
1026: l_from_um := p_mtl_dtl_rec.dtl_um;
1027: l_to_um := l_prim_uom;
1020: ,to_name => NULL);
1021:
1022: IF l_prim_qty = -99999 THEN
1023: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1024: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' inv_convert.inv_um_convert returned error');
1025: END IF;
1026: l_from_um := p_mtl_dtl_rec.dtl_um;
1027: l_to_um := l_prim_uom;
1028: RAISE um_convert_error;
1030: END IF;
1031:
1032: -- l_prim_qty will always have a value at this point.
1033: l_transaction_rec.primary_quantity := l_prim_qty;
1034: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1035: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' primary_qty is known:'||l_transaction_rec.primary_quantity);
1036: END IF;
1037:
1038: IF l_lot_tbl.count > 0 THEN
1031:
1032: -- l_prim_qty will always have a value at this point.
1033: l_transaction_rec.primary_quantity := l_prim_qty;
1034: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1035: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' primary_qty is known:'||l_transaction_rec.primary_quantity);
1036: END IF;
1037:
1038: IF l_lot_tbl.count > 0 THEN
1039: IF l_lot_tbl(1).lot_number IS NOT NULL THEN
1050: ,p_mmli_tbl => l_lot_tbl
1051: ,x_return_status => x_return_status);
1052:
1053: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1054: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1055: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' gme_transactions_pvt.create_transaction returned error');
1056: END IF;
1057: RAISE error_create_trxn;
1058: END IF;
1051: ,x_return_status => x_return_status);
1052:
1053: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1054: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1055: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' gme_transactions_pvt.create_transaction returned error');
1056: END IF;
1057: RAISE error_create_trxn;
1058: END IF;
1059:
1071: RAISE error_relieve_pp_lot;
1072: END IF;
1073: END IF;
1074:
1075: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1076: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1077: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1078: END IF;
1079:
1072: END IF;
1073: END IF;
1074:
1075: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1076: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1077: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1078: END IF;
1079:
1080: EXCEPTION
1073: END IF;
1074:
1075: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1076: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1077: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1078: END IF;
1079:
1080: EXCEPTION
1081: WHEN um_convert_error THEN
1089: WHEN error_create_trxn OR error_relieve_pp_lot OR error_build_mmti THEN
1090: NULL;
1091: WHEN OTHERS THEN
1092: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1093: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1094: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1095: END IF;
1096: x_return_status := FND_API.g_ret_sts_unexp_error;
1097: END build_and_create_transaction;
1090: NULL;
1091: WHEN OTHERS THEN
1092: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1093: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1094: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1095: END IF;
1096: x_return_status := FND_API.g_ret_sts_unexp_error;
1097: END build_and_create_transaction;
1098:
1111:
1112: l_api_name CONSTANT VARCHAR2 (30) := 'CONSTR_MMTI';
1113: BEGIN
1114:
1115: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1116: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1117: END IF;
1118:
1119: /* Initially let us assign the return status to success */
1112: l_api_name CONSTANT VARCHAR2 (30) := 'CONSTR_MMTI';
1113: BEGIN
1114:
1115: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1116: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1117: END IF;
1118:
1119: /* Initially let us assign the return status to success */
1120: x_return_status := FND_API.g_ret_sts_success;
1141: x_dtl_qty := p_pp_lot_rec.quantity;
1142: x_sec_qty := p_pp_lot_rec.secondary_quantity;
1143: END IF;
1144:
1145: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1146: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1147: END IF;
1148:
1149: EXCEPTION
1142: x_sec_qty := p_pp_lot_rec.secondary_quantity;
1143: END IF;
1144:
1145: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1146: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1147: END IF;
1148:
1149: EXCEPTION
1150: WHEN OTHERS THEN
1148:
1149: EXCEPTION
1150: WHEN OTHERS THEN
1151: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1152: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1153: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1154: END IF;
1155: x_return_status := FND_API.g_ret_sts_unexp_error;
1156: END constr_mmti;
1149: EXCEPTION
1150: WHEN OTHERS THEN
1151: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1152: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1153: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1154: END IF;
1155: x_return_status := FND_API.g_ret_sts_unexp_error;
1156: END constr_mmti;
1157:
1193: error_cmplt_date EXCEPTION;
1194: error_future_date EXCEPTION;
1195: error_vr_dates EXCEPTION;
1196: BEGIN
1197: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1198: gme_debug.g_log_procedure THEN
1199: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
1200: || l_api_name);
1201: END IF;
1194: error_future_date EXCEPTION;
1195: error_vr_dates EXCEPTION;
1196: BEGIN
1197: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1198: gme_debug.g_log_procedure THEN
1199: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
1200: || l_api_name);
1201: END IF;
1202:
1195: error_vr_dates EXCEPTION;
1196: BEGIN
1197: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1198: gme_debug.g_log_procedure THEN
1199: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
1200: || l_api_name);
1201: END IF;
1202:
1203: x_return_status := FND_API.g_ret_sts_success;
1284: ELSIF x_batch_header_rec.actual_cmplt_date > SYSDATE THEN
1285: RAISE error_future_date;
1286: END IF;
1287:
1288: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1289: gme_debug.g_log_procedure THEN
1290: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
1291: END IF;
1292:
1285: RAISE error_future_date;
1286: END IF;
1287:
1288: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1289: gme_debug.g_log_procedure THEN
1290: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
1291: END IF;
1292:
1293: EXCEPTION
1286: END IF;
1287:
1288: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1289: gme_debug.g_log_procedure THEN
1290: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
1291: END IF;
1292:
1293: EXCEPTION
1294: WHEN error_phantom THEN
1313: x_return_status := FND_API.G_RET_STS_ERROR;
1314: WHEN OTHERS THEN
1315: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1316:
1317: IF g_debug <= gme_debug.g_log_procedure THEN
1318: gme_debug.put_line ( 'Unexpected error: '
1319: || g_pkg_name
1320: || '.'
1321: || l_api_name
1314: WHEN OTHERS THEN
1315: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1316:
1317: IF g_debug <= gme_debug.g_log_procedure THEN
1318: gme_debug.put_line ( 'Unexpected error: '
1319: || g_pkg_name
1320: || '.'
1321: || l_api_name
1322: || ': '