DBA Data[Home] [Help]

APPS.GME_COMPLETE_BATCH_STEP_PVT dependencies on GME_COMMON_PVT

Line 35: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

31: PROCEDURE complete_step
32: (p_batch_step_rec IN GME_BATCH_STEPS%ROWTYPE
33: ,p_batch_header_rec IN gme_batch_header%ROWTYPE
34: ,x_batch_step_rec OUT NOCOPY GME_BATCH_STEPS%ROWTYPE
35: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
36: ,x_return_status OUT NOCOPY VARCHAR2) IS
37:
38: CURSOR Cur_step_count(v_batch_id NUMBER) IS
39: SELECT count(1)

Line 42: AND step_status < gme_common_pvt.g_step_completed

38: CURSOR Cur_step_count(v_batch_id NUMBER) IS
39: SELECT count(1)
40: FROM GME_BATCH_STEPS
41: WHERE batch_id = v_batch_id
42: AND step_status < gme_common_pvt.g_step_completed
43: AND rownum = 1;
44:
45: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step';
46:

Line 77: IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN

73:
74: -- if the step status is pending, call release step first... don't need to worry
75: -- about calling release batch if the batch is pending because release step will take
76: -- care of this; check for step control batch and not a phantom done in pub
77: IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN
78: -- actual start date already populated in p_batch_step_rec
79: gme_release_batch_step_pvt.release_step
80: (p_batch_step_rec => p_batch_step_rec
81: ,p_batch_header_rec => p_batch_header_rec

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

82: ,x_batch_step_rec => l_batch_step_rec
83: ,x_exception_material_tbl => x_exception_material_tbl
84: ,x_return_status => l_return_status);
85:
86: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
87: x_return_status := l_return_status;
88: RAISE error_release_batch;
89: END IF;
90:

Line 91: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

87: x_return_status := l_return_status;
88: RAISE error_release_batch;
89: END IF;
90:
91: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
92: x_return_status := gme_common_pvt.g_exceptions_err;
93: END IF;
94:
95: -- re-retrieve the batch header if the batch status was pending

Line 92: x_return_status := gme_common_pvt.g_exceptions_err;

88: RAISE error_release_batch;
89: END IF;
90:
91: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
92: x_return_status := gme_common_pvt.g_exceptions_err;
93: END IF;
94:
95: -- re-retrieve the batch header if the batch status was pending
96: IF (p_batch_header_rec.batch_status = gme_common_pvt.g_batch_pending) THEN

Line 96: IF (p_batch_header_rec.batch_status = gme_common_pvt.g_batch_pending) THEN

92: x_return_status := gme_common_pvt.g_exceptions_err;
93: END IF;
94:
95: -- re-retrieve the batch header if the batch status was pending
96: IF (p_batch_header_rec.batch_status = gme_common_pvt.g_batch_pending) THEN
97: IF NOT gme_batch_header_dbl.fetch_row(l_batch_header_rec, l_batch_header_rec) THEN
98: RAISE error_fetch;
99: END IF;
100: END IF;

Line 102: END IF; /* IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending */

98: RAISE error_fetch;
99: END IF;
100: END IF;
101:
102: END IF; /* IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending */
103:
104: -- Bug 8252288 - Added last parameter to reinstate behavior before 6348353 was implemented.
105: complete_step_recursive
106: (p_batch_step_rec => l_batch_step_rec

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

109: ,x_exception_material_tbl => x_exception_material_tbl
110: ,x_return_status => l_return_status
111: ,p_quality_override => TRUE);
112:
113: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
114: x_return_status := l_return_status;
115: RAISE error_complete_step_rec;
116: END IF;
117:

Line 118: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

114: x_return_status := l_return_status;
115: RAISE error_complete_step_rec;
116: END IF;
117:
118: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
119: x_return_status := gme_common_pvt.g_exceptions_err;
120: END IF;
121:
122: /* If the step controls batch status profile is set then to complete the batch */

Line 119: x_return_status := gme_common_pvt.g_exceptions_err;

115: RAISE error_complete_step_rec;
116: END IF;
117:
118: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
119: x_return_status := gme_common_pvt.g_exceptions_err;
120: END IF;
121:
122: /* If the step controls batch status profile is set then to complete the batch */
123: /* if all the steps are complete and this is not a phantom batch */

Line 126: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' step controls batch= '||gme_common_pvt.g_step_controls_batch_sts_ind);

