130: FROM gme_material_details
131: WHERE batch_id = v_batch_id
132: AND line_type = 1;
133: BEGIN
134: IF g_debug <= gme_debug.g_log_procedure THEN
135: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
136: || l_api_name);
137: END IF;
138:
131: WHERE batch_id = v_batch_id
132: AND line_type = 1;
133: BEGIN
134: IF g_debug <= gme_debug.g_log_procedure THEN
135: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
136: || l_api_name);
137: END IF;
138:
139: /* Set the success staus to success inititally*/
144: ,x_batch_header_rec) ) THEN
145: RAISE batch_header_fetch_error;
146: END IF;
147:
148: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
149: gme_debug.put_line ( 'Closing batch '
150: || x_batch_header_rec.batch_no
151: || ' at '
152: || TO_CHAR (p_batch_header_rec.batch_close_date
145: RAISE batch_header_fetch_error;
146: END IF;
147:
148: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
149: gme_debug.put_line ( 'Closing batch '
150: || x_batch_header_rec.batch_no
151: || ' at '
152: || TO_CHAR (p_batch_header_rec.batch_close_date
153: ,'DD-MON-YYYY HH24:MI:SS') );
164: END IF;
165:
166: -- 4944024 BEGIN
167: -- Delete any reservations against this batch as a supply source
168: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
169: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Invoking delete_prod_supply_resv for batch header' );
170: END IF;
171:
172: l_batch_header_rec := x_batch_header_rec;
165:
166: -- 4944024 BEGIN
167: -- Delete any reservations against this batch as a supply source
168: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
169: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Invoking delete_prod_supply_resv for batch header' );
170: END IF;
171:
172: l_batch_header_rec := x_batch_header_rec;
173: gme_supply_res_pvt.delete_batch_prod_supply_resv (
236: -- End Bug 10100973
237:
238: -- Bug 10161288 - Added following block to remove any open MO line.
239: IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
240: IF (g_debug <= gme_debug.g_log_procedure) THEN
241: gme_debug.put_line ( g_pkg_name
242: || '.'
243: || l_api_name
244: || ':'
237:
238: -- Bug 10161288 - Added following block to remove any open MO line.
239: IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
240: IF (g_debug <= gme_debug.g_log_procedure) THEN
241: gme_debug.put_line ( g_pkg_name
242: || '.'
243: || l_api_name
244: || ':'
245: || 'calling purge exceptions for batch_id='
288: IF NOT (gme_close_batch_pvt.check_close_date (x_batch_header_rec) ) THEN
289: RAISE batch_close_date_err;
290: END IF;
291:
292: IF g_debug <= gme_debug.g_log_procedure THEN
293: gme_debug.put_line ('Calling Batch Header DBL.Update Row ');
294: END IF;
295:
296: /* Set up the fields in output structure. */
289: RAISE batch_close_date_err;
290: END IF;
291:
292: IF g_debug <= gme_debug.g_log_procedure THEN
293: gme_debug.put_line ('Calling Batch Header DBL.Update Row ');
294: END IF;
295:
296: /* Set up the fields in output structure. */
297: x_batch_header_rec.batch_status := 4;
302: END IF;
303:
304: /* Insert the event into the batch history table */
305: IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
306: IF g_debug <= gme_debug.g_log_procedure THEN
307: gme_debug.put_line ('Calling Create History.');
308: END IF;
309:
310: IF NOT gme_common_pvt.create_history
303:
304: /* Insert the event into the batch history table */
305: IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
306: IF g_debug <= gme_debug.g_log_procedure THEN
307: gme_debug.put_line ('Calling Create History.');
308: END IF;
309:
310: IF NOT gme_common_pvt.create_history
311: (p_batch_header_rec => x_batch_header_rec
478: x_return_status := l_return_status;
479: WHEN close_phant_fail THEN
480: x_return_status := l_return_status;
481: WHEN error_processing THEN -- 4944024 BEGIN
482: IF g_debug <= gme_debug.g_log_procedure THEN
483: gme_debug.put_line ('Terminating due to error deleteing reservations against this batch supply.');
484: END IF;
485: -- 4944024 END
486: WHEN material_details_fetch_err THEN
479: WHEN close_phant_fail THEN
480: x_return_status := l_return_status;
481: WHEN error_processing THEN -- 4944024 BEGIN
482: IF g_debug <= gme_debug.g_log_procedure THEN
483: gme_debug.put_line ('Terminating due to error deleteing reservations against this batch supply.');
484: END IF;
485: -- 4944024 END
486: WHEN material_details_fetch_err THEN
487: IF (g_debug <= gme_debug.g_log_procedure) THEN
483: gme_debug.put_line ('Terminating due to error deleteing reservations against this batch supply.');
484: END IF;
485: -- 4944024 END
486: WHEN material_details_fetch_err THEN
487: IF (g_debug <= gme_debug.g_log_procedure) THEN
488: gme_debug.put_line ( g_pkg_name
489: || '.'
490: || l_api_name
491: || ':'
484: END IF;
485: -- 4944024 END
486: WHEN material_details_fetch_err THEN
487: IF (g_debug <= gme_debug.g_log_procedure) THEN
488: gme_debug.put_line ( g_pkg_name
489: || '.'
490: || l_api_name
491: || ':'
492: || 'MATERIAL_FETCH_ERROR');
493: END IF;
494:
495: x_return_status := fnd_api.g_ret_sts_error;
496: WHEN purge_exception_err THEN
497: IF (g_debug <= gme_debug.g_log_procedure) THEN
498: gme_debug.put_line ( g_pkg_name
499: || '.'
500: || l_api_name
501: || ':'
494:
495: x_return_status := fnd_api.g_ret_sts_error;
496: WHEN purge_exception_err THEN
497: IF (g_debug <= gme_debug.g_log_procedure) THEN
498: gme_debug.put_line ( g_pkg_name
499: || '.'
500: || l_api_name
501: || ':'
502: || 'purge_exception_err');