DBA Data[Home] [Help]

APPS.GME_COMPLETE_BATCH_STEP_PVT dependencies on GME_COMMON_PVT

Line 26: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

22: PROCEDURE complete_step
23: (p_batch_step_rec IN GME_BATCH_STEPS%ROWTYPE
24: ,p_batch_header_rec IN gme_batch_header%ROWTYPE
25: ,x_batch_step_rec OUT NOCOPY GME_BATCH_STEPS%ROWTYPE
26: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
27: ,x_return_status OUT NOCOPY VARCHAR2) IS
28:
29: CURSOR Cur_step_count(v_batch_id NUMBER) IS
30: SELECT count(1)

Line 33: AND step_status < gme_common_pvt.g_step_completed

29: CURSOR Cur_step_count(v_batch_id NUMBER) IS
30: SELECT count(1)
31: FROM GME_BATCH_STEPS
32: WHERE batch_id = v_batch_id
33: AND step_status < gme_common_pvt.g_step_completed
34: AND rownum = 1;
35:
36: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step';
37:

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

61:
62: -- if the step status is pending, call release step first... don't need to worry
63: -- about calling release batch if the batch is pending because release step will take
64: -- care of this; check for step control batch and not a phantom done in pub
65: IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN
66: -- actual start date already populated in p_batch_step_rec
67: gme_release_batch_step_pvt.release_step
68: (p_batch_step_rec => p_batch_step_rec
69: ,p_batch_header_rec => p_batch_header_rec

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

70: ,x_batch_step_rec => l_batch_step_rec
71: ,x_exception_material_tbl => x_exception_material_tbl
72: ,x_return_status => l_return_status);
73:
74: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
75: x_return_status := l_return_status;
76: RAISE error_release_batch;
77: END IF;
78:

Line 79: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

75: x_return_status := l_return_status;
76: RAISE error_release_batch;
77: END IF;
78:
79: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
80: x_return_status := gme_common_pvt.g_exceptions_err;
81: END IF;
82:
83: -- re-retrieve the batch header if the batch status was pending

Line 80: x_return_status := gme_common_pvt.g_exceptions_err;

76: RAISE error_release_batch;
77: END IF;
78:
79: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
80: x_return_status := gme_common_pvt.g_exceptions_err;
81: END IF;
82:
83: -- re-retrieve the batch header if the batch status was pending
84: IF (p_batch_header_rec.batch_status = gme_common_pvt.g_batch_pending) THEN

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

80: x_return_status := gme_common_pvt.g_exceptions_err;
81: END IF;
82:
83: -- re-retrieve the batch header if the batch status was pending
84: IF (p_batch_header_rec.batch_status = gme_common_pvt.g_batch_pending) THEN
85: IF NOT gme_batch_header_dbl.fetch_row(l_batch_header_rec, l_batch_header_rec) THEN
86: RAISE error_fetch;
87: END IF;
88: END IF;

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

86: RAISE error_fetch;
87: END IF;
88: END IF;
89:
90: END IF; /* IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending */
91:
92: complete_step_recursive
93: (p_batch_step_rec => l_batch_step_rec
94: ,p_batch_header_rec => l_batch_header_rec

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

95: ,x_batch_step_rec => x_batch_step_rec
96: ,x_exception_material_tbl => x_exception_material_tbl
97: ,x_return_status => l_return_status);
98:
99: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
100: x_return_status := l_return_status;
101: RAISE error_complete_step_rec;
102: END IF;
103:

Line 104: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

100: x_return_status := l_return_status;
101: RAISE error_complete_step_rec;
102: END IF;
103:
104: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
105: x_return_status := gme_common_pvt.g_exceptions_err;
106: END IF;
107:
108: /* If the step controls batch status profile is set then to complete the batch */

Line 105: x_return_status := gme_common_pvt.g_exceptions_err;