122: /* If the step controls batch status profile is set then to complete the batch */
123: /* if all the steps are complete and this is not a phantom batch */
124:
125: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
126: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' step controls batch= '||gme_common_pvt.g_step_controls_batch_sts_ind);
127: END IF;
128:
129: IF (gme_common_pvt.g_step_controls_batch_sts_ind = 1) AND (l_batch_header_rec.parentline_id IS NULL) AND
130: (l_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed) THEN

Line 129: IF (gme_common_pvt.g_step_controls_batch_sts_ind = 1) AND (l_batch_header_rec.parentline_id IS NULL) AND

125: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
126: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' step controls batch= '||gme_common_pvt.g_step_controls_batch_sts_ind);
127: END IF;
128:
129: IF (gme_common_pvt.g_step_controls_batch_sts_ind = 1) AND (l_batch_header_rec.parentline_id IS NULL) AND
130: (l_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed) THEN
131: /* Get the count of the number of steps less than complete for this batch */
132:
133: OPEN Cur_step_count(l_batch_header_rec.batch_id);

Line 130: (l_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed) THEN

126: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' step controls batch= '||gme_common_pvt.g_step_controls_batch_sts_ind);
127: END IF;
128:
129: IF (gme_common_pvt.g_step_controls_batch_sts_ind = 1) AND (l_batch_header_rec.parentline_id IS NULL) AND
130: (l_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed) THEN
131: /* Get the count of the number of steps less than complete for this batch */
132:
133: OPEN Cur_step_count(l_batch_header_rec.batch_id);
134: FETCH Cur_step_count INTO l_step_count;

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

161: ,x_exception_material_tbl => x_exception_material_tbl
162: ,x_batch_header_rec => l_batch_header_rec
163: ,x_return_status => l_return_status);
164:
165: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
166: x_return_status := l_return_status;
167: RAISE error_complete_batch;
168: END IF;
169:

Line 170: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

166: x_return_status := l_return_status;
167: RAISE error_complete_batch;
168: END IF;
169:
170: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
171: x_return_status := gme_common_pvt.g_exceptions_err;
172: ELSE
173: -- Bug 12742260 - Purge the data only if there are no exceptions.
174: -- Bug 8472384 - Delete all remaining reservations including for phantom batches.

Line 171: x_return_status := gme_common_pvt.g_exceptions_err;

167: RAISE error_complete_batch;
168: END IF;
169:
170: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
171: x_return_status := gme_common_pvt.g_exceptions_err;
172: ELSE
173: -- Bug 12742260 - Purge the data only if there are no exceptions.
174: -- Bug 8472384 - Delete all remaining reservations including for phantom batches.
175: gme_cancel_batch_pvt.purge_batch_exceptions (p_batch_header_rec => l_batch_header_rec

Line 192: END IF; /* IF (gme_common_pvt.g_step_controls_batch_sts_ind = 'Y') AND */

188: RAISE purge_exception_err;
189: END IF;
190: END IF;
191: END IF; /* IF l_step_count = 0 */
192: END IF; /* IF (gme_common_pvt.g_step_controls_batch_sts_ind = 'Y') AND */
193:
194: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
195: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
196: END IF;

Line 203: gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR'

199: WHEN error_release_batch OR error_complete_batch OR
200: error_complete_step_rec OR error_validation OR purge_exception_err THEN
201: NULL;
202: WHEN error_fetch THEN
203: gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR'
204: ,SQLERRM);
205: x_return_status := fnd_api.g_ret_sts_unexp_error;
206: WHEN OTHERS THEN
207: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);

Line 218: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

214: PROCEDURE complete_step_recursive
215: (p_batch_step_rec IN gme_batch_steps%ROWTYPE
216: ,p_batch_header_rec IN gme_batch_header%ROWTYPE
217: ,x_batch_step_rec OUT NOCOPY gme_batch_steps%ROWTYPE
218: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
219: ,x_return_status OUT NOCOPY VARCHAR2
220: ,p_quality_override IN BOOLEAN := FALSE) IS --Bug#6348353
221:
222: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_recursive';

Line 252: IF x_batch_step_rec.step_status IN (gme_common_pvt.g_step_completed

248:
249: x_batch_step_rec := p_batch_step_rec;
250:
251: /* Exit the recursive loop if the step is already released, completed or closed */
252: IF x_batch_step_rec.step_status IN (gme_common_pvt.g_step_completed
253: ,gme_common_pvt.g_step_closed) THEN
254: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
255: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'step is completed or closed; returning');
256: END IF;

Line 253: ,gme_common_pvt.g_step_closed) THEN

