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
322: IF l_exception_qty < 0 THEN
323: l_exception_qty := 0;
324: END IF;
325:
326: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
327: 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);
328: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
329: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
330: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
323: l_exception_qty := 0;
324: END IF;
325:
326: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
327: 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);
328: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
329: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
330: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
331: END IF;
324: END IF;
325:
326: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
327: 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);
328: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
329: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
330: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
331: END IF;
332:
325:
326: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
327: 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);
328: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
329: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
330: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
331: END IF;
332:
333: gme_release_batch_pvt.create_batch_exception
326: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
327: 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);
328: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
329: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
330: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
331: END IF;
332:
333: gme_release_batch_pvt.create_batch_exception
334: (p_material_dtl_rec => l_matl_dtl_rec
355: IF NOT gme_common_pvt.create_history
356: (p_batch_header_rec => p_batch_header_rec
357: ,p_original_status => gme_common_pvt.g_batch_wip
358: ,p_event_id => NVL(gme_common_pvt.g_transaction_header_id,-9999)) THEN
359: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
360: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' create history returned error');
361: END IF;
362: END IF;
363:
356: (p_batch_header_rec => p_batch_header_rec
357: ,p_original_status => gme_common_pvt.g_batch_wip
358: ,p_event_id => NVL(gme_common_pvt.g_transaction_header_id,-9999)) THEN
359: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
360: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' create history returned error');
361: END IF;
362: END IF;
363:
364: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
360: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' create history returned error');
361: END IF;
362: END IF;
363:
364: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
365: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
366: END IF;
367:
368: EXCEPTION
361: END IF;
362: END IF;
363:
364: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
365: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
366: END IF;
367:
368: EXCEPTION
369: WHEN error_update_batch THEN
381: );
382: x_return_status := FND_API.G_RET_STS_ERROR;
383: WHEN OTHERS THEN
384: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
385: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
386: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
387: END IF;
388: x_return_status := FND_API.g_ret_sts_unexp_error;
389: END complete_batch;
382: x_return_status := FND_API.G_RET_STS_ERROR;
383: WHEN OTHERS THEN
384: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
385: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
386: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
387: END IF;
388: x_return_status := FND_API.g_ret_sts_unexp_error;
389: END complete_batch;
390:
419:
420:
421: BEGIN
422:
423: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
424: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
425: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Processing material material_detail_id='||p_material_detail_rec.material_detail_id);
426: END IF;
427:
420:
421: BEGIN
422:
423: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
424: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
425: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Processing material material_detail_id='||p_material_detail_rec.material_detail_id);
426: END IF;
427:
428: /* Set the return status to success initially */
421: BEGIN
422:
423: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
424: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
425: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Processing material material_detail_id='||p_material_detail_rec.material_detail_id);
426: END IF;
427:
428: /* Set the return status to success initially */
429: x_return_status := FND_API.G_RET_STS_SUCCESS;
444: RAISE error_fetch_batch;
445: END IF;
446:
447: IF l_phantom_batch_rec.batch_status IN (gme_common_pvt.g_batch_pending, gme_common_pvt.g_batch_wip) THEN
448: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
449: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' processing phantom ingredient material_detail_id='||l_matl_dtl_rec.material_detail_id);
450: END IF;
451: -- pass in the phantom line id so that release batch will know to yield that product
452: l_in_phantom_batch_rec := l_phantom_batch_rec;
445: END IF;
446:
447: IF l_phantom_batch_rec.batch_status IN (gme_common_pvt.g_batch_pending, gme_common_pvt.g_batch_wip) THEN
448: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
449: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' processing phantom ingredient material_detail_id='||l_matl_dtl_rec.material_detail_id);
450: END IF;
451: -- pass in the phantom line id so that release batch will know to yield that product
452: l_in_phantom_batch_rec := l_phantom_batch_rec;
453:
506:
507: -- if actual qty is met, we still need to see if there are pending product lots...
508: -- this is not required in yield material... it's a requirement of complete batch
509: IF l_matl_dtl_rec.actual_qty >= l_matl_dtl_rec.wip_plan_qty THEN
510: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
511: 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);
512: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
513: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
514: 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));
507: -- if actual qty is met, we still need to see if there are pending product lots...
508: -- this is not required in yield material... it's a requirement of complete batch
509: IF l_matl_dtl_rec.actual_qty >= l_matl_dtl_rec.wip_plan_qty THEN
510: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
511: 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);
512: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
513: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
514: 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));
515: END IF;
508: -- this is not required in yield material... it's a requirement of complete batch
509: IF l_matl_dtl_rec.actual_qty >= l_matl_dtl_rec.wip_plan_qty THEN
510: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
511: 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);
512: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
513: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
514: 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));
515: END IF;
516:
509: IF l_matl_dtl_rec.actual_qty >= l_matl_dtl_rec.wip_plan_qty THEN
510: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
511: 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);
512: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
513: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
514: 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));
515: END IF;
516:
517: gme_release_batch_pvt.create_batch_exception
510: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
511: 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);
512: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
513: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
514: 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));
515: END IF;
516:
517: gme_release_batch_pvt.create_batch_exception
518: (p_material_dtl_rec => l_matl_dtl_rec
555: IF l_exception_qty < 0 THEN
556: l_exception_qty := 0;
557: END IF;
558:
559: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
560: 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);
561: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
562: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
563: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
556: l_exception_qty := 0;
557: END IF;
558:
559: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
560: 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);
561: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
562: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
563: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
564: END IF;
557: END IF;
558:
559: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
560: 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);
561: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
562: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
563: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
564: END IF;
565:
558:
559: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
560: 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);
561: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
562: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
563: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
564: END IF;
565:
566: gme_release_batch_pvt.create_batch_exception
559: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
560: 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);
561: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' actual_qty='||l_matl_dtl_rec.actual_qty);
562: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
563: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||l_exception_qty);
564: END IF;
565:
566: gme_release_batch_pvt.create_batch_exception
567: (p_material_dtl_rec => l_matl_dtl_rec
590: IF NOT gme_material_details_dbl.update_row (l_matl_dtl_rec) THEN
591: RAISE error_update_row;
592: END IF;
593:
594: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
595: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
596: END IF;
597:
598: EXCEPTION
591: RAISE error_update_row;
592: END IF;
593:
594: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
595: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
596: END IF;
597:
598: EXCEPTION
599: WHEN error_fetch_batch OR error_update_row THEN
602: WHEN error_complete_batch OR error_yield_material OR error_get_item OR error_batch_exception THEN
603: NULL;
604: WHEN OTHERS THEN
605: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
606: IF g_debug <= gme_debug.g_log_procedure THEN
607: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
608: END IF;
609: x_return_status := FND_API.g_ret_sts_unexp_error;
610: END process_material;
603: NULL;
604: WHEN OTHERS THEN
605: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
606: IF g_debug <= gme_debug.g_log_procedure THEN
607: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
608: END IF;
609: x_return_status := FND_API.g_ret_sts_unexp_error;
610: END process_material;
611:
650: no_yield_required EXCEPTION;
651:
652: BEGIN
653:
654: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
655: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
656: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
657: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
658: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
651:
652: BEGIN
653:
654: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
655: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
656: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
657: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
658: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
659: 'YYYY-MON-DD HH24:MI:SS'));
652: BEGIN
653:
654: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
655: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
656: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
657: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
658: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
659: 'YYYY-MON-DD HH24:MI:SS'));
660: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
653:
654: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
655: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
656: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
657: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
658: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
659: 'YYYY-MON-DD HH24:MI:SS'));
660: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
661: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
654: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
655: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
656: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
657: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
658: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
659: 'YYYY-MON-DD HH24:MI:SS'));
660: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
661: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
662: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_force_unconsumed='||p_force_unconsumed);
656: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
657: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
658: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
659: 'YYYY-MON-DD HH24:MI:SS'));
660: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
661: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
662: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_force_unconsumed='||p_force_unconsumed);
663: END IF;
664:
657: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
658: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
659: 'YYYY-MON-DD HH24:MI:SS'));
660: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
661: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
662: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_force_unconsumed='||p_force_unconsumed);
663: END IF;
664:
665: /* Set the return status to success initially */
658: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date,
659: 'YYYY-MON-DD HH24:MI:SS'));
660: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
661: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
662: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_force_unconsumed='||p_force_unconsumed);
663: END IF;
664:
665: /* Set the return status to success initially */
666: x_return_status := FND_API.G_RET_STS_SUCCESS;
682: l_trans_date := NVL(p_trans_date, gme_common_pvt.g_timestamp);
683:
684: l_start_actual_qty := x_actual_qty;
685:
686: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
687: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
688: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(l_trans_date, 'YYYY-MON-DD HH24:MI:SS'));
689: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
690: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
683:
684: l_start_actual_qty := x_actual_qty;
685:
686: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
687: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
688: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(l_trans_date, 'YYYY-MON-DD HH24:MI:SS'));
689: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
690: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
691: END IF;
684: l_start_actual_qty := x_actual_qty;
685:
686: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
687: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
688: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(l_trans_date, 'YYYY-MON-DD HH24:MI:SS'));
689: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
690: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
691: END IF;
692:
685:
686: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
687: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
688: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(l_trans_date, 'YYYY-MON-DD HH24:MI:SS'));
689: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
690: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
691: END IF;
692:
693: IF l_yield_qty <= x_actual_qty THEN
686: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
687: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
688: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(l_trans_date, 'YYYY-MON-DD HH24:MI:SS'));
689: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
690: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
691: END IF;
692:
693: IF l_yield_qty <= x_actual_qty THEN
694: -- this returns as success for now; there's nothing additional to yield
695: RAISE error_nothing_to_yield;
696: END IF;
697:
698: IF p_material_dtl_rec.subinventory IS NULL THEN
699: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
700: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinv on material is NULL; cant yield anything; get exceptions');
701: END IF;
702: RAISE error_get_exception;
703: END IF;
696: END IF;
697:
698: IF p_material_dtl_rec.subinventory IS NULL THEN
699: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
700: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinv on material is NULL; cant yield anything; get exceptions');
701: END IF;
702: RAISE error_get_exception;
703: END IF;
704:
712: ,p_subinventory => p_material_dtl_rec.subinventory
713: ,p_item_control => NVL(p_item_rec.location_control_code,1)
714: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
715: ,p_action => gme_common_pvt.g_prod_comp_txn_action);
716: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
717: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
718: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
719: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
720: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
713: ,p_item_control => NVL(p_item_rec.location_control_code,1)
714: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
715: ,p_action => gme_common_pvt.g_prod_comp_txn_action);
716: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
717: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
718: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
719: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
720: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
714: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
715: ,p_action => gme_common_pvt.g_prod_comp_txn_action);
716: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
717: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
718: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
719: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
720: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
722: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
715: ,p_action => gme_common_pvt.g_prod_comp_txn_action);
716: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
717: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
718: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
719: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
720: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
722: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
723: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
716: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
717: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
718: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
719: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
720: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
722: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
723: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
717: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
718: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
719: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
720: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
722: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
723: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
725: END IF;
718: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
719: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
720: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
722: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
723: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
725: END IF;
726: IF l_eff_locator_control <> 1 THEN
719: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
720: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
722: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
723: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
725: END IF;
726: IF l_eff_locator_control <> 1 THEN
727: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
720: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
722: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
723: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
725: END IF;
726: IF l_eff_locator_control <> 1 THEN
727: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
728: 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');
723: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
725: END IF;
726: IF l_eff_locator_control <> 1 THEN
727: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
728: 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');
729: END IF;
730: RAISE error_get_exception;
731: END IF;
724: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_prod_comp_txn_action);
725: END IF;
726: IF l_eff_locator_control <> 1 THEN
727: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
728: 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');
729: END IF;
730: RAISE error_get_exception;
731: END IF;
732: END IF;
745: END IF;
746: END IF; -- IF p_revision_qty_control_code = 2
747:
748: IF p_item_rec.lot_control_code = 1 THEN -- not lot control
749: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
750: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' item not lot control');
751: END IF;
752:
753: build_and_create_transaction
746: END IF; -- IF p_revision_qty_control_code = 2
747:
748: IF p_item_rec.lot_control_code = 1 THEN -- not lot control
749: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
750: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' item not lot control');
751: END IF;
752:
753: build_and_create_transaction
754: (p_mtl_dtl_rec => p_material_dtl_rec
777: END IF;
778:
779: i := 1;
780:
781: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
782: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
783: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
784: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' count from pplot='||l_pending_product_lot_tab.COUNT);
785: END IF;
778:
779: i := 1;
780:
781: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
782: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
783: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
784: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' count from pplot='||l_pending_product_lot_tab.COUNT);
785: END IF;
786:
779: i := 1;
780:
781: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
782: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
783: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
784: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' count from pplot='||l_pending_product_lot_tab.COUNT);
785: END IF;
786:
787: WHILE l_yield_qty > x_actual_qty AND i <= l_pending_product_lot_tab.COUNT LOOP
780:
781: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
782: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
783: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
784: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' count from pplot='||l_pending_product_lot_tab.COUNT);
785: END IF;
786:
787: WHILE l_yield_qty > x_actual_qty AND i <= l_pending_product_lot_tab.COUNT LOOP
788:
785: END IF;
786:
787: WHILE l_yield_qty > x_actual_qty AND i <= l_pending_product_lot_tab.COUNT LOOP
788:
789: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop i='||i);
791: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop x_actual_qty='||x_actual_qty);
792: END IF;
793:
786:
787: WHILE l_yield_qty > x_actual_qty AND i <= l_pending_product_lot_tab.COUNT LOOP
788:
789: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop i='||i);
791: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop x_actual_qty='||x_actual_qty);
792: END IF;
793:
794: l_pp_lot_rec := l_pending_product_lot_tab(i);
787: WHILE l_yield_qty > x_actual_qty AND i <= l_pending_product_lot_tab.COUNT LOOP
788:
789: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop i='||i);
791: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' pending lot loop x_actual_qty='||x_actual_qty);
792: END IF;
793:
794: l_pp_lot_rec := l_pending_product_lot_tab(i);
795:
816: IF x_actual_qty < l_yield_qty THEN
817: RAISE error_get_exception;
818: END IF;
819:
820: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
821: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
822: END IF;
823:
824:
817: RAISE error_get_exception;
818: END IF;
819:
820: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
821: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
822: END IF;
823:
824:
825: EXCEPTION
825: EXCEPTION
826: WHEN error_build_trxn OR error_get_pplot OR no_yield_required THEN
827: NULL;
828: WHEN error_nothing_to_yield THEN
829: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
830: 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);
831: END IF;
832:
833: WHEN error_get_exception THEN
826: WHEN error_build_trxn OR error_get_pplot OR no_yield_required THEN
827: NULL;
828: WHEN error_nothing_to_yield THEN
829: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
830: 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);
831: END IF;
832:
833: WHEN error_get_exception THEN
834: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
830: 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);
831: END IF;
832:
833: WHEN error_get_exception THEN
834: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
835: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
836: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
831: END IF;
832:
833: WHEN error_get_exception THEN
834: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
835: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
836: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_yield_qty - x_actual_qty));
832:
833: WHEN error_get_exception THEN
834: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
835: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
836: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_yield_qty - x_actual_qty));
840: END IF;
833: WHEN error_get_exception THEN
834: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
835: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
836: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_yield_qty - x_actual_qty));
840: END IF;
841:
834: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
835: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
836: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_yield_qty - x_actual_qty));
840: END IF;
841:
842: gme_release_batch_pvt.create_batch_exception
835: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
836: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_yield_qty='||l_yield_qty);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception qty='||(l_yield_qty - x_actual_qty));
840: END IF;
841:
842: gme_release_batch_pvt.create_batch_exception
843: (p_material_dtl_rec => p_material_dtl_rec
850: ,x_return_status => x_return_status);
851:
852: WHEN OTHERS THEN
853: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
854: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
855: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
856: END IF;
857: x_return_status := FND_API.g_ret_sts_unexp_error;
858: END yield_material;
851:
852: WHEN OTHERS THEN
853: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
854: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
855: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
856: END IF;
857: x_return_status := FND_API.g_ret_sts_unexp_error;
858: END yield_material;
859:
881: error_create_trxn EXCEPTION;
882: error_relieve_pp_lot EXCEPTION;
883:
884: BEGIN
885: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
886: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
887: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
888: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
889: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
882: error_relieve_pp_lot EXCEPTION;
883:
884: BEGIN
885: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
886: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
887: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
888: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
889: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
890: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
883:
884: BEGIN
885: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
886: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
887: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
888: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
889: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
890: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
891: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
884: BEGIN
885: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
886: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
887: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
888: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
889: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
890: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
891: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
892: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
885: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
886: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
887: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
888: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
889: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
890: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
891: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
892: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
893: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
886: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
887: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
888: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
889: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
890: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
891: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
892: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
893: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
894: END IF;
887: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
888: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
889: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
890: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
891: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
892: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
893: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
894: END IF;
895:
888: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
889: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
890: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
891: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
892: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
893: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
894: END IF;
895:
896: /* Set the return status to success initially */
889: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
890: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield_qty='||p_yield_qty);
891: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
892: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_sec_uom_code='||p_sec_uom_code);
893: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
894: END IF;
895:
896: /* Set the return status to success initially */
897: x_return_status := FND_API.G_RET_STS_SUCCESS;
911: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
912: RAISE error_build_mmti;
913: END IF;
914:
915: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
916: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_dtl_qty := '||l_dtl_qty);
917: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_sec_qty := '||l_sec_qty);
918: END IF;
919:
912: RAISE error_build_mmti;
913: END IF;
914:
915: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
916: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_dtl_qty := '||l_dtl_qty);
917: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_sec_qty := '||l_sec_qty);
918: END IF;
919:
920: -- Bug 7262112 - Added '=' to condition. No need to recompute secondary values if yielding the full amount.
913: END IF;
914:
915: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
916: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_dtl_qty := '||l_dtl_qty);
917: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti l_sec_qty := '||l_sec_qty);
918: END IF;
919:
920: -- Bug 7262112 - Added '=' to condition. No need to recompute secondary values if yielding the full amount.
921: IF l_dtl_qty <= p_yield_qty - x_actual_qty THEN
936: ,to_name => NULL);
937: END IF;
938: END IF;
939:
940: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
941: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_trxn_qty := '||l_trxn_qty);
942: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_sec_qty := '||l_sec_qty);
943: END IF;
944:
937: END IF;
938: END IF;
939:
940: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
941: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_trxn_qty := '||l_trxn_qty);
942: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_sec_qty := '||l_sec_qty);
943: END IF;
944:
945: IF p_mtl_dtl_rec.line_type = gme_common_pvt.g_line_type_prod THEN
938: END IF;
939:
940: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
941: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_trxn_qty := '||l_trxn_qty);
942: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated l_sec_qty := '||l_sec_qty);
943: END IF;
944:
945: IF p_mtl_dtl_rec.line_type = gme_common_pvt.g_line_type_prod THEN
946: l_transaction_rec.transaction_type_id := gme_common_pvt.g_prod_completion;
947: ELSE
948: l_transaction_rec.transaction_type_id := gme_common_pvt.g_byprod_completion;
949: END IF;
950:
951: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
952: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_transaction_rec.transaction_type_id := '||l_transaction_rec.transaction_type_id);
953: END IF;
954:
955: l_transaction_rec.transaction_date := p_trans_date;
948: l_transaction_rec.transaction_type_id := gme_common_pvt.g_byprod_completion;
949: END IF;
950:
951: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
952: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_transaction_rec.transaction_type_id := '||l_transaction_rec.transaction_type_id);
953: END IF;
954:
955: l_transaction_rec.transaction_date := p_trans_date;
956: l_transaction_rec.transaction_quantity := l_trxn_qty;
959: IF l_sec_qty IS NOT NULL THEN
960: l_transaction_rec.secondary_transaction_quantity := l_sec_qty;
961: END IF;
962:
963: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
964: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_date='||to_char(l_transaction_rec.transaction_date
965: ,'YYYY-MON-DD HH24:MI:SS'));
966: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_qty='||l_transaction_rec.transaction_quantity);
967: END IF;
960: l_transaction_rec.secondary_transaction_quantity := l_sec_qty;
961: END IF;
962:
963: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
964: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_date='||to_char(l_transaction_rec.transaction_date
965: ,'YYYY-MON-DD HH24:MI:SS'));
966: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_qty='||l_transaction_rec.transaction_quantity);
967: END IF;
968:
962:
963: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
964: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_date='||to_char(l_transaction_rec.transaction_date
965: ,'YYYY-MON-DD HH24:MI:SS'));
966: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_qty='||l_transaction_rec.transaction_quantity);
967: END IF;
968:
969: l_transaction_rec.transaction_uom := p_mtl_dtl_rec.dtl_um;
970:
982: ,p_mmli_tbl => l_lot_tbl
983: ,x_return_status => x_return_status);
984:
985: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
986: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
987: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' gme_transactions_pvt.create_transaction returned error');
988: END IF;
989: RAISE error_create_trxn;
990: END IF;
983: ,x_return_status => x_return_status);
984:
985: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
986: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
987: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' gme_transactions_pvt.create_transaction returned error');
988: END IF;
989: RAISE error_create_trxn;
990: END IF;
991:
1003: RAISE error_relieve_pp_lot;
1004: END IF;
1005: END IF;
1006:
1007: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1008: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1009: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1010: END IF;
1011:
1004: END IF;
1005: END IF;
1006:
1007: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1008: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1009: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1010: END IF;
1011:
1012: EXCEPTION
1005: END IF;
1006:
1007: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1008: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1009: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1010: END IF;
1011:
1012: EXCEPTION
1013: WHEN error_create_trxn OR error_relieve_pp_lot OR error_build_mmti THEN
1013: WHEN error_create_trxn OR error_relieve_pp_lot OR error_build_mmti THEN
1014: NULL;
1015: WHEN OTHERS THEN
1016: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1017: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1018: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1019: END IF;
1020: x_return_status := FND_API.g_ret_sts_unexp_error;
1021: END build_and_create_transaction;
1014: NULL;
1015: WHEN OTHERS THEN
1016: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1017: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1018: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1019: END IF;
1020: x_return_status := FND_API.g_ret_sts_unexp_error;
1021: END build_and_create_transaction;
1022:
1035:
1036: l_api_name CONSTANT VARCHAR2 (30) := 'CONSTR_MMTI';
1037: BEGIN
1038:
1039: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1040: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1041: END IF;
1042:
1043: /* Initially let us assign the return status to success */
1036: l_api_name CONSTANT VARCHAR2 (30) := 'CONSTR_MMTI';
1037: BEGIN
1038:
1039: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1040: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1041: END IF;
1042:
1043: /* Initially let us assign the return status to success */
1044: x_return_status := FND_API.g_ret_sts_success;
1065: x_dtl_qty := p_pp_lot_rec.quantity;
1066: x_sec_qty := p_pp_lot_rec.secondary_quantity;
1067: END IF;
1068:
1069: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1070: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1071: END IF;
1072:
1073: EXCEPTION
1066: x_sec_qty := p_pp_lot_rec.secondary_quantity;
1067: END IF;
1068:
1069: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1070: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1071: END IF;
1072:
1073: EXCEPTION
1074: WHEN OTHERS THEN
1072:
1073: EXCEPTION
1074: WHEN OTHERS THEN
1075: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1076: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1077: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1078: END IF;
1079: x_return_status := FND_API.g_ret_sts_unexp_error;
1080: END constr_mmti;
1073: EXCEPTION
1074: WHEN OTHERS THEN
1075: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1076: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1077: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1078: END IF;
1079: x_return_status := FND_API.g_ret_sts_unexp_error;
1080: END constr_mmti;
1081:
1117: error_cmplt_date EXCEPTION;
1118: error_future_date EXCEPTION;
1119: error_vr_dates EXCEPTION;
1120: BEGIN
1121: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1122: gme_debug.g_log_procedure THEN
1123: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
1124: || l_api_name);
1125: END IF;
1118: error_future_date EXCEPTION;
1119: error_vr_dates EXCEPTION;
1120: BEGIN
1121: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1122: gme_debug.g_log_procedure THEN
1123: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
1124: || l_api_name);
1125: END IF;
1126:
1119: error_vr_dates EXCEPTION;
1120: BEGIN
1121: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1122: gme_debug.g_log_procedure THEN
1123: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
1124: || l_api_name);
1125: END IF;
1126:
1127: x_return_status := FND_API.g_ret_sts_success;
1199: ELSIF x_batch_header_rec.actual_cmplt_date > SYSDATE THEN
1200: RAISE error_future_date;
1201: END IF;
1202:
1203: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1204: gme_debug.g_log_procedure THEN
1205: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
1206: END IF;
1207:
1200: RAISE error_future_date;
1201: END IF;
1202:
1203: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1204: gme_debug.g_log_procedure THEN
1205: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
1206: END IF;
1207:
1208: EXCEPTION
1201: END IF;
1202:
1203: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
1204: gme_debug.g_log_procedure THEN
1205: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
1206: END IF;
1207:
1208: EXCEPTION
1209: WHEN error_phantom THEN
1228: x_return_status := FND_API.G_RET_STS_ERROR;
1229: WHEN OTHERS THEN
1230: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1231:
1232: IF g_debug <= gme_debug.g_log_procedure THEN
1233: gme_debug.put_line ( 'Unexpected error: '
1234: || g_pkg_name
1235: || '.'
1236: || l_api_name
1229: WHEN OTHERS THEN
1230: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1231:
1232: IF g_debug <= gme_debug.g_log_procedure THEN
1233: gme_debug.put_line ( 'Unexpected error: '
1234: || g_pkg_name
1235: || '.'
1236: || l_api_name
1237: || ': '