135: ,x_return_status OUT NOCOPY VARCHAR2)
136: IS
137: BEGIN
138:
139: gme_common_pvt.set_who ;
140: gme_common_pvt.material_date_change
141: (p_material_detail_id => p_material_detail_id
142: ,p_material_date => p_material_date
143: ,x_return_status => x_return_status);
136: IS
137: BEGIN
138:
139: gme_common_pvt.set_who ;
140: gme_common_pvt.material_date_change
141: (p_material_detail_id => p_material_detail_id
142: ,p_material_date => p_material_date
143: ,x_return_status => x_return_status);
144: /* FPBug#4585491
207: IF g_debug <= gme_debug.g_log_statement THEN
208: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' validate for mandatory input parameters ');
209: END IF;
210: IF p_organization_id IS NULL THEN
211: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'ORGANIZATION_ID');
212: RAISE input_param_missing;
213: ELSIF p_item_id IS NULL THEN
214: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'ITEM_ID');
215: RAISE input_param_missing;
210: IF p_organization_id IS NULL THEN
211: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'ORGANIZATION_ID');
212: RAISE input_param_missing;
213: ELSIF p_item_id IS NULL THEN
214: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'ITEM_ID');
215: RAISE input_param_missing;
216: ELSIF p_supply_demand_code IS NULL THEN
217: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_CODE');
218: RAISE input_param_missing;
213: ELSIF p_item_id IS NULL THEN
214: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'ITEM_ID');
215: RAISE input_param_missing;
216: ELSIF p_supply_demand_code IS NULL THEN
217: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_CODE');
218: RAISE input_param_missing;
219: ELSIF p_supply_demand_type_id IS NULL THEN
220: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_TYPE_ID');
221: RAISE input_param_missing;
216: ELSIF p_supply_demand_code IS NULL THEN
217: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_CODE');
218: RAISE input_param_missing;
219: ELSIF p_supply_demand_type_id IS NULL THEN
220: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_TYPE_ID');
221: RAISE input_param_missing;
222: ELSIF p_supply_demand_header_id IS NULL THEN
223: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_HEADER_ID');
224: RAISE input_param_missing;
219: ELSIF p_supply_demand_type_id IS NULL THEN
220: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_TYPE_ID');
221: RAISE input_param_missing;
222: ELSIF p_supply_demand_header_id IS NULL THEN
223: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_HEADER_ID');
224: RAISE input_param_missing;
225: ELSIF p_supply_demand_line_id IS NULL THEN
226: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_LINE_ID');
227: RAISE input_param_missing;
222: ELSIF p_supply_demand_header_id IS NULL THEN
223: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_HEADER_ID');
224: RAISE input_param_missing;
225: ELSIF p_supply_demand_line_id IS NULL THEN
226: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_LINE_ID');
227: RAISE input_param_missing;
228: END IF;
229:
230: /* Retrieve batch header row */
241: END IF;
242:
243: /* Verify that update_inventory is allowed for the Batch */
244: IF l_batch_header_rec.update_inventory_ind <> 'Y' THEN
245: gme_common_pvt.log_message('GME_INVENTORY_UPDATE_BLOCKED');
246: RAISE validation_error;
247: END IF;
248:
249: /* Verify that Batch is in either Pending or WIP status */
246: RAISE validation_error;
247: END IF;
248:
249: /* Verify that Batch is in either Pending or WIP status */
250: IF l_batch_header_rec.batch_status NOT IN (gme_common_pvt.g_batch_pending,
251: gme_common_pvt.g_batch_wip) THEN
252: gme_common_pvt.log_message('GME_INVALID_BATCH_STATUS', 'PROCESS', 'RESERVATION');
253: RAISE validation_error;
254: END IF;
247: END IF;
248:
249: /* Verify that Batch is in either Pending or WIP status */
250: IF l_batch_header_rec.batch_status NOT IN (gme_common_pvt.g_batch_pending,
251: gme_common_pvt.g_batch_wip) THEN
252: gme_common_pvt.log_message('GME_INVALID_BATCH_STATUS', 'PROCESS', 'RESERVATION');
253: RAISE validation_error;
254: END IF;
255:
248:
249: /* Verify that Batch is in either Pending or WIP status */
250: IF l_batch_header_rec.batch_status NOT IN (gme_common_pvt.g_batch_pending,
251: gme_common_pvt.g_batch_wip) THEN
252: gme_common_pvt.log_message('GME_INVALID_BATCH_STATUS', 'PROCESS', 'RESERVATION');
253: RAISE validation_error;
254: END IF;
255:
256: /* Reservation not permitted for FPOs */
253: RAISE validation_error;
254: END IF;
255:
256: /* Reservation not permitted for FPOs */
257: IF l_batch_header_rec.batch_type = gme_common_pvt.g_doc_type_fpo THEN
258: gme_common_pvt.log_message('GME_FPO_RESERVATION_ERROR');
259: RAISE validation_error;
260: END IF;
261:
254: END IF;
255:
256: /* Reservation not permitted for FPOs */
257: IF l_batch_header_rec.batch_type = gme_common_pvt.g_doc_type_fpo THEN
258: gme_common_pvt.log_message('GME_FPO_RESERVATION_ERROR');
259: RAISE validation_error;
260: END IF;
261:
262: /* Retrieve material details record */
271:
272: /* Verify that the supplied organization_id and item are consistent with the material details row */
273: IF p_organization_id <> l_material_details_rec.organization_id THEN
274: --Bug#5439736 replaced the following message
275: gme_common_pvt.log_message('GME_INCONSISTENT_FIELD','FIELD_NAME','ORGANIZATION_ID');
276: RAISE validation_error;
277: ELSIF p_item_id <> l_material_details_rec.inventory_item_id THEN
278: --Bug#5439736
279: gme_common_pvt.log_message('GME_INCONSISTENT_FIELD','FIELD_NAME','INVENTORY_ITEM_ID');
275: gme_common_pvt.log_message('GME_INCONSISTENT_FIELD','FIELD_NAME','ORGANIZATION_ID');
276: RAISE validation_error;
277: ELSIF p_item_id <> l_material_details_rec.inventory_item_id THEN
278: --Bug#5439736
279: gme_common_pvt.log_message('GME_INCONSISTENT_FIELD','FIELD_NAME','INVENTORY_ITEM_ID');
280: RAISE validation_error;
281: END IF;
282:
283: /* Verify that Reservation is not for phantom ingredient */
281: END IF;
282:
283: /* Verify that Reservation is not for phantom ingredient */
284: IF l_material_details_rec.phantom_type IN (1,2) THEN
285: gme_common_pvt.log_message('GME_INVALID_RSV_FOR_PHANTOM');
286: RAISE validation_error;
287: END IF;
288:
289: /* Verify that Reservation is not for sample by-product */
286: RAISE validation_error;
287: END IF;
288:
289: /* Verify that Reservation is not for sample by-product */
290: IF l_material_details_rec.line_type = gme_common_pvt.g_line_type_byprod AND
291: l_material_details_rec.by_product_type = 'Y' THEN
292: gme_common_pvt.log_message('GME_INVALID_RSV_FOR_BYPROD');
293: RAISE validation_error;
294: END IF;
288:
289: /* Verify that Reservation is not for sample by-product */
290: IF l_material_details_rec.line_type = gme_common_pvt.g_line_type_byprod AND
291: l_material_details_rec.by_product_type = 'Y' THEN
292: gme_common_pvt.log_message('GME_INVALID_RSV_FOR_BYPROD');
293: RAISE validation_error;
294: END IF;
295:
296: IF g_debug <= gme_debug.g_log_statement THEN
297: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Material Release Type '||l_material_details_rec.release_type);
298: END IF;
299: /* Verify p_supply_demand_code and line_type. */
300: IF p_supply_demand_code = 2 /* Demand */ AND
301: l_material_details_rec.line_type <> gme_common_pvt.g_line_type_ing THEN
302: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
303: RAISE supply_demand_error;
304: ELSIF p_supply_demand_code = 1 /* Supply */ AND
305: l_material_details_rec.line_type <> gme_common_pvt.g_line_type_prod THEN
298: END IF;
299: /* Verify p_supply_demand_code and line_type. */
300: IF p_supply_demand_code = 2 /* Demand */ AND
301: l_material_details_rec.line_type <> gme_common_pvt.g_line_type_ing THEN
302: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
303: RAISE supply_demand_error;
304: ELSIF p_supply_demand_code = 1 /* Supply */ AND
305: l_material_details_rec.line_type <> gme_common_pvt.g_line_type_prod THEN
306: gme_common_pvt.log_message('GME_INVALID_SUPPLY_LINE');
301: l_material_details_rec.line_type <> gme_common_pvt.g_line_type_ing THEN
302: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
303: RAISE supply_demand_error;
304: ELSIF p_supply_demand_code = 1 /* Supply */ AND
305: l_material_details_rec.line_type <> gme_common_pvt.g_line_type_prod THEN
306: gme_common_pvt.log_message('GME_INVALID_SUPPLY_LINE');
307: RAISE supply_demand_error;
308: ELSIF NVL(p_supply_demand_code,0) NOT IN (1,2) THEN
309: gme_common_pvt.log_message('GME_INVALID_SUPPLY_DEMAND');
302: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
303: RAISE supply_demand_error;
304: ELSIF p_supply_demand_code = 1 /* Supply */ AND
305: l_material_details_rec.line_type <> gme_common_pvt.g_line_type_prod THEN
306: gme_common_pvt.log_message('GME_INVALID_SUPPLY_LINE');
307: RAISE supply_demand_error;
308: ELSIF NVL(p_supply_demand_code,0) NOT IN (1,2) THEN
309: gme_common_pvt.log_message('GME_INVALID_SUPPLY_DEMAND');
310: RAISE supply_demand_error;
305: l_material_details_rec.line_type <> gme_common_pvt.g_line_type_prod THEN
306: gme_common_pvt.log_message('GME_INVALID_SUPPLY_LINE');
307: RAISE supply_demand_error;
308: ELSIF NVL(p_supply_demand_code,0) NOT IN (1,2) THEN
309: gme_common_pvt.log_message('GME_INVALID_SUPPLY_DEMAND');
310: RAISE supply_demand_error;
311: ELSIF p_supply_demand_code = 2 /* Demand */ AND
312: l_material_details_rec.line_type = gme_common_pvt.g_line_type_ing THEN
313: IF l_material_details_rec.release_type NOT IN ( gme_common_pvt.g_mtl_manual_release,gme_common_pvt.g_mtl_incremental_release) THEN
308: ELSIF NVL(p_supply_demand_code,0) NOT IN (1,2) THEN
309: gme_common_pvt.log_message('GME_INVALID_SUPPLY_DEMAND');
310: RAISE supply_demand_error;
311: ELSIF p_supply_demand_code = 2 /* Demand */ AND
312: l_material_details_rec.line_type = gme_common_pvt.g_line_type_ing THEN
313: IF l_material_details_rec.release_type NOT IN ( gme_common_pvt.g_mtl_manual_release,gme_common_pvt.g_mtl_incremental_release) THEN
314: l_mat_status := gme_common_pvt.is_material_auto_release(l_material_details_rec.material_detail_id);
315: ELSE
316: l_mat_status := l_material_details_rec.release_type;
309: gme_common_pvt.log_message('GME_INVALID_SUPPLY_DEMAND');
310: RAISE supply_demand_error;
311: ELSIF p_supply_demand_code = 2 /* Demand */ AND
312: l_material_details_rec.line_type = gme_common_pvt.g_line_type_ing THEN
313: IF l_material_details_rec.release_type NOT IN ( gme_common_pvt.g_mtl_manual_release,gme_common_pvt.g_mtl_incremental_release) THEN
314: l_mat_status := gme_common_pvt.is_material_auto_release(l_material_details_rec.material_detail_id);
315: ELSE
316: l_mat_status := l_material_details_rec.release_type;
317: END IF;
310: RAISE supply_demand_error;
311: ELSIF p_supply_demand_code = 2 /* Demand */ AND
312: l_material_details_rec.line_type = gme_common_pvt.g_line_type_ing THEN
313: IF l_material_details_rec.release_type NOT IN ( gme_common_pvt.g_mtl_manual_release,gme_common_pvt.g_mtl_incremental_release) THEN
314: l_mat_status := gme_common_pvt.is_material_auto_release(l_material_details_rec.material_detail_id);
315: ELSE
316: l_mat_status := l_material_details_rec.release_type;
317: END IF;
318: --Bug#4604943 following code is commented out
316: l_mat_status := l_material_details_rec.release_type;
317: END IF;
318: --Bug#4604943 following code is commented out
319: /* BUG 4604943 BEGIN - check for auto AND autobystep here
320: IF l_mat_status in ( gme_common_pvt.g_mtl_auto_release ,gme_common_pvt.g_mtl_autobystep_release) AND
321: l_batch_header_rec.batch_status = gme_common_pvt.g_batch_wip THEN
322: IF g_debug <= gme_debug.g_log_statement THEN
323: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Automatic Release Material in WIP batch not a valid demand');
324: END IF;
317: END IF;
318: --Bug#4604943 following code is commented out
319: /* BUG 4604943 BEGIN - check for auto AND autobystep here
320: IF l_mat_status in ( gme_common_pvt.g_mtl_auto_release ,gme_common_pvt.g_mtl_autobystep_release) AND
321: l_batch_header_rec.batch_status = gme_common_pvt.g_batch_wip THEN
322: IF g_debug <= gme_debug.g_log_statement THEN
323: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Automatic Release Material in WIP batch not a valid demand');
324: END IF;
325: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
321: l_batch_header_rec.batch_status = gme_common_pvt.g_batch_wip THEN
322: IF g_debug <= gme_debug.g_log_statement THEN
323: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Automatic Release Material in WIP batch not a valid demand');
324: END IF;
325: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
326: RAISE supply_demand_error;
327: BUG 4604943 END
328: ELS */
329: IF l_mat_status = gme_common_pvt.g_mtl_auto_release AND
325: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
326: RAISE supply_demand_error;
327: BUG 4604943 END
328: ELS */
329: IF l_mat_status = gme_common_pvt.g_mtl_auto_release AND
330: l_batch_header_rec.batch_status = gme_common_pvt.g_batch_wip THEN
331: IF g_debug <= gme_debug.g_log_statement THEN
332: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Automatic Release Material in WIP batch not a valid demand');
333: END IF;
326: RAISE supply_demand_error;
327: BUG 4604943 END
328: ELS */
329: IF l_mat_status = gme_common_pvt.g_mtl_auto_release AND
330: l_batch_header_rec.batch_status = gme_common_pvt.g_batch_wip THEN
331: IF g_debug <= gme_debug.g_log_statement THEN
332: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Automatic Release Material in WIP batch not a valid demand');
333: END IF;
334: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
330: l_batch_header_rec.batch_status = gme_common_pvt.g_batch_wip THEN
331: IF g_debug <= gme_debug.g_log_statement THEN
332: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Automatic Release Material in WIP batch not a valid demand');
333: END IF;
334: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
335: RAISE supply_demand_error;
336: ELSIF l_mat_status = gme_common_pvt.g_mtl_autobystep_release THEN
337: IF NOT gme_common_pvt.get_assoc_step(l_material_details_rec.material_detail_id,l_step_id,l_step_status) THEN
338: IF g_debug <= gme_debug.g_log_statement THEN
332: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Automatic Release Material in WIP batch not a valid demand');
333: END IF;
334: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
335: RAISE supply_demand_error;
336: ELSIF l_mat_status = gme_common_pvt.g_mtl_autobystep_release THEN
337: IF NOT gme_common_pvt.get_assoc_step(l_material_details_rec.material_detail_id,l_step_id,l_step_status) THEN
338: IF g_debug <= gme_debug.g_log_statement THEN
339: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Error in get_assoc_step');
340: END IF;
333: END IF;
334: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
335: RAISE supply_demand_error;
336: ELSIF l_mat_status = gme_common_pvt.g_mtl_autobystep_release THEN
337: IF NOT gme_common_pvt.get_assoc_step(l_material_details_rec.material_detail_id,l_step_id,l_step_status) THEN
338: IF g_debug <= gme_debug.g_log_statement THEN
339: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Error in get_assoc_step');
340: END IF;
341: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
337: IF NOT gme_common_pvt.get_assoc_step(l_material_details_rec.material_detail_id,l_step_id,l_step_status) THEN
338: IF g_debug <= gme_debug.g_log_statement THEN
339: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Error in get_assoc_step');
340: END IF;
341: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
342: RAISE supply_demand_error;
343: ELSIF l_step_id IS NOT NULL AND NVL(l_step_status,-1) >= gme_common_pvt.g_step_wip THEN
344: IF g_debug <= gme_debug.g_log_statement THEN
345: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Automatic By Step Material in step: '||l_step_id||
339: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Error in get_assoc_step');
340: END IF;
341: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
342: RAISE supply_demand_error;
343: ELSIF l_step_id IS NOT NULL AND NVL(l_step_status,-1) >= gme_common_pvt.g_step_wip THEN
344: IF g_debug <= gme_debug.g_log_statement THEN
345: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Automatic By Step Material in step: '||l_step_id||
346: ' with status of '||l_step_status||' not a valid demand');
347: END IF;
344: IF g_debug <= gme_debug.g_log_statement THEN
345: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Automatic By Step Material in step: '||l_step_id||
346: ' with status of '||l_step_status||' not a valid demand');
347: END IF;
348: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
349: RAISE supply_demand_error;
350: END IF; -- IF l_step_id IS NOT NULL AND NVL(l_step_status,-1) = gme_common_pvt.g_step_wip THEN
351: END IF; -- IF l_mat_status = gme_common_pvt.g_mtl_auto_release AND
352: END IF;
346: ' with status of '||l_step_status||' not a valid demand');
347: END IF;
348: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
349: RAISE supply_demand_error;
350: END IF; -- IF l_step_id IS NOT NULL AND NVL(l_step_status,-1) = gme_common_pvt.g_step_wip THEN
351: END IF; -- IF l_mat_status = gme_common_pvt.g_mtl_auto_release AND
352: END IF;
353:
354: IF g_debug <= gme_debug.g_log_procedure THEN
347: END IF;
348: gme_common_pvt.log_message('GME_INVALID_DEMAND_LINE');
349: RAISE supply_demand_error;
350: END IF; -- IF l_step_id IS NOT NULL AND NVL(l_step_status,-1) = gme_common_pvt.g_step_wip THEN
351: END IF; -- IF l_mat_status = gme_common_pvt.g_mtl_auto_release AND
352: END IF;
353:
354: IF g_debug <= gme_debug.g_log_procedure THEN
355: gme_debug.put_line ('Completed '|| l_api_name|| ' at '|| TO_CHAR (SYSDATE, 'MM/DD/YYYY HH24:MI:SS'));
359: WHEN invalid_version OR input_param_missing OR validation_error
360: OR fetch_failure OR supply_demand_error THEN
361: x_return_status := FND_API.g_ret_sts_error;
362: x_valid_status := 'N';
363: gme_common_pvt.count_and_get(x_count => x_msg_count,
364: p_encoded => FND_API.g_false,
365: x_data => x_msg_data);
366: WHEN OTHERS THEN
367: IF g_debug <= gme_debug.g_log_unexpected THEN
368: gme_debug.put_line(g_pkg_name|| '.'|| l_api_name|| ':'|| 'When others exception:'|| SQLERRM);
369: END IF;
370: x_return_status := FND_API.g_ret_sts_unexp_error;
371: x_valid_status := 'N';
372: gme_common_pvt.count_and_get(x_count => x_msg_count,
373: p_encoded => FND_API.g_false,
374: x_data => x_msg_data);
375: END validate_supply_demand;
376:
447: IF g_debug <= gme_debug.g_log_statement THEN
448: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' validate for mandatory input parameters ');
449: END IF;
450: IF p_supply_demand_code IS NULL THEN
451: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_CODE');
452: RAISE input_param_missing;
453: ELSIF p_supply_demand_type_id IS NULL THEN
454: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_TYPE_ID');
455: RAISE input_param_missing;
450: IF p_supply_demand_code IS NULL THEN
451: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_CODE');
452: RAISE input_param_missing;
453: ELSIF p_supply_demand_type_id IS NULL THEN
454: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_TYPE_ID');
455: RAISE input_param_missing;
456: ELSIF p_supply_demand_header_id IS NULL THEN
457: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_HEADER_ID');
458: RAISE input_param_missing;
453: ELSIF p_supply_demand_type_id IS NULL THEN
454: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_TYPE_ID');
455: RAISE input_param_missing;
456: ELSIF p_supply_demand_header_id IS NULL THEN
457: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_HEADER_ID');
458: RAISE input_param_missing;
459: ELSIF p_supply_demand_line_id IS NULL THEN
460: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_LINE_ID');
461: RAISE input_param_missing;
456: ELSIF p_supply_demand_header_id IS NULL THEN
457: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_HEADER_ID');
458: RAISE input_param_missing;
459: ELSIF p_supply_demand_line_id IS NULL THEN
460: gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'SUPPLY_DEMAND_LINE_ID');
461: RAISE input_param_missing;
462: END IF;
463:
464: /* Retrieve batch header */
471: RAISE fetch_failure;
472: END IF;
473:
474: /* For Batch in Completed status , return 0*/
475: IF l_batch_header_rec.batch_status = gme_common_pvt.g_batch_completed THEN
476: x_available_quantity := 0;
477: IF g_debug <= gme_debug.g_log_statement THEN
478: gme_debug.put_line(g_pkg_name||'.'||l_api_name||
479: 'Batch status is completed so return available of 0 ');
495: OPEN cur_get_step_status (l_material_details_rec.material_detail_id);
496: FETCH cur_get_step_status INTO l_step_status;
497: CLOSE cur_get_step_status;
498:
499: IF NVL(l_step_status, 0) = gme_common_pvt.g_step_completed THEN
500: x_available_quantity := 0;
501: RETURN;
502: END IF;
503:
503:
504: /* If supplied,verify that the supplied organization_id and item are consistent with the material details row */
505: IF p_organization_id is NOT NULL THEN
506: IF p_organization_id <> l_material_details_rec.organization_id THEN
507: gme_common_pvt.log_message('GME_INCONSISTENT_FIELD','FIELD_NAME','ORGANIZATION_ID');
508: RAISE validation_error;
509: END IF;
510: END IF;
511:
510: END IF;
511:
512: IF p_item_id is NOT NULL THEN
513: IF p_item_id <> l_material_details_rec.inventory_item_id THEN
514: gme_common_pvt.log_message('GME_INCONSISTENT_FIELD','FIELD_NAME','INVENTORY_ITEM_ID');
515: RAISE validation_error;
516: END IF;
517: END IF;
518:
558: EXCEPTION
559: /* Exception handling */
560: WHEN invalid_version OR input_param_missing OR validation_error OR fetch_failure THEN
561: x_return_status := FND_API.g_ret_sts_error;
562: gme_common_pvt.count_and_get(x_count => x_msg_count,
563: p_encoded => FND_API.g_false,
564: x_data => x_msg_data);
565: WHEN OTHERS THEN
566: IF g_debug <= gme_debug.g_log_unexpected THEN
566: IF g_debug <= gme_debug.g_log_unexpected THEN
567: gme_debug.put_line(g_pkg_name|| '.'|| l_api_name|| ':'|| 'When others exception:'|| SQLERRM);
568: END IF;
569: x_return_status := FND_API.g_ret_sts_unexp_error;
570: gme_common_pvt.count_and_get(x_count => x_msg_count,
571: p_encoded => FND_API.g_false,
572: x_data => x_msg_data);
573: END get_available_supply_demand;
574:
580: IS
581: l_batch_step gme_batch_steps%ROWTYPE;
582: expected_err EXCEPTION;
583: BEGIN
584: IF NOT gme_common_pvt.g_setup_done THEN
585: gme_common_pvt.g_setup_done := gme_common_pvt.setup (p_org_id);
586:
587: IF NOT gme_common_pvt.g_setup_done THEN
588: x_return_status := fnd_api.g_ret_sts_error;
581: l_batch_step gme_batch_steps%ROWTYPE;
582: expected_err EXCEPTION;
583: BEGIN
584: IF NOT gme_common_pvt.g_setup_done THEN
585: gme_common_pvt.g_setup_done := gme_common_pvt.setup (p_org_id);
586:
587: IF NOT gme_common_pvt.g_setup_done THEN
588: x_return_status := fnd_api.g_ret_sts_error;
589: RAISE expected_err;
583: BEGIN
584: IF NOT gme_common_pvt.g_setup_done THEN
585: gme_common_pvt.g_setup_done := gme_common_pvt.setup (p_org_id);
586:
587: IF NOT gme_common_pvt.g_setup_done THEN
588: x_return_status := fnd_api.g_ret_sts_error;
589: RAISE expected_err;
590: END IF;
591: END IF;
589: RAISE expected_err;
590: END IF;
591: END IF;
592:
593: gme_common_pvt.set_timestamp;
594: l_batch_step.batchstep_id := p_batchstep_id;
595:
596: IF (NOT (gme_batch_steps_dbl.fetch_row (l_batch_step, l_batch_step) ) ) THEN
597: RAISE expected_err;
599:
600: IF ( p_quality_status IS NULL
601: OR p_quality_status < 1
602: OR p_quality_status > 6) THEN
603: gme_common_pvt.log_message ('GME_INV_STEP_QUALITY_STATUS');
604: RAISE expected_err;
605: END IF;
606:
607: IF (l_batch_step.step_status > 2) THEN
604: RAISE expected_err;
605: END IF;
606:
607: IF (l_batch_step.step_status > 2) THEN
608: gme_common_pvt.log_message ('PC_STEP_STATUS_ERR');
609: RAISE expected_err;
610: END IF;
611:
612: IF (l_batch_step.step_status = 1 AND p_quality_status > 2)
610: END IF;
611:
612: IF (l_batch_step.step_status = 1 AND p_quality_status > 2)
613: OR (l_batch_step.step_status = 2 AND p_quality_status <= 2) THEN
614: gme_common_pvt.log_message ('GME_INV_STEP_STATUS_QUALITY');
615: RAISE expected_err;
616: END IF;
617:
618: l_batch_step.quality_status := p_quality_status;
639: ,p_batch_id IN NUMBER
640: ,p_invoke_mode IN VARCHAR2
641: ,p_tree_mode IN NUMBER
642: ,x_return_status OUT NOCOPY VARCHAR2
643: ,x_exception_tbl OUT NOCOPY gme_common_pvt.exceptions_tab)
644: IS
645: l_api_name CONSTANT VARCHAR2 (30) := 'get_batch_shortages';
646: BEGIN
647: -- Initially let us assign the return status to success
658: || p_batch_id);
659: END IF;
660:
661: IF p_batch_id IS NOT NULL THEN
662: gme_common_pvt.get_batch_shortages (
663: p_organization_id => p_organization_id
664: ,p_batch_id => p_batch_id
665: ,p_invoke_mode => p_invoke_mode
666: ,p_tree_mode => p_tree_mode
681: || x_return_status);
682: END IF;
683: EXCEPTION
684: WHEN fnd_api.g_exc_error THEN
685: gme_common_pvt.count_and_get (x_count => x_msg_count
686: ,p_encoded => fnd_api.g_false
687: ,x_data => x_msg_data);
688:
689: WHEN OTHERS THEN
696: || ':'
697: || 'WHEN OTHERS:'
698: || SQLERRM);
699: END IF;
700: gme_common_pvt.count_and_get (x_count => x_msg_count
701: ,p_encoded => fnd_api.g_false
702: ,x_data => x_msg_data);
703: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
704: END;
710: ,p_organization_id IN NUMBER
711: ,p_batch_id IN NUMBER
712: ,p_material_detail_id IN NUMBER
713: ,x_return_status OUT NOCOPY VARCHAR2
714: ,x_reservations_tbl OUT NOCOPY gme_common_pvt.reservations_tab)
715:
716: IS
717: l_api_name CONSTANT VARCHAR2 (30) := 'get_material_reservations';
718: BEGIN
752: || x_return_status);
753: END IF;
754: EXCEPTION
755: WHEN fnd_api.g_exc_error THEN
756: gme_common_pvt.count_and_get (x_count => x_msg_count
757: ,p_encoded => fnd_api.g_false
758: ,x_data => x_msg_data);
759:
760: WHEN OTHERS THEN
767: || ':'
768: || 'WHEN OTHERS:'
769: || SQLERRM);
770: END IF;
771: gme_common_pvt.count_and_get (x_count => x_msg_count
772: ,p_encoded => fnd_api.g_false
773: ,x_data => x_msg_data);
774: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
775: END get_material_reservations;
791: ,p_proc_param_tbl IN gmd_recipe_fetch_pub.recp_resc_proc_param_tbl
792: ,p_use_workday_cal IN VARCHAR2 DEFAULT FND_API.G_TRUE
793: ,p_contiguity_override IN VARCHAR2 DEFAULT FND_API.G_TRUE
794: ,x_batch_header_rec OUT NOCOPY gme_batch_header%rowtype
795: ,x_exception_material_tbl OUT NOCOPY gme_common_pvt.exceptions_tab
796: ) IS
797:
798: l_api_name CONSTANT VARCHAR2(30) := 'CREATE_LCF_BATCH';
799: BEGIN
806: || l_api_name);
807: END IF;
808: IF p_init_msg_list = fnd_api.g_true THEN
809: fnd_msg_pub.initialize;
810: gme_common_pvt.g_error_count := 0;
811: END IF;
812: /* Make sure we are call compatible */
813: IF NOT fnd_api.compatible_api_call (1
814: ,p_api_version
814: ,p_api_version
815: ,'create_lcf_batch'
816: ,g_pkg_name) THEN
817: x_return_status := fnd_api.g_ret_sts_error;
818: gme_common_pvt.log_message ('GME_INVALID_API_VERSION');
819: RAISE fnd_api.g_exc_error;
820: END IF;
821: /* Setup the common constants used accross the apis */
822: IF g_debug <= gme_debug.g_log_procedure THEN
819: RAISE fnd_api.g_exc_error;
820: END IF;
821: /* Setup the common constants used accross the apis */
822: IF g_debug <= gme_debug.g_log_procedure THEN
823: gme_debug.put_line ('Calling gme_common_pvt.setup.');
824: END IF;
825:
826: gme_common_pvt.g_setup_done :=
827: gme_common_pvt.setup (p_org_id => p_batch_header_rec.organization_id
822: IF g_debug <= gme_debug.g_log_procedure THEN
823: gme_debug.put_line ('Calling gme_common_pvt.setup.');
824: END IF;
825:
826: gme_common_pvt.g_setup_done :=
827: gme_common_pvt.setup (p_org_id => p_batch_header_rec.organization_id
828: ,p_org_code => NULL);
829:
830: IF g_debug <= gme_debug.g_log_procedure THEN
823: gme_debug.put_line ('Calling gme_common_pvt.setup.');
824: END IF;
825:
826: gme_common_pvt.g_setup_done :=
827: gme_common_pvt.setup (p_org_id => p_batch_header_rec.organization_id
828: ,p_org_code => NULL);
829:
830: IF g_debug <= gme_debug.g_log_procedure THEN
831: gme_debug.put_line ('After calling gme_common_pvt.setup.');
827: gme_common_pvt.setup (p_org_id => p_batch_header_rec.organization_id
828: ,p_org_code => NULL);
829:
830: IF g_debug <= gme_debug.g_log_procedure THEN
831: gme_debug.put_line ('After calling gme_common_pvt.setup.');
832: END IF;
833:
834: IF NOT gme_common_pvt.g_setup_done THEN
835: x_return_status := fnd_api.g_ret_sts_error;
830: IF g_debug <= gme_debug.g_log_procedure THEN
831: gme_debug.put_line ('After calling gme_common_pvt.setup.');
832: END IF;
833:
834: IF NOT gme_common_pvt.g_setup_done THEN
835: x_return_status := fnd_api.g_ret_sts_error;
836: RAISE fnd_api.g_exc_error;
837: END IF;
838: gme_common_pvt.set_timestamp;
834: IF NOT gme_common_pvt.g_setup_done THEN
835: x_return_status := fnd_api.g_ret_sts_error;
836: RAISE fnd_api.g_exc_error;
837: END IF;
838: gme_common_pvt.set_timestamp;
839: gme_common_pvt.materials := p_formula_dtl_tbl;
840: gme_common_pvt.routings := p_recipe_rout_tbl;
841: gme_common_pvt.steps := p_recipe_step_tbl;
842: gme_common_pvt.step_dependencies := p_routing_depd_tbl;
835: x_return_status := fnd_api.g_ret_sts_error;
836: RAISE fnd_api.g_exc_error;
837: END IF;
838: gme_common_pvt.set_timestamp;
839: gme_common_pvt.materials := p_formula_dtl_tbl;
840: gme_common_pvt.routings := p_recipe_rout_tbl;
841: gme_common_pvt.steps := p_recipe_step_tbl;
842: gme_common_pvt.step_dependencies := p_routing_depd_tbl;
843: gme_common_pvt.activities := p_oprn_act_tbl;
836: RAISE fnd_api.g_exc_error;
837: END IF;
838: gme_common_pvt.set_timestamp;
839: gme_common_pvt.materials := p_formula_dtl_tbl;
840: gme_common_pvt.routings := p_recipe_rout_tbl;
841: gme_common_pvt.steps := p_recipe_step_tbl;
842: gme_common_pvt.step_dependencies := p_routing_depd_tbl;
843: gme_common_pvt.activities := p_oprn_act_tbl;
844: gme_common_pvt.resources := p_oprn_resc_tbl;
837: END IF;
838: gme_common_pvt.set_timestamp;
839: gme_common_pvt.materials := p_formula_dtl_tbl;
840: gme_common_pvt.routings := p_recipe_rout_tbl;
841: gme_common_pvt.steps := p_recipe_step_tbl;
842: gme_common_pvt.step_dependencies := p_routing_depd_tbl;
843: gme_common_pvt.activities := p_oprn_act_tbl;
844: gme_common_pvt.resources := p_oprn_resc_tbl;
845: gme_common_pvt.process_parameters := p_proc_param_tbl;
838: gme_common_pvt.set_timestamp;
839: gme_common_pvt.materials := p_formula_dtl_tbl;
840: gme_common_pvt.routings := p_recipe_rout_tbl;
841: gme_common_pvt.steps := p_recipe_step_tbl;
842: gme_common_pvt.step_dependencies := p_routing_depd_tbl;
843: gme_common_pvt.activities := p_oprn_act_tbl;
844: gme_common_pvt.resources := p_oprn_resc_tbl;
845: gme_common_pvt.process_parameters := p_proc_param_tbl;
846: gme_create_batch_pvt.create_batch(
839: gme_common_pvt.materials := p_formula_dtl_tbl;
840: gme_common_pvt.routings := p_recipe_rout_tbl;
841: gme_common_pvt.steps := p_recipe_step_tbl;
842: gme_common_pvt.step_dependencies := p_routing_depd_tbl;
843: gme_common_pvt.activities := p_oprn_act_tbl;
844: gme_common_pvt.resources := p_oprn_resc_tbl;
845: gme_common_pvt.process_parameters := p_proc_param_tbl;
846: gme_create_batch_pvt.create_batch(
847: p_validation_level => 100
840: gme_common_pvt.routings := p_recipe_rout_tbl;
841: gme_common_pvt.steps := p_recipe_step_tbl;
842: gme_common_pvt.step_dependencies := p_routing_depd_tbl;
843: gme_common_pvt.activities := p_oprn_act_tbl;
844: gme_common_pvt.resources := p_oprn_resc_tbl;
845: gme_common_pvt.process_parameters := p_proc_param_tbl;
846: gme_create_batch_pvt.create_batch(
847: p_validation_level => 100
848: ,x_return_status => x_return_status
841: gme_common_pvt.steps := p_recipe_step_tbl;
842: gme_common_pvt.step_dependencies := p_routing_depd_tbl;
843: gme_common_pvt.activities := p_oprn_act_tbl;
844: gme_common_pvt.resources := p_oprn_resc_tbl;
845: gme_common_pvt.process_parameters := p_proc_param_tbl;
846: gme_create_batch_pvt.create_batch(
847: p_validation_level => 100
848: ,x_return_status => x_return_status
849: ,p_batch_header_rec => p_batch_header_rec
856: ,p_contiguity_override => p_contiguity_override
857: ,p_is_phantom => 'N'
858: ,x_exception_material_tbl => x_exception_material_tbl
859: );
860: IF x_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_inv_short_err,'C') THEN
861: IF g_debug <= gme_debug.g_log_procedure THEN
862: gme_debug.put_line ('Error in Create Batch: return status'||x_return_status);
863: END IF;
864: RAISE fnd_api.g_exc_error;
871: EXCEPTION
872: WHEN fnd_api.g_exc_error THEN
873: x_return_status := fnd_api.g_ret_sts_error;
874: x_batch_header_rec := null;
875: gme_common_pvt.count_and_get (x_count => x_message_count
876: ,p_encoded => fnd_api.g_false
877: ,x_data => x_message_list);
878: WHEN fnd_api.g_exc_unexpected_error THEN
879: x_return_status := fnd_api.g_ret_sts_unexp_error;
877: ,x_data => x_message_list);
878: WHEN fnd_api.g_exc_unexpected_error THEN
879: x_return_status := fnd_api.g_ret_sts_unexp_error;
880: x_batch_header_rec := null;
881: gme_common_pvt.count_and_get (x_count => x_message_count
882: ,p_encoded => fnd_api.g_false
883: ,x_data => x_message_list);
884: WHEN OTHERS THEN
885: x_return_status := fnd_api.g_ret_sts_unexp_error;
923: l_mtl_dtl_rec.plan_qty := p_prim_plan_qty;
924: l_mtl_dtl_rec.wip_plan_qty := p_prim_wip_plan_qty;
925: l_mtl_dtl_rec.actual_qty := p_prim_actual_qty;
926: l_mtl_dtl_rec.dtl_um := p_prim_uom;
927: gme_common_pvt.get_open_qty (p_mtl_dtl_rec => l_mtl_dtl_rec
928: ,p_called_by => 'S'
929: ,x_open_qty => l_open_qty
930: ,x_return_status => l_return_status);
931:
988:
989: IF cur_rsv_rec%NOTFOUND THEN
990: CLOSE cur_rsv_rec;
991:
992: gme_common_pvt.log_message ('GME_NO_DATA_FOUND'
993: ,'TABLE_NAME'
994: ,'MTL_RESERVATIONS');
995:
996: IF g_debug <= gme_debug.g_log_statement THEN
1015:
1016: IF cur_fetch_item%NOTFOUND THEN
1017: CLOSE cur_fetch_item;
1018:
1019: gme_common_pvt.log_message ('GME_NO_DATA_FOUND'
1020: ,'TABLE_NAME'
1021: ,'MTL_SYSTEM_ITEMS');
1022:
1023: IF g_debug <= gme_debug.g_log_statement THEN
1048: || TO_CHAR (l_rsv_type) );
1049: END IF;
1050:
1051: IF l_rsv_type = -1 THEN
1052: gme_common_pvt.log_message ('GME_RSV_DETAIL_REQUIRED');
1053: RAISE error_unexpected;
1054: END IF;
1055:
1056: IF l_rsv_type IN (0, 2) THEN
1060: END IF;
1061: EXCEPTION
1062: WHEN error_unexpected OR fetch_error THEN
1063: RETURN 0;
1064: gme_common_pvt.count_and_get (x_count => l_msg_count
1065: ,p_encoded => fnd_api.g_false
1066: ,x_data => l_msg_list);
1067:
1068: WHEN OTHERS THEN
1089: -- org_id, from and to batch_no, start and end dates.
1090: --
1091: -- HISTORY:
1092: -- Sivakumar.G FPBug#4351032 08-DEC-2005
1093: -- gme_api_grp.log_message calls replaced by gme_common_pvt.log_message
1094: -- Namit Singhi FPBug#5674398 01-JAN-2007
1095: -- Modified for ingred sub enhancement FP
1096: ======================================================================*/
1097: PROCEDURE substitute_ingredients (
1153: AND message_name = v_msg_name;
1154:
1155: l_formula_tbl gmdfmval_pub.formula_detail_tbl;
1156: l_trolin_tbl inv_move_order_pub.trolin_tbl_type;
1157: l_material_details_tbl gme_common_pvt.material_details_tab;
1158: l_material_details_tbl_out gme_common_pvt.material_details_tab;
1159: l_material_detail_rec gme_material_details%ROWTYPE;
1160: l_return BOOLEAN;
1161: l_return_status VARCHAR2 (1);
1154:
1155: l_formula_tbl gmdfmval_pub.formula_detail_tbl;
1156: l_trolin_tbl inv_move_order_pub.trolin_tbl_type;
1157: l_material_details_tbl gme_common_pvt.material_details_tab;
1158: l_material_details_tbl_out gme_common_pvt.material_details_tab;
1159: l_material_detail_rec gme_material_details%ROWTYPE;
1160: l_return BOOLEAN;
1161: l_return_status VARCHAR2 (1);
1162: x_return_status VARCHAR2 (1);
1179: l_ingred_sub_date DATE; -- nsinghi bug#5674398
1180: setup_failure EXCEPTION;
1181: BEGIN
1182:
1183: gme_common_pvt.g_setup_done :=
1184: gme_common_pvt.setup (p_org_id => p_org_id);
1185:
1186: IF NOT gme_common_pvt.g_setup_done THEN
1187: x_return_status := fnd_api.g_ret_sts_error;
1180: setup_failure EXCEPTION;
1181: BEGIN
1182:
1183: gme_common_pvt.g_setup_done :=
1184: gme_common_pvt.setup (p_org_id => p_org_id);
1185:
1186: IF NOT gme_common_pvt.g_setup_done THEN
1187: x_return_status := fnd_api.g_ret_sts_error;
1188: RAISE setup_failure;
1182:
1183: gme_common_pvt.g_setup_done :=
1184: gme_common_pvt.setup (p_org_id => p_org_id);
1185:
1186: IF NOT gme_common_pvt.g_setup_done THEN
1187: x_return_status := fnd_api.g_ret_sts_error;
1188: RAISE setup_failure;
1189: END IF;
1190: --set the timestamp
1187: x_return_status := fnd_api.g_ret_sts_error;
1188: RAISE setup_failure;
1189: END IF;
1190: --set the timestamp
1191: gme_common_pvt.set_timestamp;
1192:
1193: IF (g_debug IS NOT NULL) THEN
1194: gme_debug.log_initialize ('IngredientSubstitution');
1195: END IF;
1276: l_batch_header_rec.batch_id := rec.batch_id;
1277:
1278: IF NOT (gme_batch_header_dbl.fetch_row (l_batch_header_rec, l_batch_header_rec)) THEN
1279: l_oneitem_error := TRUE;
1280: gme_common_pvt.count_and_get (x_count => l_message_count,
1281: p_encoded => fnd_api.g_false,
1282: x_data => l_message_list
1283: );
1284: GOTO NEXT_RECORD; --GO to next record
1290: IF NOT gme_material_details_dbl.fetch_row (p_material_detail => l_material_detail_rec,
1291: x_material_detail => l_material_detail_rec
1292: ) THEN
1293: l_oneitem_error := TRUE;
1294: gme_common_pvt.count_and_get (x_count => l_message_count,
1295: p_encoded => fnd_api.g_false,
1296: x_data => l_message_list
1297: );
1298: --FPBug#4991508 replaced hard coded output messages
1304: fnd_message.set_token('MSG',l_message_list);
1305: fnd_file.put (fnd_file.output,fnd_message.get);
1306:
1307: fnd_file.new_line (fnd_file.output, 1);
1308: --FPBug#4351032 used gme_common_pvt.log_message
1309: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1310: ,p_token1_name => 'DOC'
1311: ,P_token1_value => l_doc_str||' '||rec.batch_no
1312: ,p_token2_name => 'LINE'
1305: fnd_file.put (fnd_file.output,fnd_message.get);
1306:
1307: fnd_file.new_line (fnd_file.output, 1);
1308: --FPBug#4351032 used gme_common_pvt.log_message
1309: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1310: ,p_token1_name => 'DOC'
1311: ,P_token1_value => l_doc_str||' '||rec.batch_no
1312: ,p_token2_name => 'LINE'
1313: ,P_token2_value => rec.line_no
1317: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1318: ,p_token5_name => 'MSG'
1319: ,P_token5_value => l_message_list
1320: );
1321: gme_common_pvt.count_and_get (x_count => l_message_count,
1322: p_encoded => fnd_api.g_false,
1323: x_data => l_message_list
1324: );
1325: fnd_file.put(fnd_file.output,l_message_list);
1350: fnd_file.put (fnd_file.output,fnd_message.get);
1351:
1352: fnd_file.put(fnd_file.output,l_message_list);
1353: fnd_file.new_line (fnd_file.output, 1);
1354: --FPBug#4351032 used gme_common_pvt.log_message
1355: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION_EXEC'
1356: ,p_token1_name => 'DOC'
1357: ,P_token1_value => l_doc_str||' '||rec.batch_no
1358: ,p_token2_name => 'LINE'
1351:
1352: fnd_file.put(fnd_file.output,l_message_list);
1353: fnd_file.new_line (fnd_file.output, 1);
1354: --FPBug#4351032 used gme_common_pvt.log_message
1355: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION_EXEC'
1356: ,p_token1_name => 'DOC'
1357: ,P_token1_value => l_doc_str||' '||rec.batch_no
1358: ,p_token2_name => 'LINE'
1359: ,P_token2_value => rec.line_no
1363: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1364: ,p_token5_name => 'NEWITEM'
1365: ,P_token5_value => l_new_item_rec.concatenated_segments
1366: );
1367: gme_common_pvt.count_and_get (x_count => l_message_count,
1368: p_encoded => fnd_api.g_false,
1369: x_data => l_message_list
1370: );
1371: fnd_file.put(fnd_file.output,l_message_list);
1386: fnd_file.put (fnd_file.output,fnd_message.get);
1387:
1388: fnd_file.put(fnd_file.output,l_message_list);
1389: fnd_file.new_line (fnd_file.output, 1);
1390: --FPBug#4351032 used gme_common_pvt.log_message
1391: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION_ENG'
1392: ,p_token1_name => 'DOC'
1393: ,P_token1_value => l_doc_str||' '||rec.batch_no
1394: ,p_token2_name => 'LINE'
1387:
1388: fnd_file.put(fnd_file.output,l_message_list);
1389: fnd_file.new_line (fnd_file.output, 1);
1390: --FPBug#4351032 used gme_common_pvt.log_message
1391: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION_ENG'
1392: ,p_token1_name => 'DOC'
1393: ,P_token1_value => l_doc_str||' '||rec.batch_no
1394: ,p_token2_name => 'LINE'
1395: ,P_token2_value => rec.line_no
1399: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1400: ,p_token5_name => 'NEWITEM'
1401: ,P_token5_value => l_new_item_rec.concatenated_segments
1402: );
1403: gme_common_pvt.count_and_get (x_count => l_message_count,
1404: p_encoded => fnd_api.g_false,
1405: x_data => l_message_list
1406: );
1407: fnd_file.put(fnd_file.output,l_message_list);
1420: ,x_return_status => l_return_status);
1421:
1422: IF l_return_status <> fnd_api.g_ret_sts_success THEN
1423: l_oneitem_error := TRUE;
1424: gme_common_pvt.count_and_get (x_count => l_message_count,
1425: p_encoded => fnd_api.g_false,
1426: x_data => l_message_list
1427: );
1428: --FPBug#4991508 replaced hard coded output messages
1435: fnd_file.put (fnd_file.output,fnd_message.get);
1436:
1437: fnd_file.put(fnd_file.output,l_message_list);
1438: fnd_file.new_line (fnd_file.output, 1);
1439: --FPBug#4351032 used gme_common_pvt.log_message
1440: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1441: ,p_token1_name => 'DOC'
1442: ,P_token1_value => l_doc_str||' '||rec.batch_no
1443: ,p_token2_name => 'LINE'
1436:
1437: fnd_file.put(fnd_file.output,l_message_list);
1438: fnd_file.new_line (fnd_file.output, 1);
1439: --FPBug#4351032 used gme_common_pvt.log_message
1440: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1441: ,p_token1_name => 'DOC'
1442: ,P_token1_value => l_doc_str||' '||rec.batch_no
1443: ,p_token2_name => 'LINE'
1444: ,P_token2_value => rec.line_no
1448: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1449: ,p_token5_name => 'MSG'
1450: ,P_token5_value => l_message_list
1451: );
1452: gme_common_pvt.count_and_get (x_count => l_message_count,
1453: p_encoded => fnd_api.g_false,
1454: x_data => l_message_list
1455: );
1456: fnd_file.put(fnd_file.output,l_message_list);
1468: ,x_return_status => l_return_status);
1469:
1470: IF l_return_status <> fnd_api.g_ret_sts_success THEN
1471: l_oneitem_error := TRUE;
1472: gme_common_pvt.count_and_get (x_count => l_message_count,
1473: p_encoded => fnd_api.g_false,
1474: x_data => l_message_list
1475: );
1476: --FPBug#4991508 replaced hard coded output messages
1483: fnd_file.put (fnd_file.output,fnd_message.get);
1484:
1485: fnd_file.put(fnd_file.output,l_message_list);
1486: fnd_file.new_line (fnd_file.output, 1);
1487: --FPBug#4351032 used gme_common_pvt.log_message
1488: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1489: ,p_token1_name => 'DOC'
1490: ,P_token1_value => l_doc_str||' '||rec.batch_no
1491: ,p_token2_name => 'LINE'
1484:
1485: fnd_file.put(fnd_file.output,l_message_list);
1486: fnd_file.new_line (fnd_file.output, 1);
1487: --FPBug#4351032 used gme_common_pvt.log_message
1488: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1489: ,p_token1_name => 'DOC'
1490: ,P_token1_value => l_doc_str||' '||rec.batch_no
1491: ,p_token2_name => 'LINE'
1492: ,P_token2_value => rec.line_no
1496: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1497: ,p_token5_name => 'MSG'
1498: ,P_token5_value => l_message_list
1499: );
1500: gme_common_pvt.count_and_get (x_count => l_message_count,
1501: p_encoded => fnd_api.g_false,
1502: x_data => l_message_list
1503: );
1504: fnd_file.put(fnd_file.output,l_message_list);
1536: l_material_details_tbl(1) := l_material_detail_rec;
1537:
1538: gme_move_orders_pvt.create_move_order_lines (
1539: p_move_order_header_id => l_batch_header_rec.move_order_header_id
1540: ,p_move_order_type => gme_common_pvt.g_invis_move_order_type
1541: ,p_material_details_tbl => l_material_details_tbl
1542: ,x_material_details_tbl => l_material_details_tbl_out
1543: ,x_trolin_tbl => l_trolin_tbl
1544: ,x_return_status => l_return_status);
1544: ,x_return_status => l_return_status);
1545:
1546: IF l_return_status <> fnd_api.g_ret_sts_success THEN
1547: l_oneitem_error := TRUE;
1548: gme_common_pvt.count_and_get (x_count => l_message_count,
1549: p_encoded => fnd_api.g_false,
1550: x_data => l_message_list
1551: );
1552:
1560: fnd_file.put (fnd_file.output,fnd_message.get);
1561:
1562: fnd_file.put(fnd_file.output,l_message_list);
1563: fnd_file.new_line (fnd_file.output, 1);
1564: --FPBug#4351032 used gme_common_pvt.log_message
1565: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1566: ,p_token1_name => 'DOC'
1567: ,P_token1_value => l_doc_str||' '||rec.batch_no
1568: ,p_token2_name => 'LINE'
1561:
1562: fnd_file.put(fnd_file.output,l_message_list);
1563: fnd_file.new_line (fnd_file.output, 1);
1564: --FPBug#4351032 used gme_common_pvt.log_message
1565: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1566: ,p_token1_name => 'DOC'
1567: ,P_token1_value => l_doc_str||' '||rec.batch_no
1568: ,p_token2_name => 'LINE'
1569: ,P_token2_value => rec.line_no
1573: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1574: ,p_token5_name => 'MSG'
1575: ,P_token5_value => l_message_list
1576: );
1577: gme_common_pvt.count_and_get (x_count => l_message_count,
1578: p_encoded => fnd_api.g_false,
1579: x_data => l_message_list
1580: );
1581: fnd_file.put(fnd_file.output,l_message_list);
1592: --Call material_line_dbl.update_rec
1593: l_return := gme_material_details_dbl.update_row (l_material_detail_rec);
1594:
1595: IF (l_return = FALSE) THEN
1596: gme_common_pvt.count_and_get (x_count => l_message_count,
1597: p_encoded => fnd_api.g_false,
1598: x_data => l_message_list
1599: );
1600: l_oneitem_error := TRUE;
1608: fnd_file.put (fnd_file.output,fnd_message.get);
1609:
1610: fnd_file.put(fnd_file.output,l_message_list);
1611: fnd_file.new_line (fnd_file.output, 1);
1612: --FPBug#4351032 used gme_common_pvt.log_message
1613: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1614: ,p_token1_name => 'DOC'
1615: ,P_token1_value => l_doc_str||' '||rec.batch_no
1616: ,p_token2_name => 'LINE'
1609:
1610: fnd_file.put(fnd_file.output,l_message_list);
1611: fnd_file.new_line (fnd_file.output, 1);
1612: --FPBug#4351032 used gme_common_pvt.log_message
1613: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1614: ,p_token1_name => 'DOC'
1615: ,P_token1_value => l_doc_str||' '||rec.batch_no
1616: ,p_token2_name => 'LINE'
1617: ,P_token2_value => rec.line_no
1621: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1622: ,p_token5_name => 'MSG'
1623: ,P_token5_value => l_message_list
1624: );
1625: gme_common_pvt.count_and_get (x_count => l_message_count,
1626: p_encoded => fnd_api.g_false,
1627: x_data => l_message_list
1628: );
1629: fnd_file.put(fnd_file.output,l_message_list);
1641: UPDATE gme_material_details
1642: SET original_primary_qty = l_material_detail_rec.original_primary_qty
1643: WHERE material_detail_id = l_material_detail_rec.material_detail_id;
1644:
1645: l_material_detail_rec.last_update_date := gme_common_pvt.get_timestamp;
1646:
1647: -- Swapna K Bug#4354690 12-MAY-2005
1648: IF l_batch_header_rec.update_inventory_ind = 'Y' AND
1649: l_new_item_rec.mtl_transactions_enabled_flag = 'Y' AND
1659: END IF;
1660:
1661: -- Validate Return Status
1662: IF l_return_status IN (fnd_api.g_ret_sts_unexp_error, fnd_api.g_ret_sts_error) THEN
1663: gme_common_pvt.count_and_get (x_count => l_message_count,
1664: p_encoded => fnd_api.g_false,
1665: x_data => l_message_list
1666: );
1667: l_oneitem_error := TRUE;
1676: fnd_file.put (fnd_file.output,fnd_message.get);
1677:
1678: fnd_file.put(fnd_file.output,l_message_list);
1679: fnd_file.new_line (fnd_file.output, 1);
1680: --FPBug#4351032 used gme_common_pvt.log_message
1681: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1682: ,p_token1_name => 'DOC'
1683: ,P_token1_value => l_doc_str||' '||rec.batch_no
1684: ,p_token2_name => 'LINE'
1677:
1678: fnd_file.put(fnd_file.output,l_message_list);
1679: fnd_file.new_line (fnd_file.output, 1);
1680: --FPBug#4351032 used gme_common_pvt.log_message
1681: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1682: ,p_token1_name => 'DOC'
1683: ,P_token1_value => l_doc_str||' '||rec.batch_no
1684: ,p_token2_name => 'LINE'
1685: ,P_token2_value => rec.line_no
1689: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1690: ,p_token5_name => 'MSG'
1691: ,P_token5_value => l_message_list
1692: );
1693: gme_common_pvt.count_and_get (x_count => l_message_count,
1694: p_encoded => fnd_api.g_false,
1695: x_data => l_message_list
1696: );
1697: fnd_file.put(fnd_file.output,l_message_list);
1720: x_return_status => l_return_status
1721: );
1722:
1723: IF l_return_status <> fnd_api.g_ret_sts_success THEN
1724: gme_common_pvt.count_and_get (x_count => l_message_count,
1725: p_encoded => fnd_api.g_false,
1726: x_data => l_message_list
1727: );
1728: l_oneitem_error := TRUE;
1736: fnd_file.put (fnd_file.output,fnd_message.get);
1737:
1738: fnd_file.put(fnd_file.output,l_message_list);
1739: fnd_file.new_line (fnd_file.output, 1);
1740: --FPBug#4351032 used gme_common_pvt.log_message
1741: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1742: ,p_token1_name => 'DOC'
1743: ,P_token1_value => l_doc_str||' '||rec.batch_no
1744: ,p_token2_name => 'LINE'
1737:
1738: fnd_file.put(fnd_file.output,l_message_list);
1739: fnd_file.new_line (fnd_file.output, 1);
1740: --FPBug#4351032 used gme_common_pvt.log_message
1741: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1742: ,p_token1_name => 'DOC'
1743: ,P_token1_value => l_doc_str||' '||rec.batch_no
1744: ,p_token2_name => 'LINE'
1745: ,P_token2_value => rec.line_no
1749: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1750: ,p_token5_name => 'MSG'
1751: ,P_token5_value => l_message_list
1752: );
1753: gme_common_pvt.count_and_get (x_count => l_message_count,
1754: p_encoded => fnd_api.g_false,
1755: x_data => l_message_list
1756: );
1757: fnd_file.put(fnd_file.output,l_message_list);
1779: END IF;
1780: -- Swapna K Bug#4354690 12-MAY-2005
1781: /* l_return_status is replaced with x_return_status in the below if condition */
1782: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1783: gme_common_pvt.count_and_get (x_count => l_message_count,
1784: p_encoded => fnd_api.g_false,
1785: x_data => l_message_list
1786: );
1787: l_oneitem_error := TRUE;
1796: fnd_file.put (fnd_file.output,fnd_message.get);
1797:
1798: fnd_file.put(fnd_file.output,l_message_list);
1799: fnd_file.new_line (fnd_file.output, 1);
1800: --FPBug#4351032 used gme_common_pvt.log_message
1801: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1802: ,p_token1_name => 'DOC'
1803: ,P_token1_value => l_doc_str||' '||rec.batch_no
1804: ,p_token2_name => 'LINE'
1797:
1798: fnd_file.put(fnd_file.output,l_message_list);
1799: fnd_file.new_line (fnd_file.output, 1);
1800: --FPBug#4351032 used gme_common_pvt.log_message
1801: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1802: ,p_token1_name => 'DOC'
1803: ,P_token1_value => l_doc_str||' '||rec.batch_no
1804: ,p_token2_name => 'LINE'
1805: ,P_token2_value => rec.line_no
1809: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1810: ,p_token5_name => 'MSG'
1811: ,P_token5_value => l_message_list
1812: );
1813: gme_common_pvt.count_and_get (x_count => l_message_count,
1814: p_encoded => fnd_api.g_false,
1815: x_data => l_message_list
1816: );
1817: fnd_file.put(fnd_file.output,l_message_list);
1836: gme_debug.put_line ('After consolidate resource transactions' || x_return_status);
1837: END IF;
1838:
1839: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1840: gme_common_pvt.count_and_get (x_count => l_message_count,
1841: p_encoded => fnd_api.g_false,
1842: x_data => l_message_list
1843: );
1844: l_oneitem_error := TRUE;
1853: fnd_file.put (fnd_file.output,fnd_message.get);
1854:
1855: fnd_file.put(fnd_file.output,l_message_list);
1856: fnd_file.new_line (fnd_file.output, 1);
1857: --FPBug#4351032 used gme_common_pvt.log_message
1858: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1859: ,p_token1_name => 'DOC'
1860: ,P_token1_value => l_doc_str||' '||rec.batch_no
1861: ,p_token2_name => 'LINE'
1854:
1855: fnd_file.put(fnd_file.output,l_message_list);
1856: fnd_file.new_line (fnd_file.output, 1);
1857: --FPBug#4351032 used gme_common_pvt.log_message
1858: gme_common_pvt.log_message(p_message_code => 'GME_NO_SUBSTITUTION'
1859: ,p_token1_name => 'DOC'
1860: ,P_token1_value => l_doc_str||' '||rec.batch_no
1861: ,p_token2_name => 'LINE'
1862: ,P_token2_value => rec.line_no
1866: ,P_token4_value => rec.plan_qty||' '||rec.dtl_um
1867: ,p_token5_name => 'MSG'
1868: ,P_token5_value => l_message_list
1869: );
1870: gme_common_pvt.count_and_get (x_count => l_message_count,
1871: p_encoded => fnd_api.g_false,
1872: x_data => l_message_list
1873: );
1874: fnd_file.put(fnd_file.output,l_message_list);
1892: fnd_file.put (fnd_file.output,fnd_message.get);
1893:
1894: fnd_file.put(fnd_file.output,l_message_list);
1895: fnd_file.new_line (fnd_file.output, 1);
1896: --FPBug#4351032 used gme_common_pvt.log_message
1897: gme_common_pvt.log_message(p_message_code => 'GME_SUBSTITUTION_SUCCESS'
1898: ,p_token1_name => 'DOC'
1899: ,P_token1_value => l_doc_str||' '||rec.batch_no
1900: ,p_token2_name => 'LINE'
1893:
1894: fnd_file.put(fnd_file.output,l_message_list);
1895: fnd_file.new_line (fnd_file.output, 1);
1896: --FPBug#4351032 used gme_common_pvt.log_message
1897: gme_common_pvt.log_message(p_message_code => 'GME_SUBSTITUTION_SUCCESS'
1898: ,p_token1_name => 'DOC'
1899: ,P_token1_value => l_doc_str||' '||rec.batch_no
1900: ,p_token2_name => 'LINE'
1901: ,P_token2_value => rec.line_no
1907: ,P_token5_value => l_new_item_rec.concatenated_segments
1908: ,p_token6_name => 'NEWQTY'
1909: ,P_token6_value => l_formula_tbl (1).qty||' '||l_formula_tbl (1).detail_uom
1910: );
1911: gme_common_pvt.count_and_get (x_count => l_message_count,
1912: p_encoded => fnd_api.g_false,
1913: x_data => l_message_list
1914: );
1915: fnd_file.put(fnd_file.output,l_message_list);
1921:
1922: fnd_file.new_line (fnd_file.output, 1);
1923:
1924: IF l_oneitem_success = TRUE AND l_oneitem_error = TRUE THEN
1925: gme_common_pvt.log_message('GME_ATLEAST_ONE_NOT_SUBSTITUTE');
1926: gme_common_pvt.count_and_get (x_count => l_message_count,
1927: p_encoded => fnd_api.g_false,
1928: x_data => l_message_list
1929: );
1922: fnd_file.new_line (fnd_file.output, 1);
1923:
1924: IF l_oneitem_success = TRUE AND l_oneitem_error = TRUE THEN
1925: gme_common_pvt.log_message('GME_ATLEAST_ONE_NOT_SUBSTITUTE');
1926: gme_common_pvt.count_and_get (x_count => l_message_count,
1927: p_encoded => fnd_api.g_false,
1928: x_data => l_message_list
1929: );
1930: fnd_file.put(fnd_file.output,l_message_list);
1939: --FPBug#4991508 replaced hard coded output messages
1940: fnd_message.set_name('GME','GME_NONE_SUBSTITUTED');
1941: fnd_file.put_line (fnd_file.output, fnd_message.get);
1942:
1943: gme_common_pvt.log_message('GME_NONE_SUBSTITUTED');
1944: gme_common_pvt.count_and_get (x_count => l_message_count,
1945: p_encoded => fnd_api.g_false,
1946: x_data => l_message_list
1947: );
1940: fnd_message.set_name('GME','GME_NONE_SUBSTITUTED');
1941: fnd_file.put_line (fnd_file.output, fnd_message.get);
1942:
1943: gme_common_pvt.log_message('GME_NONE_SUBSTITUTED');
1944: gme_common_pvt.count_and_get (x_count => l_message_count,
1945: p_encoded => fnd_api.g_false,
1946: x_data => l_message_list
1947: );
1948: fnd_file.put(fnd_file.output,l_message_list);
1953: fnd_message.set_name('GME','GME_SUBSTITUTION_SUCCESSFUL');
1954: fnd_file.put_line (fnd_file.output, fnd_message.get);
1955:
1956: errbuf := 'Substitutions are successful';
1957: gme_common_pvt.log_message('GME_SUBSTITUTION_SUCCESSFUL');
1958: gme_common_pvt.count_and_get (x_count => l_message_count,
1959: p_encoded => fnd_api.g_false,
1960: x_data => l_message_list
1961: );
1954: fnd_file.put_line (fnd_file.output, fnd_message.get);
1955:
1956: errbuf := 'Substitutions are successful';
1957: gme_common_pvt.log_message('GME_SUBSTITUTION_SUCCESSFUL');
1958: gme_common_pvt.count_and_get (x_count => l_message_count,
1959: p_encoded => fnd_api.g_false,
1960: x_data => l_message_list
1961: );
1962: fnd_file.put(fnd_file.output,l_message_list);
2032: gme_debug.put_line('Entering gme_api_grp.get_total_quantity with batch id '||p_batch_id);
2033: END IF;
2034:
2035: IF p_batch_id IS NULL THEN
2036: gme_common_pvt.log_message ('GME_INVALID_BATCH','ID','BATCH_ID');
2037: RAISE invalid_batch_id;
2038: END IF;
2039:
2040:
2175: ,x_msg_data OUT NOCOPY VARCHAR2
2176: ,x_return_status OUT NOCOPY VARCHAR2
2177: ) IS
2178: l_mmt_rec mtl_material_transactions%ROWTYPE;
2179: l_mmln_tbl gme_common_pvt.mtl_trans_lots_num_tbl;
2180: l_ret boolean;
2181: l_api_name VARCHAR2 (50) := 'check_inv_negative';
2182: BEGIN
2183: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
2200:
2201: l_ret := gme_unrelease_batch_pvt.check_inv_negative
2202: ( p_mmt_rec => l_mmt_rec
2203: ,p_mmln_tbl => l_mmln_tbl
2204: ,p_org_neg_control => gme_common_pvt.g_allow_neg_inv
2205: ,p_item_no => p_item_no
2206: );
2207: IF l_ret THEN
2208: RAISE fnd_api.g_exc_error;
2207: IF l_ret THEN
2208: RAISE fnd_api.g_exc_error;
2209: END IF;
2210:
2211: gme_common_pvt.count_and_get
2212: ( x_count => x_msg_count
2213: ,p_encoded => fnd_api.g_false
2214: ,x_data => x_msg_data);
2215:
2225: EXCEPTION
2226:
2227: WHEN fnd_api.g_exc_error THEN
2228: x_return_status := fnd_api.g_ret_sts_error;
2229: gme_common_pvt.count_and_get
2230: ( x_count => x_msg_count
2231: ,p_encoded => fnd_api.g_false
2232: ,x_data => x_msg_data);
2233: WHEN fnd_api.g_exc_unexpected_error THEN
2231: ,p_encoded => fnd_api.g_false
2232: ,x_data => x_msg_data);
2233: WHEN fnd_api.g_exc_unexpected_error THEN
2234: x_return_status := fnd_api.g_ret_sts_unexp_error;
2235: gme_common_pvt.count_and_get
2236: ( x_count => x_msg_count
2237: ,p_encoded => fnd_api.g_false
2238: ,x_data => x_msg_data);
2239: WHEN OTHERS THEN
2238: ,x_data => x_msg_data);
2239: WHEN OTHERS THEN
2240: x_return_status := fnd_api.g_ret_sts_unexp_error;
2241: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
2242: gme_common_pvt.count_and_get
2243: ( x_count => x_msg_count
2244: ,p_encoded => fnd_api.g_false
2245: ,x_data => x_msg_data);
2246: IF (NVL (g_debug, -1) = gme_debug.g_log_unexpected) THEN
2288: l_api_name VARCHAR2 (50) := 'get_ingr_sub_date';
2289:
2290: BEGIN
2291: --Take the value of the profile,GME: Ingredient Substitution Date
2292: l_ingred_sub_date := gme_common_pvt.g_ingr_sub_date;
2293: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
2294: gme_debug.put_line ( g_pkg_name
2295: || '.'
2296: || l_api_name
2357: OPEN x_resvns_cur FOR
2358: SELECT mr.*
2359: FROM mtl_reservations mr
2360: WHERE mr.organization_id = p_organization_id
2361: AND mr.demand_source_type_id = gme_common_pvt.g_txn_source_type
2362: AND mr.demand_source_header_id = p_batch_id
2363: AND mr.demand_source_line_id = p_mat_det_id
2364: AND NOT EXISTS (SELECT 1
2365: FROM mtl_material_transactions_temp
2413: SELECT *
2414: FROM mtl_material_transactions mmt
2415: WHERE trx_source_line_id = p_mat_det_id
2416: AND transaction_source_id = p_batch_id
2417: AND transaction_source_type_id = gme_common_pvt.g_txn_source_type
2418: AND NOT EXISTS (SELECT /*+ no_unnest */
2419: transaction_id1
2420: FROM gme_transaction_pairs
2421: WHERE transaction_id1 = mmt.transaction_id
2418: AND NOT EXISTS (SELECT /*+ no_unnest */
2419: transaction_id1
2420: FROM gme_transaction_pairs
2421: WHERE transaction_id1 = mmt.transaction_id
2422: AND pair_type = gme_common_pvt.g_pairs_reversal_type)
2423: ORDER BY mmt.transaction_id;
2424: EXCEPTION
2425: WHEN OTHERS THEN
2426: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2452: END IF;
2453: END get_lot_trans;
2454:
2455: PROCEDURE create_material_txn(p_mmti_rec IN mtl_transactions_interface%ROWTYPE,
2456: p_mmli_tbl IN gme_common_pvt.mtl_trans_lots_inter_tbl,
2457: x_return_status OUT NOCOPY VARCHAR2) IS
2458: l_api_name CONSTANT VARCHAR2 (30) := 'create_material_txn';
2459: l_return_status VARCHAR2(1);
2460: setup_failed EXCEPTION;
2464: IF g_debug <= gme_debug.g_log_procedure THEN
2465: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2466: END IF;
2467: x_return_status := FND_API.G_RET_STS_SUCCESS;
2468: IF NOT(gme_common_pvt.g_setup_done) THEN
2469: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_mmti_rec.organization_id);
2470: IF NOT(gme_common_pvt.g_setup_done) THEN
2471: RAISE setup_failed;
2472: END IF;
2465: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2466: END IF;
2467: x_return_status := FND_API.G_RET_STS_SUCCESS;
2468: IF NOT(gme_common_pvt.g_setup_done) THEN
2469: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_mmti_rec.organization_id);
2470: IF NOT(gme_common_pvt.g_setup_done) THEN
2471: RAISE setup_failed;
2472: END IF;
2473: END IF;
2466: END IF;
2467: x_return_status := FND_API.G_RET_STS_SUCCESS;
2468: IF NOT(gme_common_pvt.g_setup_done) THEN
2469: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_mmti_rec.organization_id);
2470: IF NOT(gme_common_pvt.g_setup_done) THEN
2471: RAISE setup_failed;
2472: END IF;
2473: END IF;
2474: IF (gme_common_pvt.g_timestamp IS NULL) THEN
2470: IF NOT(gme_common_pvt.g_setup_done) THEN
2471: RAISE setup_failed;
2472: END IF;
2473: END IF;
2474: IF (gme_common_pvt.g_timestamp IS NULL) THEN
2475: gme_common_pvt.set_timestamp;
2476: END IF;
2477: gme_transactions_pvt.gmo_pre_process_val(p_mmti_rec => p_mmti_rec,
2478: p_mmli_tbl => p_mmli_tbl,
2471: RAISE setup_failed;
2472: END IF;
2473: END IF;
2474: IF (gme_common_pvt.g_timestamp IS NULL) THEN
2475: gme_common_pvt.set_timestamp;
2476: END IF;
2477: gme_transactions_pvt.gmo_pre_process_val(p_mmti_rec => p_mmti_rec,
2478: p_mmli_tbl => p_mmli_tbl,
2479: p_mode => 'I',
2504: END create_material_txn;
2505:
2506: PROCEDURE update_material_txn(p_transaction_id IN NUMBER,
2507: p_mmti_rec IN mtl_transactions_interface%ROWTYPE,
2508: p_mmli_tbl IN gme_common_pvt.mtl_trans_lots_inter_tbl,
2509: x_return_status OUT NOCOPY VARCHAR2) IS
2510: l_api_name CONSTANT VARCHAR2 (30) := 'update_material_txn';
2511: l_return_status VARCHAR2(1);
2512: l_org_id NUMBER;
2525: IF g_debug <= gme_debug.g_log_procedure THEN
2526: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2527: END IF;
2528: x_return_status := FND_API.G_RET_STS_SUCCESS;
2529: IF NOT(gme_common_pvt.g_setup_done) THEN
2530: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_mmti_rec.organization_id);
2531: IF NOT(gme_common_pvt.g_setup_done) THEN
2532: RAISE setup_failed;
2533: END IF;
2526: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2527: END IF;
2528: x_return_status := FND_API.G_RET_STS_SUCCESS;
2529: IF NOT(gme_common_pvt.g_setup_done) THEN
2530: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_mmti_rec.organization_id);
2531: IF NOT(gme_common_pvt.g_setup_done) THEN
2532: RAISE setup_failed;
2533: END IF;
2534: END IF;
2527: END IF;
2528: x_return_status := FND_API.G_RET_STS_SUCCESS;
2529: IF NOT(gme_common_pvt.g_setup_done) THEN
2530: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_mmti_rec.organization_id);
2531: IF NOT(gme_common_pvt.g_setup_done) THEN
2532: RAISE setup_failed;
2533: END IF;
2534: END IF;
2535: IF (gme_common_pvt.g_timestamp IS NULL) THEN
2531: IF NOT(gme_common_pvt.g_setup_done) THEN
2532: RAISE setup_failed;
2533: END IF;
2534: END IF;
2535: IF (gme_common_pvt.g_timestamp IS NULL) THEN
2536: gme_common_pvt.set_timestamp;
2537: END IF;
2538: OPEN Cur_get_trans(p_transaction_id);
2539: FETCH Cur_get_trans INTO l_org_id, l_batch_id, l_material_detail_id, l_txn_type_id;
2532: RAISE setup_failed;
2533: END IF;
2534: END IF;
2535: IF (gme_common_pvt.g_timestamp IS NULL) THEN
2536: gme_common_pvt.set_timestamp;
2537: END IF;
2538: OPEN Cur_get_trans(p_transaction_id);
2539: FETCH Cur_get_trans INTO l_org_id, l_batch_id, l_material_detail_id, l_txn_type_id;
2540: CLOSE Cur_get_trans;
2564: EXCEPTION
2565: WHEN setup_failed THEN
2566: x_return_status := FND_API.G_RET_STS_ERROR;
2567: WHEN update_txn_mismatch THEN
2568: gme_common_pvt.log_message('GME_TXN_UPDATE_MISMATCH');
2569: x_return_status := FND_API.G_RET_STS_ERROR;
2570: WHEN update_txn_fail OR validate_txn_fail THEN
2571: x_return_status := l_return_status;
2572: WHEN OTHERS THEN
2582: x_return_status OUT NOCOPY VARCHAR2) IS
2583: l_api_name CONSTANT VARCHAR2 (30) := 'delete_material_txn';
2584: l_return_status VARCHAR2(1);
2585: l_mmt_rec mtl_material_transactions%ROWTYPE;
2586: l_mmln_tbl gme_common_pvt.mtl_trans_lots_num_tbl;
2587: l_mmti_rec mtl_transactions_interface%ROWTYPE;
2588: l_mmli_tbl gme_common_pvt.mtl_trans_lots_inter_tbl;
2589: setup_failed EXCEPTION;
2590: delete_txn_fail EXCEPTION;
2584: l_return_status VARCHAR2(1);
2585: l_mmt_rec mtl_material_transactions%ROWTYPE;
2586: l_mmln_tbl gme_common_pvt.mtl_trans_lots_num_tbl;
2587: l_mmti_rec mtl_transactions_interface%ROWTYPE;
2588: l_mmli_tbl gme_common_pvt.mtl_trans_lots_inter_tbl;
2589: setup_failed EXCEPTION;
2590: delete_txn_fail EXCEPTION;
2591: get_txn_fail EXCEPTION;
2592: const_txn_fail EXCEPTION;
2595: IF g_debug <= gme_debug.g_log_procedure THEN
2596: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2597: END IF;
2598: x_return_status := FND_API.G_RET_STS_SUCCESS;
2599: IF NOT(gme_common_pvt.g_setup_done) THEN
2600: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_organization_id);
2601: IF NOT(gme_common_pvt.g_setup_done) THEN
2602: RAISE setup_failed;
2603: END IF;
2596: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2597: END IF;
2598: x_return_status := FND_API.G_RET_STS_SUCCESS;
2599: IF NOT(gme_common_pvt.g_setup_done) THEN
2600: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_organization_id);
2601: IF NOT(gme_common_pvt.g_setup_done) THEN
2602: RAISE setup_failed;
2603: END IF;
2604: END IF;
2597: END IF;
2598: x_return_status := FND_API.G_RET_STS_SUCCESS;
2599: IF NOT(gme_common_pvt.g_setup_done) THEN
2600: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_organization_id);
2601: IF NOT(gme_common_pvt.g_setup_done) THEN
2602: RAISE setup_failed;
2603: END IF;
2604: END IF;
2605: IF (gme_common_pvt.g_timestamp IS NULL) THEN
2601: IF NOT(gme_common_pvt.g_setup_done) THEN
2602: RAISE setup_failed;
2603: END IF;
2604: END IF;
2605: IF (gme_common_pvt.g_timestamp IS NULL) THEN
2606: gme_common_pvt.set_timestamp;
2607: END IF;
2608: gme_transactions_pvt.get_mmt_transactions(p_transaction_id => p_transaction_id,
2609: x_mmt_rec => l_mmt_rec,
2602: RAISE setup_failed;
2603: END IF;
2604: END IF;
2605: IF (gme_common_pvt.g_timestamp IS NULL) THEN
2606: gme_common_pvt.set_timestamp;
2607: END IF;
2608: gme_transactions_pvt.get_mmt_transactions(p_transaction_id => p_transaction_id,
2609: x_mmt_rec => l_mmt_rec,
2610: x_mmln_tbl => l_mmln_tbl,
2678: IF g_debug <= gme_debug.g_log_procedure THEN
2679: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2680: END IF;
2681: x_return_status := FND_API.G_RET_STS_SUCCESS;
2682: IF NOT(gme_common_pvt.g_setup_done) THEN
2683: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_rsrc_txn_gtmp_rec.organization_id);
2684: IF NOT(gme_common_pvt.g_setup_done) THEN
2685: RAISE setup_failed;
2686: END IF;
2679: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2680: END IF;
2681: x_return_status := FND_API.G_RET_STS_SUCCESS;
2682: IF NOT(gme_common_pvt.g_setup_done) THEN
2683: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_rsrc_txn_gtmp_rec.organization_id);
2684: IF NOT(gme_common_pvt.g_setup_done) THEN
2685: RAISE setup_failed;
2686: END IF;
2687: END IF;
2680: END IF;
2681: x_return_status := FND_API.G_RET_STS_SUCCESS;
2682: IF NOT(gme_common_pvt.g_setup_done) THEN
2683: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_rsrc_txn_gtmp_rec.organization_id);
2684: IF NOT(gme_common_pvt.g_setup_done) THEN
2685: RAISE setup_failed;
2686: END IF;
2687: END IF;
2688: gme_common_pvt.set_timestamp;
2684: IF NOT(gme_common_pvt.g_setup_done) THEN
2685: RAISE setup_failed;
2686: END IF;
2687: END IF;
2688: gme_common_pvt.set_timestamp;
2689: gme_resource_engine_pvt.validate_rsrc_txn_param(p_called_from => 3
2690: ,p_batchstep_rsrc_id => p_rsrc_txn_gtmp_rec.line_id
2691: ,p_org_code => gme_common_pvt.g_organization_code
2692: ,p_trans_date => p_rsrc_txn_gtmp_rec.trans_date
2687: END IF;
2688: gme_common_pvt.set_timestamp;
2689: gme_resource_engine_pvt.validate_rsrc_txn_param(p_called_from => 3
2690: ,p_batchstep_rsrc_id => p_rsrc_txn_gtmp_rec.line_id
2691: ,p_org_code => gme_common_pvt.g_organization_code
2692: ,p_trans_date => p_rsrc_txn_gtmp_rec.trans_date
2693: ,p_start_date => p_rsrc_txn_gtmp_rec.start_date
2694: ,p_end_date => p_rsrc_txn_gtmp_rec.end_date
2695: ,p_usage => p_rsrc_txn_gtmp_rec.resource_usage
2708: RAISE validate_txn_fail;
2709: END IF;
2710: l_usage_time := (p_rsrc_txn_gtmp_rec.end_date - p_rsrc_txn_gtmp_rec.start_date) * 24;
2711: l_hour_um := fnd_profile.value_specific(name => 'BOM:HOUR_UOM_CODE'
2712: ,user_id => gme_common_pvt.g_user_ident);
2713: IF (l_hour_um IS NULL) THEN
2714: gme_common_pvt.log_message('GME_API_UNABLE_TO_GET_CONSTANT','CONSTANT_NAME','BOM:HOUR_UOM_CODE');
2715: RAISE missing_profile_option;
2716: END IF;
2710: l_usage_time := (p_rsrc_txn_gtmp_rec.end_date - p_rsrc_txn_gtmp_rec.start_date) * 24;
2711: l_hour_um := fnd_profile.value_specific(name => 'BOM:HOUR_UOM_CODE'
2712: ,user_id => gme_common_pvt.g_user_ident);
2713: IF (l_hour_um IS NULL) THEN
2714: gme_common_pvt.log_message('GME_API_UNABLE_TO_GET_CONSTANT','CONSTANT_NAME','BOM:HOUR_UOM_CODE');
2715: RAISE missing_profile_option;
2716: END IF;
2717: IF l_hour_um <> p_rsrc_txn_gtmp_rec.trans_um THEN
2718: l_txn_usage := inv_convert.inv_um_convert (item_id => 0
2722: ,to_unit => p_rsrc_txn_gtmp_rec.trans_um
2723: ,from_name => NULL
2724: ,to_name => NULL);
2725: IF (l_txn_usage = -99999) THEN
2726: gme_common_pvt.log_message ('GME_RSRC_USG_NT_CNV_SYUOM', 'SY_UOM', l_hour_um, 'RSRC_USG_UOM', p_rsrc_txn_gtmp_rec.trans_um);
2727: RAISE uom_conversion_err;
2728: END IF;
2729: ELSE
2730: l_txn_usage := l_usage_time;
2800: IF g_debug <= gme_debug.g_log_procedure THEN
2801: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2802: END IF;
2803: x_return_status := FND_API.G_RET_STS_SUCCESS;
2804: IF NOT(gme_common_pvt.g_setup_done) THEN
2805: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_rsrc_txn_gtmp_rec.organization_id);
2806: IF NOT(gme_common_pvt.g_setup_done) THEN
2807: RAISE setup_failed;
2808: END IF;
2801: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2802: END IF;
2803: x_return_status := FND_API.G_RET_STS_SUCCESS;
2804: IF NOT(gme_common_pvt.g_setup_done) THEN
2805: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_rsrc_txn_gtmp_rec.organization_id);
2806: IF NOT(gme_common_pvt.g_setup_done) THEN
2807: RAISE setup_failed;
2808: END IF;
2809: END IF;
2802: END IF;
2803: x_return_status := FND_API.G_RET_STS_SUCCESS;
2804: IF NOT(gme_common_pvt.g_setup_done) THEN
2805: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_rsrc_txn_gtmp_rec.organization_id);
2806: IF NOT(gme_common_pvt.g_setup_done) THEN
2807: RAISE setup_failed;
2808: END IF;
2809: END IF;
2810: gme_common_pvt.set_timestamp;
2806: IF NOT(gme_common_pvt.g_setup_done) THEN
2807: RAISE setup_failed;
2808: END IF;
2809: END IF;
2810: gme_common_pvt.set_timestamp;
2811: gme_resource_engine_pvt.validate_rsrc_txn_param(p_called_from => 1
2812: ,p_batchstep_rsrc_id => p_rsrc_txn_gtmp_rec.line_id
2813: ,p_org_code => gme_common_pvt.g_organization_code
2814: ,p_trans_date => p_rsrc_txn_gtmp_rec.trans_date
2809: END IF;
2810: gme_common_pvt.set_timestamp;
2811: gme_resource_engine_pvt.validate_rsrc_txn_param(p_called_from => 1
2812: ,p_batchstep_rsrc_id => p_rsrc_txn_gtmp_rec.line_id
2813: ,p_org_code => gme_common_pvt.g_organization_code
2814: ,p_trans_date => p_rsrc_txn_gtmp_rec.trans_date
2815: ,p_start_date => p_rsrc_txn_gtmp_rec.start_date
2816: ,p_end_date => p_rsrc_txn_gtmp_rec.end_date
2817: ,p_usage => p_rsrc_txn_gtmp_rec.resource_usage
2902: IF g_debug <= gme_debug.g_log_procedure THEN
2903: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2904: END IF;
2905: x_return_status := FND_API.G_RET_STS_SUCCESS;
2906: IF NOT(gme_common_pvt.g_setup_done) THEN
2907: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_rsrc_txn_gtmp_rec.organization_id);
2908: IF NOT(gme_common_pvt.g_setup_done) THEN
2909: RAISE setup_failed;
2910: END IF;
2903: gme_debug.put_line ('Entering api ' || g_pkg_name || '.' || l_api_name);
2904: END IF;
2905: x_return_status := FND_API.G_RET_STS_SUCCESS;
2906: IF NOT(gme_common_pvt.g_setup_done) THEN
2907: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_rsrc_txn_gtmp_rec.organization_id);
2908: IF NOT(gme_common_pvt.g_setup_done) THEN
2909: RAISE setup_failed;
2910: END IF;
2911: END IF;
2904: END IF;
2905: x_return_status := FND_API.G_RET_STS_SUCCESS;
2906: IF NOT(gme_common_pvt.g_setup_done) THEN
2907: gme_common_pvt.g_setup_done := gme_common_pvt.setup(p_org_id => p_rsrc_txn_gtmp_rec.organization_id);
2908: IF NOT(gme_common_pvt.g_setup_done) THEN
2909: RAISE setup_failed;
2910: END IF;
2911: END IF;
2912: gme_common_pvt.set_timestamp;
2908: IF NOT(gme_common_pvt.g_setup_done) THEN
2909: RAISE setup_failed;
2910: END IF;
2911: END IF;
2912: gme_common_pvt.set_timestamp;
2913: IF NOT gme_resource_txns_gtmp_dbl.fetch_row(p_rsrc_txn_gtmp_rec, l_rsrc_txn_gtmp_rec) THEN
2914: RAISE fetch_txn_failed;
2915: END IF;
2916: OPEN Cur_get_step(l_rsrc_txn_gtmp_rec.line_id);
2916: OPEN Cur_get_step(l_rsrc_txn_gtmp_rec.line_id);
2917: FETCH Cur_get_step INTO l_step_status, l_asqc;
2918: CLOSE Cur_get_step;
2919: IF l_step_status NOT IN (2, 3) THEN
2920: gme_common_pvt.log_message ('PC_STEP_STATUS_ERR');
2921: RAISE validation_fail;
2922: END IF;
2923: IF (l_asqc = 1 AND l_step_status = 2) THEN
2924: gme_common_pvt.log_message ('GME_INV_STEP_STATUS_ASQC');
2920: gme_common_pvt.log_message ('PC_STEP_STATUS_ERR');
2921: RAISE validation_fail;
2922: END IF;
2923: IF (l_asqc = 1 AND l_step_status = 2) THEN
2924: gme_common_pvt.log_message ('GME_INV_STEP_STATUS_ASQC');
2925: RAISE validation_fail;
2926: END IF;
2927: gme_resource_engine_pvt.delete_resource_trans(p_tran_rec => l_rsrc_txn_gtmp_rec
2928: ,x_return_status => l_return_status);