249: x_batch_step_rec := p_batch_step_rec;
250:
251: /* Exit the recursive loop if the step is already released, completed or closed */
252: IF x_batch_step_rec.step_status IN (gme_common_pvt.g_step_completed
253: ,gme_common_pvt.g_step_closed) THEN
254: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
255: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'step is completed or closed; returning');
256: END IF;
257: RAISE step_cmpl_closed;

Line 274: P_REQUESTER => gme_common_pvt.g_user_ident,

270: X_MSG_COUNT => l_msg_count,
271: X_MSG_DATA => l_msg_stack,
272: P_ENTITY_NAME => 'OPERATION',
273: P_ENTITY_KEY => x_batch_step_rec.batchstep_id,
274: P_REQUESTER => gme_common_pvt.g_user_ident,
275: X_LOCK_STATUS => l_lock_status,
276: X_LOCKED_BY_STATUS => l_locked_by_status,
277: X_LOCK_ALLOWED => l_lock_allowed);
278:

Line 293: gme_common_pvt.log_message ('GME_STEP_LOCK_ERROR');

289: || l_lock_status);
290: END IF;
291:
292: IF l_lock_status = 'Y' THEN
293: gme_common_pvt.log_message ('GME_STEP_LOCK_ERROR');
294: RAISE gmo_lock_error;
295: END IF;
296: END IF;
297:

Line 302: IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed THEN

298:
299: /* If this procedure is invoked while completing the entire batch */
300: /* then there is no need to go through the recursive procedure as */
301: /* the complete batch call completes all the steps */
302: IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed THEN
303: gme_release_batch_step_pvt.process_dependent_steps
304: (p_batch_step_rec => p_batch_step_rec
305: ,p_batch_header_rec => p_batch_header_rec
306: ,x_exception_material_tbl => x_exception_material_tbl

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

305: ,p_batch_header_rec => p_batch_header_rec
306: ,x_exception_material_tbl => x_exception_material_tbl
307: ,x_return_status => l_return_status);
308:
309: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
310: x_return_status := l_return_status;
311: RAISE error_process_dep_steps;
312: END IF;
313:

Line 314: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

310: x_return_status := l_return_status;
311: RAISE error_process_dep_steps;
312: END IF;
313:
314: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
315: x_return_status := gme_common_pvt.g_exceptions_err;
316: END IF;
317: END IF; -- IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed THEN
318:

Line 315: x_return_status := gme_common_pvt.g_exceptions_err;

311: RAISE error_process_dep_steps;
312: END IF;
313:
314: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
315: x_return_status := gme_common_pvt.g_exceptions_err;
316: END IF;
317: END IF; -- IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed THEN
318:
319: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN

Line 317: END IF; -- IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed THEN

313:
314: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
315: x_return_status := gme_common_pvt.g_exceptions_err;
316: END IF;
317: END IF; -- IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed THEN
318:
319: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
320: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'Calling complete step line to create product transactions...');
321: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' for step = '|| x_batch_step_rec.batchstep_id);

Line 337: IF p_batch_header_rec.batch_status = gme_common_pvt.g_batch_completed THEN

333: -- If the batch status is certified, then this indicates that the user
334: -- is performing a full batch certification. That is, the call to this
335: -- function is via a batch certification and not the certification of the step.
336: l_in_batch_step_rec := x_batch_step_rec;
337: IF p_batch_header_rec.batch_status = gme_common_pvt.g_batch_completed THEN
338: IF l_in_batch_step_rec.actual_cmplt_date IS NULL THEN
339: l_in_batch_step_rec.actual_cmplt_date := p_batch_header_rec.actual_cmplt_date;
340: END IF;
341: /* If the Batch Step has not yet been Released then the Actual */

Line 344: IF p_batch_step_rec.step_status < gme_common_pvt.g_step_wip THEN

340: END IF;
341: /* If the Batch Step has not yet been Released then the Actual */
342: /* Start Date must also be assigned here. It will be set to the */
343: /* actual completion date of the batch. */
344: IF p_batch_step_rec.step_status < gme_common_pvt.g_step_wip THEN
345: l_in_batch_step_rec.actual_start_date := p_batch_header_rec.actual_cmplt_date;
346: END IF;
347: END IF;
348:

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

363: ,p_update_inv_ind => p_batch_header_rec.update_inventory_ind
364: ,x_exception_material_tbl => x_exception_material_tbl
365: ,x_return_status => l_return_status);
366:
367: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
368: x_return_status := l_return_status;
369: RAISE cmpl_step_prod_error;
370: END IF;
371:

Line 372: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

368: x_return_status := l_return_status;
369: RAISE cmpl_step_prod_error;
370: END IF;
371:
372: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
373: x_return_status := gme_common_pvt.g_exceptions_err;
374: END IF;
375:
376: /* Invoke the update step qty API to update the step quantities and the */