101: RAISE error_complete_step_rec;
102: END IF;
103:
104: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
105: x_return_status := gme_common_pvt.g_exceptions_err;
106: END IF;
107:
108: /* If the step controls batch status profile is set then to complete the batch */
109: /* if all the steps are complete and this is not a phantom batch */

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

108: /* If the step controls batch status profile is set then to complete the batch */
109: /* if all the steps are complete and this is not a phantom batch */
110:
111: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
112: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' step controls batch= '||gme_common_pvt.g_step_controls_batch_sts_ind);
113: END IF;
114:
115: IF (gme_common_pvt.g_step_controls_batch_sts_ind = 1) AND (l_batch_header_rec.parentline_id IS NULL) AND
116: (l_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed) THEN

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

111: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
112: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' step controls batch= '||gme_common_pvt.g_step_controls_batch_sts_ind);
113: END IF;
114:
115: IF (gme_common_pvt.g_step_controls_batch_sts_ind = 1) AND (l_batch_header_rec.parentline_id IS NULL) AND
116: (l_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed) THEN
117: /* Get the count of the number of steps less than complete for this batch */
118:
119: OPEN Cur_step_count(l_batch_header_rec.batch_id);

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

112: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' step controls batch= '||gme_common_pvt.g_step_controls_batch_sts_ind);
113: END IF;
114:
115: IF (gme_common_pvt.g_step_controls_batch_sts_ind = 1) AND (l_batch_header_rec.parentline_id IS NULL) AND
116: (l_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed) THEN
117: /* Get the count of the number of steps less than complete for this batch */
118:
119: OPEN Cur_step_count(l_batch_header_rec.batch_id);
120: FETCH Cur_step_count INTO l_step_count;

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

147: ,x_exception_material_tbl => x_exception_material_tbl
148: ,x_batch_header_rec => l_batch_header_rec
149: ,x_return_status => l_return_status);
150:
151: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
152: x_return_status := l_return_status;
153: RAISE error_complete_batch;
154: END IF;
155:

Line 156: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

152: x_return_status := l_return_status;
153: RAISE error_complete_batch;
154: END IF;
155:
156: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
157: x_return_status := gme_common_pvt.g_exceptions_err;
158: END IF;
159: END IF; /* IF l_step_count = 0 */
160: END IF; /* IF (gme_common_pvt.g_step_controls_batch_sts_ind = 'Y') AND */

Line 157: x_return_status := gme_common_pvt.g_exceptions_err;

153: RAISE error_complete_batch;
154: END IF;
155:
156: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
157: x_return_status := gme_common_pvt.g_exceptions_err;
158: END IF;
159: END IF; /* IF l_step_count = 0 */
160: END IF; /* IF (gme_common_pvt.g_step_controls_batch_sts_ind = 'Y') AND */
161:

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

156: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
157: x_return_status := gme_common_pvt.g_exceptions_err;
158: END IF;
159: END IF; /* IF l_step_count = 0 */
160: END IF; /* IF (gme_common_pvt.g_step_controls_batch_sts_ind = 'Y') AND */
161:
162: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
163: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
164: END IF;

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

167: WHEN error_release_batch OR error_complete_batch OR
168: error_complete_step_rec OR error_validation THEN
169: NULL;
170: WHEN error_fetch THEN
171: gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR'
172: ,SQLERRM);
173: x_return_status := fnd_api.g_ret_sts_unexp_error;
174: WHEN OTHERS THEN
175: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);

Line 186: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

182: PROCEDURE complete_step_recursive
183: (p_batch_step_rec IN gme_batch_steps%ROWTYPE
184: ,p_batch_header_rec IN gme_batch_header%ROWTYPE
185: ,x_batch_step_rec OUT NOCOPY gme_batch_steps%ROWTYPE
186: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
187: ,x_return_status OUT NOCOPY VARCHAR2
188: , p_quality_override IN BOOLEAN := FALSE) IS --Bug#6348353
189:
190: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_recursive';

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