Line 373: x_return_status := gme_common_pvt.g_exceptions_err;

369: RAISE cmpl_step_prod_error;
370: END IF;
371:
372: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
373: x_return_status := gme_common_pvt.g_exceptions_err;
374: END IF;
375:
376: /* Invoke the update step qty API to update the step quantities and the */
377: /* quantities of the succeeding steps */

Line 410: gme_common_pvt.log_message('GME_QUALITY_NOT_COMPLETE'

406:
407: END IF;
408: x_return_status := fnd_api.g_ret_sts_error;
409: WHEN error_quality_status THEN --Bug#6348353
410: gme_common_pvt.log_message('GME_QUALITY_NOT_COMPLETE'
411: ,'STEP_NO', x_batch_step_rec.batchstep_no
412: ,'BATCH_NO', p_batch_header_rec.batch_no);
413: x_return_status := fnd_api.g_ret_sts_error;
414: WHEN OTHERS THEN

Line 441: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

437:
438: PROCEDURE complete_step_line
439: (p_batch_step_rec IN gme_batch_steps%ROWTYPE
440: ,x_batch_step_rec OUT NOCOPY gme_batch_steps%ROWTYPE
441: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
442: ,x_return_status OUT NOCOPY VARCHAR2) IS
443:
444: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_line';
445:

Line 461: x_batch_step_rec.step_status := gme_common_pvt.g_step_completed;

457: -- latest data and in addition has the actual completion date calculated and set
458: x_batch_step_rec := p_batch_step_rec;
459:
460: /* Update the Batch Step Status to WIP */
461: x_batch_step_rec.step_status := gme_common_pvt.g_step_completed;
462:
463: -- Update the batch step
464: IF NOT (gme_batch_steps_dbl.update_row (x_batch_step_rec)) THEN
465: RAISE batch_step_upd_err;

Line 469: x_batch_step_rec.last_updated_by := gme_common_pvt.g_user_ident;

465: RAISE batch_step_upd_err;
466: END IF;
467:
468: -- Update WHO columns for output structure
469: x_batch_step_rec.last_updated_by := gme_common_pvt.g_user_ident;
470: x_batch_step_rec.last_update_date := gme_common_pvt.g_timestamp;
471: x_batch_step_rec.last_update_login := gme_common_pvt.g_login_id;
472:
473: /* Update the actual completion dates of the activities */

Line 470: x_batch_step_rec.last_update_date := gme_common_pvt.g_timestamp;

466: END IF;
467:
468: -- Update WHO columns for output structure
469: x_batch_step_rec.last_updated_by := gme_common_pvt.g_user_ident;
470: x_batch_step_rec.last_update_date := gme_common_pvt.g_timestamp;
471: x_batch_step_rec.last_update_login := gme_common_pvt.g_login_id;
472:
473: /* Update the actual completion dates of the activities */
474: UPDATE gme_batch_step_activities

Line 471: x_batch_step_rec.last_update_login := gme_common_pvt.g_login_id;

467:
468: -- Update WHO columns for output structure
469: x_batch_step_rec.last_updated_by := gme_common_pvt.g_user_ident;
470: x_batch_step_rec.last_update_date := gme_common_pvt.g_timestamp;
471: x_batch_step_rec.last_update_login := gme_common_pvt.g_login_id;
472:
473: /* Update the actual completion dates of the activities */
474: UPDATE gme_batch_step_activities
475: SET actual_cmplt_date = x_batch_step_rec.actual_cmplt_date

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

506: AND batch_id = x_batch_step_rec.batch_id;
507:
508: EXCEPTION
509: WHEN batch_step_upd_err THEN
510: gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR', SQLERRM);
511: x_return_status := FND_API.g_ret_sts_unexp_error;
512: WHEN OTHERS THEN
513: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
514: IF g_debug <= gme_debug.g_log_procedure THEN

Line 523: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

519:
520: PROCEDURE complete_step_material
521: (p_batch_step_rec IN gme_batch_steps%ROWTYPE
522: ,p_update_inv_ind IN VARCHAR2
523: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
524: ,x_return_status OUT NOCOPY VARCHAR2) IS
525:
526:
527: CURSOR Cur_step_prod_byprod(v_batchstep_id NUMBER) IS

Line 533: -- AND (matl.line_type IN (gme_common_pvt.g_line_type_prod, gme_common_pvt.g_line_type_byprod) OR

529: FROM gme_material_details matl, gme_batch_step_items item
530: WHERE item.batchstep_id = v_batchstep_id
531: AND item.material_detail_id = matl.material_detail_id
532: -- 12896375 - Look at all line types.
533: -- AND (matl.line_type IN (gme_common_pvt.g_line_type_prod, gme_common_pvt.g_line_type_byprod) OR
534: -- (matl.line_type = gme_common_pvt.g_line_type_ing AND matl.phantom_id IS NOT NULL))
535: AND matl.release_type = gme_common_pvt.g_mtl_autobystep_release;
536:
537: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_material';

Line 534: -- (matl.line_type = gme_common_pvt.g_line_type_ing AND matl.phantom_id IS NOT NULL))

530: WHERE item.batchstep_id = v_batchstep_id
531: AND item.material_detail_id = matl.material_detail_id
532: -- 12896375 - Look at all line types.
533: -- AND (matl.line_type IN (gme_common_pvt.g_line_type_prod, gme_common_pvt.g_line_type_byprod) OR
534: -- (matl.line_type = gme_common_pvt.g_line_type_ing AND matl.phantom_id IS NOT NULL))
535: AND matl.release_type = gme_common_pvt.g_mtl_autobystep_release;
536:
537: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_material';
538:

Line 535: AND matl.release_type = gme_common_pvt.g_mtl_autobystep_release;

531: AND item.material_detail_id = matl.material_detail_id
532: -- 12896375 - Look at all line types.
533: -- AND (matl.line_type IN (gme_common_pvt.g_line_type_prod, gme_common_pvt.g_line_type_byprod) OR
534: -- (matl.line_type = gme_common_pvt.g_line_type_ing AND matl.phantom_id IS NOT NULL))
535: AND matl.release_type = gme_common_pvt.g_mtl_autobystep_release;
536:
537: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_material';
538:
539: l_return_status VARCHAR2(1);

Line 541: l_matl_dtl_tab gme_common_pvt.material_details_tab;

537: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_material';
538:
539: l_return_status VARCHAR2(1);
540: l_matl_dtl_rec gme_material_details%ROWTYPE;
541: l_matl_dtl_tab gme_common_pvt.material_details_tab;
542: l_yield BOOLEAN;
543:
544: error_process_prod EXCEPTION;
545:

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

568: ,p_update_inv_ind => p_update_inv_ind
569: ,x_exception_material_tbl => x_exception_material_tbl
570: ,x_return_status => l_return_status);
571:
572: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
573: x_return_status := l_return_status;
574: RAISE error_process_prod;
575: END IF;
576:

Line 577: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

573: x_return_status := l_return_status;
574: RAISE error_process_prod;
575: END IF;
576:
577: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
578: x_return_status := gme_common_pvt.g_exceptions_err;
579: END IF;
580: END LOOP;
581:

Line 578: x_return_status := gme_common_pvt.g_exceptions_err;

574: RAISE error_process_prod;
575: END IF;
576:
577: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
578: x_return_status := gme_common_pvt.g_exceptions_err;
579: END IF;
580: END LOOP;
581:
582: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN

Line 634: IF (l_dep_step_rec.dep_type = gme_common_pvt.g_dep_type_finish_start) THEN

630: If the dependency is Finish To Start then the prior step should be
631: completed or closed; if the dependecy is start to start then prior
632: step should be WIP, completed or closed */
633:
634: IF (l_dep_step_rec.dep_type = gme_common_pvt.g_dep_type_finish_start) THEN
635: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_completed
636: ,gme_common_pvt.g_step_closed) THEN
637: RAISE GME_STEP_DEP_COMPLETE;
638: END IF;

Line 635: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_completed

631: completed or closed; if the dependecy is start to start then prior
632: step should be WIP, completed or closed */
633:
634: IF (l_dep_step_rec.dep_type = gme_common_pvt.g_dep_type_finish_start) THEN
635: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_completed
636: ,gme_common_pvt.g_step_closed) THEN
637: RAISE GME_STEP_DEP_COMPLETE;
638: END IF;
639: IF p_step_actual_start_date < l_dep_step_rec.actual_cmplt_date

Line 636: ,gme_common_pvt.g_step_closed) THEN

632: step should be WIP, completed or closed */
633:
634: IF (l_dep_step_rec.dep_type = gme_common_pvt.g_dep_type_finish_start) THEN
635: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_completed
636: ,gme_common_pvt.g_step_closed) THEN
637: RAISE GME_STEP_DEP_COMPLETE;
638: END IF;
639: IF p_step_actual_start_date < l_dep_step_rec.actual_cmplt_date
640: + (l_dep_step_rec.standard_delay/24) THEN

Line 644: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_wip

640: + (l_dep_step_rec.standard_delay/24) THEN
641: RAISE INVALID_START_DATE;
642: END IF;
643: ELSE -- start to start
644: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_wip
645: ,gme_common_pvt.g_step_completed
646: ,gme_common_pvt.g_step_closed) THEN
647: RAISE GME_STEP_DEP_WIP;
648: END IF;

Line 645: ,gme_common_pvt.g_step_completed

641: RAISE INVALID_START_DATE;
642: END IF;
643: ELSE -- start to start
644: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_wip
645: ,gme_common_pvt.g_step_completed
646: ,gme_common_pvt.g_step_closed) THEN
647: RAISE GME_STEP_DEP_WIP;
648: END IF;
649: IF p_step_actual_start_date < l_dep_step_rec.actual_start_date

Line 646: ,gme_common_pvt.g_step_closed) THEN

642: END IF;
643: ELSE -- start to start
644: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_wip
645: ,gme_common_pvt.g_step_completed
646: ,gme_common_pvt.g_step_closed) THEN
647: RAISE GME_STEP_DEP_WIP;
648: END IF;
649: IF p_step_actual_start_date < l_dep_step_rec.actual_start_date
650: + (l_dep_step_rec.standard_delay/24) THEN

Line 662: gme_common_pvt.log_message('GME_INVALID_START_DATE');

658: END IF;
659:
660: EXCEPTION
661: WHEN INVALID_START_DATE THEN
662: gme_common_pvt.log_message('GME_INVALID_START_DATE');
663: x_return_status := FND_API.G_RET_STS_ERROR;
664: WHEN GME_STEP_DEP_WIP THEN
665: gme_common_pvt.log_message('GME_STEP_DEP_WIP');
666: x_return_status := FND_API.G_RET_STS_ERROR;

Line 665: gme_common_pvt.log_message('GME_STEP_DEP_WIP');

661: WHEN INVALID_START_DATE THEN
662: gme_common_pvt.log_message('GME_INVALID_START_DATE');
663: x_return_status := FND_API.G_RET_STS_ERROR;
664: WHEN GME_STEP_DEP_WIP THEN
665: gme_common_pvt.log_message('GME_STEP_DEP_WIP');
666: x_return_status := FND_API.G_RET_STS_ERROR;
667: WHEN GME_STEP_DEP_COMPLETE THEN
668: gme_common_pvt.log_message('GME_STEP_DEP_COMPLETE');
669: x_return_status := FND_API.G_RET_STS_ERROR ;

Line 668: gme_common_pvt.log_message('GME_STEP_DEP_COMPLETE');

664: WHEN GME_STEP_DEP_WIP THEN
665: gme_common_pvt.log_message('GME_STEP_DEP_WIP');
666: x_return_status := FND_API.G_RET_STS_ERROR;
667: WHEN GME_STEP_DEP_COMPLETE THEN
668: gme_common_pvt.log_message('GME_STEP_DEP_COMPLETE');
669: x_return_status := FND_API.G_RET_STS_ERROR ;
670: WHEN OTHERS THEN
671: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
672: IF g_debug <= gme_debug.g_log_procedure THEN