215:
216: x_batch_step_rec := p_batch_step_rec;
217:
218: /* Exit the recursive loop if the step is already released, completed or closed */
219: IF x_batch_step_rec.step_status IN (gme_common_pvt.g_step_completed
220: ,gme_common_pvt.g_step_closed) THEN
221: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
222: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'step is completed or closed; returning');
223: END IF;

Line 220: ,gme_common_pvt.g_step_closed) THEN

216: x_batch_step_rec := p_batch_step_rec;
217:
218: /* Exit the recursive loop if the step is already released, completed or closed */
219: IF x_batch_step_rec.step_status IN (gme_common_pvt.g_step_completed
220: ,gme_common_pvt.g_step_closed) THEN
221: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
222: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'step is completed or closed; returning');
223: END IF;
224: RAISE step_cmpl_closed;

Line 238: P_REQUESTER => gme_common_pvt.g_user_ident,

234: X_MSG_COUNT => l_msg_count,
235: X_MSG_DATA => l_msg_stack,
236: P_ENTITY_NAME => 'OPERATION',
237: P_ENTITY_KEY => x_batch_step_rec.batchstep_id,
238: P_REQUESTER => gme_common_pvt.g_user_ident,
239: X_LOCK_STATUS => l_lock_status,
240: X_LOCKED_BY_STATUS => l_locked_by_status,
241: X_LOCK_ALLOWED => l_lock_allowed);
242: gme_debug.put_line ( g_pkg_name

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

256: || 'from gmo the lock_status='
257: || l_lock_status);
258: END IF;
259: IF l_lock_status = 'Y' THEN
260: gme_common_pvt.log_message ('GME_STEP_LOCK_ERROR');
261: RAISE gmo_lock_error;
262: END IF;
263: /* If this procedure is invoked while completing the entire batch */
264: /* then there is no need to go through the recursive procedure as */

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

262: END IF;
263: /* If this procedure is invoked while completing the entire batch */
264: /* then there is no need to go through the recursive procedure as */
265: /* the complete batch call completes all the steps */
266: IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed THEN
267: gme_release_batch_step_pvt.process_dependent_steps
268: (p_batch_step_rec => p_batch_step_rec
269: ,p_batch_header_rec => p_batch_header_rec
270: ,x_exception_material_tbl => x_exception_material_tbl

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

269: ,p_batch_header_rec => p_batch_header_rec
270: ,x_exception_material_tbl => x_exception_material_tbl
271: ,x_return_status => l_return_status);
272:
273: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
274: x_return_status := l_return_status;
275: RAISE error_process_dep_steps;
276: END IF;
277:

Line 278: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

274: x_return_status := l_return_status;
275: RAISE error_process_dep_steps;
276: END IF;
277:
278: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
279: x_return_status := gme_common_pvt.g_exceptions_err;
280: END IF;
281: END IF; -- IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed THEN
282:

Line 279: x_return_status := gme_common_pvt.g_exceptions_err;

275: RAISE error_process_dep_steps;
276: END IF;
277:
278: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
279: x_return_status := gme_common_pvt.g_exceptions_err;
280: END IF;
281: END IF; -- IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed THEN
282:
283: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN

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

277:
278: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
279: x_return_status := gme_common_pvt.g_exceptions_err;
280: END IF;
281: END IF; -- IF p_batch_header_rec.batch_status <> gme_common_pvt.g_batch_completed THEN
282:
283: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
284: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'Calling complete step line to create product transactions...');
285: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' for step = '|| x_batch_step_rec.batchstep_id);

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

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

Line 315: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

311: x_return_status := l_return_status;
312: RAISE cmpl_step_prod_error;
313: END IF;
314:
315: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
316: x_return_status := gme_common_pvt.g_exceptions_err;
317: END IF;
318:
319: /* Invoke the update step qty API to update the step quantities and the */

Line 316: x_return_status := gme_common_pvt.g_exceptions_err;

312: RAISE cmpl_step_prod_error;
313: END IF;
314:
315: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
316: x_return_status := gme_common_pvt.g_exceptions_err;
317: END IF;
318:
319: /* Invoke the update step qty API to update the step quantities and the */
320: /* quantities of the succeeding steps */

Line 353: gme_common_pvt.log_message('GME_QUALITY_NOT_COMPLETE'

349:
350: END IF;
351: x_return_status := fnd_api.g_ret_sts_error;
352: WHEN error_quality_status THEN --Bug#6348353
353: gme_common_pvt.log_message('GME_QUALITY_NOT_COMPLETE'
354: ,'STEP_NO', x_batch_step_rec.batchstep_no
355: ,'BATCH_NO', p_batch_header_rec.batch_no);
356: x_return_status := fnd_api.g_ret_sts_error;
357: WHEN OTHERS THEN

Line 384: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

380:
381: PROCEDURE complete_step_line
382: (p_batch_step_rec IN gme_batch_steps%ROWTYPE
383: ,x_batch_step_rec OUT NOCOPY gme_batch_steps%ROWTYPE
384: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
385: ,x_return_status OUT NOCOPY VARCHAR2) IS
386:
387: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_line';
388:

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

400: -- latest data and in addition has the actual completion date calculated and set
401: x_batch_step_rec := p_batch_step_rec;
402:
403: /* Update the Batch Step Status to WIP */
404: x_batch_step_rec.step_status := gme_common_pvt.g_step_completed;
405:
406: -- Update the batch step
407: IF NOT (gme_batch_steps_dbl.update_row (x_batch_step_rec)) THEN
408: RAISE batch_step_upd_err;

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

408: RAISE batch_step_upd_err;
409: END IF;
410:
411: -- Update WHO columns for output structure
412: x_batch_step_rec.last_updated_by := gme_common_pvt.g_user_ident;
413: x_batch_step_rec.last_update_date := gme_common_pvt.g_timestamp;
414: x_batch_step_rec.last_update_login := gme_common_pvt.g_login_id;
415:
416: /* Update the actual completion dates of the activities */

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

409: END IF;
410:
411: -- Update WHO columns for output structure
412: x_batch_step_rec.last_updated_by := gme_common_pvt.g_user_ident;
413: x_batch_step_rec.last_update_date := gme_common_pvt.g_timestamp;
414: x_batch_step_rec.last_update_login := gme_common_pvt.g_login_id;
415:
416: /* Update the actual completion dates of the activities */
417: UPDATE gme_batch_step_activities

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

410:
411: -- Update WHO columns for output structure
412: x_batch_step_rec.last_updated_by := gme_common_pvt.g_user_ident;
413: x_batch_step_rec.last_update_date := gme_common_pvt.g_timestamp;
414: x_batch_step_rec.last_update_login := gme_common_pvt.g_login_id;
415:
416: /* Update the actual completion dates of the activities */
417: UPDATE gme_batch_step_activities
418: SET actual_cmplt_date = x_batch_step_rec.actual_cmplt_date

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

449: AND batch_id = x_batch_step_rec.batch_id;
450:
451: EXCEPTION
452: WHEN batch_step_upd_err THEN
453: gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR', SQLERRM);
454: x_return_status := FND_API.g_ret_sts_unexp_error;
455: WHEN OTHERS THEN
456: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
457: IF g_debug <= gme_debug.g_log_procedure THEN

Line 466: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab

462:
463: PROCEDURE complete_step_material
464: (p_batch_step_rec IN gme_batch_steps%ROWTYPE
465: ,p_update_inv_ind IN VARCHAR2
466: ,x_exception_material_tbl IN OUT NOCOPY gme_common_pvt.exceptions_tab
467: ,x_return_status OUT NOCOPY VARCHAR2) IS
468:
469:
470: CURSOR Cur_step_prod_byprod(v_batchstep_id NUMBER) IS

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

471: SELECT matl.*
472: FROM gme_material_details matl, gme_batch_step_items item
473: WHERE item.batchstep_id = v_batchstep_id
474: AND item.material_detail_id = matl.material_detail_id
475: AND (matl.line_type IN (gme_common_pvt.g_line_type_prod, gme_common_pvt.g_line_type_byprod) OR
476: (matl.line_type = gme_common_pvt.g_line_type_ing AND matl.phantom_id IS NOT NULL))
477: AND matl.release_type = gme_common_pvt.g_mtl_autobystep_release;
478:
479: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_material';

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

472: FROM gme_material_details matl, gme_batch_step_items item
473: WHERE item.batchstep_id = v_batchstep_id
474: AND item.material_detail_id = matl.material_detail_id
475: AND (matl.line_type IN (gme_common_pvt.g_line_type_prod, gme_common_pvt.g_line_type_byprod) OR
476: (matl.line_type = gme_common_pvt.g_line_type_ing AND matl.phantom_id IS NOT NULL))
477: AND matl.release_type = gme_common_pvt.g_mtl_autobystep_release;
478:
479: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_material';
480:

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

473: WHERE item.batchstep_id = v_batchstep_id
474: AND item.material_detail_id = matl.material_detail_id
475: AND (matl.line_type IN (gme_common_pvt.g_line_type_prod, gme_common_pvt.g_line_type_byprod) OR
476: (matl.line_type = gme_common_pvt.g_line_type_ing AND matl.phantom_id IS NOT NULL))
477: AND matl.release_type = gme_common_pvt.g_mtl_autobystep_release;
478:
479: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_material';
480:
481: l_return_status VARCHAR2(1);

Line 483: l_matl_dtl_tab gme_common_pvt.material_details_tab;

479: l_api_name CONSTANT VARCHAR2 (30) := 'complete_step_material';
480:
481: l_return_status VARCHAR2(1);
482: l_matl_dtl_rec gme_material_details%ROWTYPE;
483: l_matl_dtl_tab gme_common_pvt.material_details_tab;
484: l_yield BOOLEAN;
485:
486: error_process_prod EXCEPTION;
487:

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

510: ,p_update_inv_ind => p_update_inv_ind
511: ,x_exception_material_tbl => x_exception_material_tbl
512: ,x_return_status => l_return_status);
513:
514: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
515: x_return_status := l_return_status;
516: RAISE error_process_prod;
517: END IF;
518:

Line 519: IF l_return_status = gme_common_pvt.g_exceptions_err THEN

515: x_return_status := l_return_status;
516: RAISE error_process_prod;
517: END IF;
518:
519: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
520: x_return_status := gme_common_pvt.g_exceptions_err;
521: END IF;
522: END LOOP;
523:

Line 520: x_return_status := gme_common_pvt.g_exceptions_err;

516: RAISE error_process_prod;
517: END IF;
518:
519: IF l_return_status = gme_common_pvt.g_exceptions_err THEN
520: x_return_status := gme_common_pvt.g_exceptions_err;
521: END IF;
522: END LOOP;
523:
524: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN

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

572: If the dependency is Finish To Start then the prior step should be
573: completed or closed; if the dependecy is start to start then prior
574: step should be WIP, completed or closed */
575:
576: IF (l_dep_step_rec.dep_type = gme_common_pvt.g_dep_type_finish_start) THEN
577: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_completed
578: ,gme_common_pvt.g_step_closed) THEN
579: RAISE GME_STEP_DEP_COMPLETE;
580: END IF;

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

573: completed or closed; if the dependecy is start to start then prior
574: step should be WIP, completed or closed */
575:
576: IF (l_dep_step_rec.dep_type = gme_common_pvt.g_dep_type_finish_start) THEN
577: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_completed
578: ,gme_common_pvt.g_step_closed) THEN
579: RAISE GME_STEP_DEP_COMPLETE;
580: END IF;
581: IF p_step_actual_start_date < l_dep_step_rec.actual_cmplt_date