Line 754: IF NOT gme_common_pvt.check_validity_rule_dates (

750: RAISE error_vr_dates;
751: END IF;*/
752: -- sunitha ch. Bug 5336007 aded call to check_validity_rule_dates and passed p_validate_plan_dates_ind=1
753: -- to validate planned start date against validate rule dates
754: IF NOT gme_common_pvt.check_validity_rule_dates (
755: p_validity_rule_id => p_batch_header_rec.recipe_validity_rule_id
756: ,p_start_date => p_batch_header_rec.actual_start_date
757: ,p_cmplt_date => p_batch_header_rec.actual_cmplt_date
758: ,p_batch_header_rec => p_batch_header_rec

Line 768: IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN

764: END IF; -- p_batch_header_rec.batch_status = 1
765: END IF; -- IF p_batch_header_rec.recipe_validity_rule_id IS NOT NULL
766:
767: -- Bug 9277115 - Let's also check the step start date if the step is not already released.
768: IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN
769: IF p_batch_step_rec.actual_start_date < p_batch_header_rec.actual_start_date THEN
770: RAISE error_actual_start_date;
771: END IF;
772: END IF;

Line 776: IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN

772: END IF;
773:
774: -- set actual complete date if it's not passed
775: IF p_batch_step_rec.actual_cmplt_date IS NULL THEN
776: IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN
777: --Sunitha ch. Bug#5327152 set actual complete start if it's not passed
778: IF x_batch_step_rec.actual_start_date IS NULL THEN
779: x_batch_step_rec.actual_start_date:=SYSDATE;
780: END IF;

Line 800: IF NOT gme_common_pvt.check_close_period(p_org_id => p_batch_header_rec.organization_id

796: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'actual_cmplt_date='||to_char(x_batch_step_rec.actual_cmplt_date,'DD-MON-YYYY HH24:MI:SS'));
797: END IF;
798:
799: --Bug#5109119 check for close period
800: IF NOT gme_common_pvt.check_close_period(p_org_id => p_batch_header_rec.organization_id
801: ,p_trans_date => x_batch_step_rec.actual_cmplt_date) THEN
802: RAISE error_close_period;
803: END IF;
804:

Line 808: IF p_batch_step_rec.step_status <> gme_common_pvt.g_step_wip THEN

804:
805:
806: -- Enforce Step Dependency Checks
807: IF p_batch_header_rec.enforce_step_dependency = 1 THEN
808: IF p_batch_step_rec.step_status <> gme_common_pvt.g_step_wip THEN
809: RAISE error_no_direct_compl;
810: END IF;
811:
812: -- validate dependent step status and dates

Line 842: gme_common_pvt.log_message ('GME_STEP_START_BATCH_START_ERR');

838: WHEN error_validation THEN
839: NULL;
840: -- 9277115 - add following condition.
841: WHEN error_actual_start_date THEN
842: gme_common_pvt.log_message ('GME_STEP_START_BATCH_START_ERR');
843: x_return_status := FND_API.G_RET_STS_ERROR;
844: WHEN error_no_direct_compl THEN
845: gme_common_pvt.log_message('NO_DIRECT_CERT_ALLOWED');
846: x_return_status := FND_API.G_RET_STS_ERROR ;

Line 845: gme_common_pvt.log_message('NO_DIRECT_CERT_ALLOWED');

841: WHEN error_actual_start_date THEN
842: gme_common_pvt.log_message ('GME_STEP_START_BATCH_START_ERR');
843: x_return_status := FND_API.G_RET_STS_ERROR;
844: WHEN error_no_direct_compl THEN
845: gme_common_pvt.log_message('NO_DIRECT_CERT_ALLOWED');
846: x_return_status := FND_API.G_RET_STS_ERROR ;
847: WHEN error_future_date THEN
848: fnd_message.set_name ('GMA', 'SY_NOFUTUREDATE');
849: fnd_msg_pub.ADD;

Line 852: gme_common_pvt.log_message('GME_INVALID_DATE_RANGE'

848: fnd_message.set_name ('GMA', 'SY_NOFUTUREDATE');
849: fnd_msg_pub.ADD;
850: x_return_status := FND_API.G_RET_STS_ERROR;
851: WHEN error_cmplt_date THEN
852: gme_common_pvt.log_message('GME_INVALID_DATE_RANGE'
853: ,'DATE1','Completion date'
854: ,'DATE2','Start date');
855: x_return_status := fnd_api.g_ret_sts_error;
856: WHEN error_quality_status THEN

Line 857: gme_common_pvt.log_message('GME_QUALITY_NOT_COMPLETE'

853: ,'DATE1','Completion date'
854: ,'DATE2','Start date');
855: x_return_status := fnd_api.g_ret_sts_error;
856: WHEN error_quality_status THEN
857: gme_common_pvt.log_message('GME_QUALITY_NOT_COMPLETE'
858: ,'STEP_NO', x_batch_step_rec.batchstep_no
859: ,'BATCH_NO', p_batch_header_rec.batch_no);
860: x_return_status := fnd_api.g_ret_sts_error;
861: WHEN error_vr_dates THEN

Line 945: gme_common_pvt.log_message('GME_BATCH_START_STEP_START_ERR',

941:
942: -- Check the date of the step being certified with the batch actual start date
943: IF (p_batch_header_rec.actual_start_date IS NOT NULL) THEN
944: IF (p_batch_step_rec.actual_start_date < p_batch_header_rec.actual_start_date) THEN
945: gme_common_pvt.log_message('GME_BATCH_START_STEP_START_ERR',
946: 'STEP_DATE', TO_CHAR(p_batch_step_rec.actual_start_date, 'DD-MON-YYYY HH24:MI:SS'),
947: 'STEP_NO', TO_CHAR(p_batch_step_rec.batchstep_no),
948: 'BATCH_DATE', TO_CHAR(p_batch_header_rec.actual_start_date, 'DD-MON-YYYY HH24:MI:SS'));
949: RAISE INVALID_DATE_ERR;

Line 968: IF get_rec.dep_type = gme_common_pvt.g_dep_type_finish_start THEN

964: END IF;
965:
966: -- Check if the step has a complete date if so validate otherwise assign one to it
967: IF (l_batch_step.actual_cmplt_date IS NOT NULL) THEN
968: IF get_rec.dep_type = gme_common_pvt.g_dep_type_finish_start THEN
969: IF (p_batch_header_rec.enforce_step_dependency = 1) AND (l_batch_step.actual_cmplt_date + (get_rec.standard_delay/24) > X_prev_start_date) THEN
970: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_CMPLT',
971: 'PREV_DATE',
972: TO_CHAR(X_prev_start_date, 'DD-MON-YYYY HH24:MI:SS'),

Line 970: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_CMPLT',

966: -- Check if the step has a complete date if so validate otherwise assign one to it
967: IF (l_batch_step.actual_cmplt_date IS NOT NULL) THEN
968: IF get_rec.dep_type = gme_common_pvt.g_dep_type_finish_start THEN
969: IF (p_batch_header_rec.enforce_step_dependency = 1) AND (l_batch_step.actual_cmplt_date + (get_rec.standard_delay/24) > X_prev_start_date) THEN
970: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_CMPLT',
971: 'PREV_DATE',
972: TO_CHAR(X_prev_start_date, 'DD-MON-YYYY HH24:MI:SS'),
973: 'PREV_STEP', TO_CHAR(X_prev_step),
974: 'CUR_DATE',

Line 979: ELSIF get_rec.dep_type = gme_common_pvt.g_dep_type_start_start THEN

975: TO_CHAR(l_batch_step.actual_cmplt_date +
976: (get_rec.standard_delay/24), 'DD-MON-YYYY HH24:MI:SS'));
977: RAISE INVALID_DATE_ERR;
978: END IF;
979: ELSIF get_rec.dep_type = gme_common_pvt.g_dep_type_start_start THEN
980: IF (p_batch_header_rec.enforce_step_dependency = 1) AND (l_batch_step.actual_start_date + (get_rec.standard_delay/24) > X_prev_start_date) THEN
981: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_START',
982: 'PREV_DATE',
983: TO_CHAR(X_prev_start_date, 'DD-MON-YYYY HH24:MI:SS'),

Line 981: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_START',

977: RAISE INVALID_DATE_ERR;
978: END IF;
979: ELSIF get_rec.dep_type = gme_common_pvt.g_dep_type_start_start THEN
980: IF (p_batch_header_rec.enforce_step_dependency = 1) AND (l_batch_step.actual_start_date + (get_rec.standard_delay/24) > X_prev_start_date) THEN
981: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_START',
982: 'PREV_DATE',
983: TO_CHAR(X_prev_start_date, 'DD-MON-YYYY HH24:MI:SS'),
984: 'PREV_STEP', TO_CHAR(X_prev_step),
985: 'CUR_DATE',

Line 992: ELSIF (get_rec.dep_type = gme_common_pvt.g_dep_type_finish_start) AND

988: RAISE INVALID_DATE_ERR;
989: END IF;
990: EXIT;
991: END IF;
992: ELSIF (get_rec.dep_type = gme_common_pvt.g_dep_type_finish_start) AND
993: (get_rec.standard_delay >= 0) THEN
994: l_batch_step.actual_cmplt_date := X_prev_start_date - (get_rec.standard_delay/24);
995: ELSE
996: l_batch_step.actual_cmplt_date := X_prev_start_date;

Line 1007: gme_common_pvt.log_message('GME_BATCH_START_STEP_START_ERR',

1003:
1004: -- Validate step actual start date against batch actual start date
1005: IF (p_batch_header_rec.actual_start_date IS NOT NULL) THEN
1006: IF (l_batch_step.actual_start_date < p_batch_header_rec.actual_start_date) THEN
1007: gme_common_pvt.log_message('GME_BATCH_START_STEP_START_ERR',
1008: 'STEP_DATE',
1009: TO_CHAR(l_batch_step.actual_start_date, 'DD-MON-YYYY HH24:MI:SS'),
1010: 'STEP_NO', TO_CHAR(l_batch_step.batchstep_no),
1011: 'BATCH_DATE',

Line 1028: gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR'

1024: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
1025: END IF;
1026: EXCEPTION
1027: WHEN BATCH_STEP_FETCH_ERROR THEN
1028: gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR'
1029: ,SQLERRM);
1030: x_return_status := fnd_api.g_ret_sts_unexp_error;
1031: WHEN INVALID_DATE_ERR THEN
1032: x_return_status := FND_API.G_RET_STS_ERROR;