Line 578: ,gme_common_pvt.g_step_closed) THEN

574: step should be WIP, completed or closed */
575:
576: IF (l_dep_step_rec.dep_type = gme_common_pvt.g_dep_type_finish_start) THEN
577: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_completed
578: ,gme_common_pvt.g_step_closed) THEN
579: RAISE GME_STEP_DEP_COMPLETE;
580: END IF;
581: IF p_step_actual_start_date < l_dep_step_rec.actual_cmplt_date
582: + (l_dep_step_rec.standard_delay/24) THEN

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

582: + (l_dep_step_rec.standard_delay/24) THEN
583: RAISE INVALID_START_DATE;
584: END IF;
585: ELSE -- start to start
586: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_wip
587: ,gme_common_pvt.g_step_completed
588: ,gme_common_pvt.g_step_closed) THEN
589: RAISE GME_STEP_DEP_WIP;
590: END IF;

Line 587: ,gme_common_pvt.g_step_completed

583: RAISE INVALID_START_DATE;
584: END IF;
585: ELSE -- start to start
586: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_wip
587: ,gme_common_pvt.g_step_completed
588: ,gme_common_pvt.g_step_closed) THEN
589: RAISE GME_STEP_DEP_WIP;
590: END IF;
591: IF p_step_actual_start_date < l_dep_step_rec.actual_start_date

Line 588: ,gme_common_pvt.g_step_closed) THEN

584: END IF;
585: ELSE -- start to start
586: IF l_dep_step_rec.step_status NOT IN (gme_common_pvt.g_step_wip
587: ,gme_common_pvt.g_step_completed
588: ,gme_common_pvt.g_step_closed) THEN
589: RAISE GME_STEP_DEP_WIP;
590: END IF;
591: IF p_step_actual_start_date < l_dep_step_rec.actual_start_date
592: + (l_dep_step_rec.standard_delay/24) THEN

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

600: END IF;
601:
602: EXCEPTION
603: WHEN INVALID_START_DATE THEN
604: gme_common_pvt.log_message('GME_INVALID_START_DATE');
605: x_return_status := FND_API.G_RET_STS_ERROR;
606: WHEN GME_STEP_DEP_WIP THEN
607: gme_common_pvt.log_message('GME_STEP_DEP_WIP');
608: x_return_status := FND_API.G_RET_STS_ERROR;

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

603: WHEN INVALID_START_DATE THEN
604: gme_common_pvt.log_message('GME_INVALID_START_DATE');
605: x_return_status := FND_API.G_RET_STS_ERROR;
606: WHEN GME_STEP_DEP_WIP THEN
607: gme_common_pvt.log_message('GME_STEP_DEP_WIP');
608: x_return_status := FND_API.G_RET_STS_ERROR;
609: WHEN GME_STEP_DEP_COMPLETE THEN
610: gme_common_pvt.log_message('GME_STEP_DEP_COMPLETE');
611: x_return_status := FND_API.G_RET_STS_ERROR ;

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

606: WHEN GME_STEP_DEP_WIP THEN
607: gme_common_pvt.log_message('GME_STEP_DEP_WIP');
608: x_return_status := FND_API.G_RET_STS_ERROR;
609: WHEN GME_STEP_DEP_COMPLETE THEN
610: gme_common_pvt.log_message('GME_STEP_DEP_COMPLETE');
611: x_return_status := FND_API.G_RET_STS_ERROR ;
612: WHEN OTHERS THEN
613: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
614: IF g_debug <= gme_debug.g_log_procedure THEN

Line 691: IF NOT gme_common_pvt.check_validity_rule_dates (

687: RAISE error_vr_dates;
688: END IF;*/
689: --sunitha ch. Bug 5336007 aded call to check_validity_rule_dates and passed p_validate_plan_dates_ind=1
690: --to validate planned start date against validate rule dates
691: IF NOT gme_common_pvt.check_validity_rule_dates (
692: p_validity_rule_id => p_batch_header_rec.recipe_validity_rule_id
693: ,p_start_date => p_batch_header_rec.actual_start_date
694: ,p_cmplt_date => p_batch_header_rec.actual_cmplt_date
695: ,p_batch_header_rec => p_batch_header_rec

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

701: END IF; -- IF p_batch_header_rec.recipe_validity_rule_id IS NOT NULL
702:
703: -- set actual complete date if it's not passed
704: IF p_batch_step_rec.actual_cmplt_date IS NULL THEN
705: IF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN
706: --Sunitha ch. Bug#5327152 set actual complete start if it's not passed
707: IF x_batch_step_rec.actual_start_date IS NULL THEN
708: x_batch_step_rec.actual_start_date:=SYSDATE;
709: END IF;

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

725: 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'));
726: END IF;
727:
728: --Bug#5109119 check for close period
729: IF NOT gme_common_pvt.check_close_period(p_org_id => p_batch_header_rec.organization_id
730: ,p_trans_date => x_batch_step_rec.actual_cmplt_date) THEN
731: RAISE error_close_period;
732: END IF;
733:

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

733:
734:
735: -- Enforce Step Dependency Checks
736: IF p_batch_header_rec.enforce_step_dependency = 1 THEN
737: IF p_batch_step_rec.step_status <> gme_common_pvt.g_step_wip THEN
738: RAISE error_no_direct_compl;
739: END IF;
740:
741: -- validate dependent step status and dates

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

766: x_return_status := FND_API.G_RET_STS_ERROR;
767: WHEN error_validation THEN
768: NULL;
769: WHEN error_no_direct_compl THEN
770: gme_common_pvt.log_message('NO_DIRECT_CERT_ALLOWED');
771: x_return_status := FND_API.G_RET_STS_ERROR ;
772: WHEN error_future_date THEN
773: fnd_message.set_name ('GMA', 'SY_NOFUTUREDATE');
774: fnd_msg_pub.ADD;

Line 777: gme_common_pvt.log_message('GME_INVALID_DATE_RANGE'

773: fnd_message.set_name ('GMA', 'SY_NOFUTUREDATE');
774: fnd_msg_pub.ADD;
775: x_return_status := FND_API.G_RET_STS_ERROR;
776: WHEN error_cmplt_date THEN
777: gme_common_pvt.log_message('GME_INVALID_DATE_RANGE'
778: ,'DATE1','Completion date'
779: ,'DATE2','Start date');
780: x_return_status := fnd_api.g_ret_sts_error;
781: WHEN error_quality_status THEN

Line 782: gme_common_pvt.log_message('GME_QUALITY_NOT_COMPLETE'

778: ,'DATE1','Completion date'
779: ,'DATE2','Start date');
780: x_return_status := fnd_api.g_ret_sts_error;
781: WHEN error_quality_status THEN
782: gme_common_pvt.log_message('GME_QUALITY_NOT_COMPLETE'
783: ,'STEP_NO', x_batch_step_rec.batchstep_no
784: ,'BATCH_NO', p_batch_header_rec.batch_no);
785: x_return_status := fnd_api.g_ret_sts_error;
786: WHEN error_vr_dates THEN

Line 856: gme_common_pvt.log_message('GME_BATCH_START_STEP_START_ERR',

852:
853: -- Check the date of the step being certified with the batch actual start date
854: IF (p_batch_header_rec.actual_start_date IS NOT NULL) THEN
855: IF (p_batch_step_rec.actual_start_date < p_batch_header_rec.actual_start_date) THEN
856: gme_common_pvt.log_message('GME_BATCH_START_STEP_START_ERR',
857: 'STEP_DATE', TO_CHAR(p_batch_step_rec.actual_start_date, 'DD-MON-YYYY HH24:MI:SS'),
858: 'STEP_NO', TO_CHAR(p_batch_step_rec.batchstep_no),
859: 'BATCH_DATE', TO_CHAR(p_batch_header_rec.actual_start_date, 'DD-MON-YYYY HH24:MI:SS'));
860: RAISE INVALID_DATE_ERR;

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

875: END IF;
876:
877: -- Check if the step has a complete date if so validate otherwise assign one to it
878: IF (l_batch_step.actual_cmplt_date IS NOT NULL) THEN
879: IF get_rec.dep_type = gme_common_pvt.g_dep_type_finish_start THEN
880: 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
881: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_CMPLT',
882: 'PREV_DATE',
883: TO_CHAR(X_prev_start_date, 'DD-MON-YYYY HH24:MI:SS'),

Line 881: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_CMPLT',

877: -- Check if the step has a complete date if so validate otherwise assign one to it
878: IF (l_batch_step.actual_cmplt_date IS NOT NULL) THEN
879: IF get_rec.dep_type = gme_common_pvt.g_dep_type_finish_start THEN
880: 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
881: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_CMPLT',
882: 'PREV_DATE',
883: TO_CHAR(X_prev_start_date, 'DD-MON-YYYY HH24:MI:SS'),
884: 'PREV_STEP', TO_CHAR(X_prev_step),
885: 'CUR_DATE',

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

886: TO_CHAR(l_batch_step.actual_cmplt_date +
887: (get_rec.standard_delay/24), 'DD-MON-YYYY HH24:MI:SS'));
888: RAISE INVALID_DATE_ERR;
889: END IF;
890: ELSIF get_rec.dep_type = gme_common_pvt.g_dep_type_start_start THEN
891: 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
892: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_START',
893: 'PREV_DATE',
894: TO_CHAR(X_prev_start_date, 'DD-MON-YYYY HH24:MI:SS'),

Line 892: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_START',

888: RAISE INVALID_DATE_ERR;
889: END IF;
890: ELSIF get_rec.dep_type = gme_common_pvt.g_dep_type_start_start THEN
891: 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
892: gme_common_pvt.log_message('GME_STEP_START_PREV_STEP_START',
893: 'PREV_DATE',
894: TO_CHAR(X_prev_start_date, 'DD-MON-YYYY HH24:MI:SS'),
895: 'PREV_STEP', TO_CHAR(X_prev_step),
896: 'CUR_DATE',

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

899: RAISE INVALID_DATE_ERR;
900: END IF;
901: EXIT;
902: END IF;
903: ELSIF (get_rec.dep_type = gme_common_pvt.g_dep_type_finish_start) AND
904: (get_rec.standard_delay >= 0) THEN
905: l_batch_step.actual_cmplt_date := X_prev_start_date - (get_rec.standard_delay/24);
906: ELSE
907: l_batch_step.actual_cmplt_date := X_prev_start_date;

Line 918: gme_common_pvt.log_message('GME_BATCH_START_STEP_START_ERR',

914:
915: -- Validate step actual start date against batch actual start date
916: IF (p_batch_header_rec.actual_start_date IS NOT NULL) THEN
917: IF (l_batch_step.actual_start_date < p_batch_header_rec.actual_start_date) THEN
918: gme_common_pvt.log_message('GME_BATCH_START_STEP_START_ERR',
919: 'STEP_DATE',
920: TO_CHAR(l_batch_step.actual_start_date, 'DD-MON-YYYY HH24:MI:SS'),
921: 'STEP_NO', TO_CHAR(l_batch_step.batchstep_no),
922: 'BATCH_DATE',

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

935: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
936: END IF;
937: EXCEPTION
938: WHEN BATCH_STEP_FETCH_ERROR THEN
939: gme_common_pvt.log_message ('GME_UNEXPECTED_ERROR', 'ERROR'
940: ,SQLERRM);
941: x_return_status := fnd_api.g_ret_sts_unexp_error;
942: WHEN INVALID_DATE_ERR THEN
943: x_return_status := FND_API.G_RET_STS_ERROR;