19: --
20: ----------------------------------------------------------------------
21: PROCEDURE checkMigrationCompletion
22: ( p_api_version IN NUMBER
23: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
24: , p_commit IN VARCHAR2 := fnd_api.g_false
25: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
26: , x_return_status OUT nocopy VARCHAR2
27: , x_msg_count OUT nocopy NUMBER
20: ----------------------------------------------------------------------
21: PROCEDURE checkMigrationCompletion
22: ( p_api_version IN NUMBER
23: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
24: , p_commit IN VARCHAR2 := fnd_api.g_false
25: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
26: , x_return_status OUT nocopy VARCHAR2
27: , x_msg_count OUT nocopy NUMBER
28: , x_msg_data OUT nocopy VARCHAR2
21: PROCEDURE checkMigrationCompletion
22: ( p_api_version IN NUMBER
23: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
24: , p_commit IN VARCHAR2 := fnd_api.g_false
25: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
26: , x_return_status OUT nocopy VARCHAR2
27: , x_msg_count OUT nocopy NUMBER
28: , x_msg_data OUT nocopy VARCHAR2
29: )
49: WHERE dep.transaction_header_id = dpp.transaction_header_id);
50:
51:
52: BEGIN
53: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
54: Fnd_Msg_Pub.initialize;
55: END IF;
56:
57: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
53: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
54: Fnd_Msg_Pub.initialize;
55: END IF;
56:
57: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
58: p_api_version,
59: l_api_name,
60: g_pkg_name
61: )
59: l_api_name,
60: g_pkg_name
61: )
62: THEN
63: RAISE Fnd_Api.g_exc_unexpected_error;
64: END IF;
65:
66: -- Initialize API return status to sucess
67: x_return_status := fnd_api.g_ret_sts_success;
63: RAISE Fnd_Api.g_exc_unexpected_error;
64: END IF;
65:
66: -- Initialize API return status to sucess
67: x_return_status := fnd_api.g_ret_sts_success;
68:
69: IF G_DEBUG THEN
70: fnd_file.put_line(fnd_file.log, ' Begin checkMigrationCompletion ' );
71: END IF;
79: IF l_txn_count = 0 THEN
80: IF G_DEBUG THEN
81: fnd_file.put_line(fnd_file.log, ' Migration has already been performed. ' );
82: END IF;
83: RAISE FND_API.G_EXC_ERROR;
84: END IF;
85: EXCEPTION
86: WHEN FND_API.G_EXC_ERROR THEN
87: x_return_status := FND_API.G_RET_STS_ERROR;
82: END IF;
83: RAISE FND_API.G_EXC_ERROR;
84: END IF;
85: EXCEPTION
86: WHEN FND_API.G_EXC_ERROR THEN
87: x_return_status := FND_API.G_RET_STS_ERROR;
88: x_msg_data := fnd_message.get_string('DPP','DPP_MIG_COMPLETED_ERR');
89:
90: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
83: RAISE FND_API.G_EXC_ERROR;
84: END IF;
85: EXCEPTION
86: WHEN FND_API.G_EXC_ERROR THEN
87: x_return_status := FND_API.G_RET_STS_ERROR;
88: x_msg_data := fnd_message.get_string('DPP','DPP_MIG_COMPLETED_ERR');
89:
90: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
91: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
86: WHEN FND_API.G_EXC_ERROR THEN
87: x_return_status := FND_API.G_RET_STS_ERROR;
88: x_msg_data := fnd_message.get_string('DPP','DPP_MIG_COMPLETED_ERR');
89:
90: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
91: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
92: -- Standard call to get message count and if count=1, get the message
93: FND_MSG_PUB.Count_And_Get (
94: p_encoded => FND_API.G_FALSE,
87: x_return_status := FND_API.G_RET_STS_ERROR;
88: x_msg_data := fnd_message.get_string('DPP','DPP_MIG_COMPLETED_ERR');
89:
90: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
91: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
92: -- Standard call to get message count and if count=1, get the message
93: FND_MSG_PUB.Count_And_Get (
94: p_encoded => FND_API.G_FALSE,
95: p_count => x_msg_count,
90: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
91: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
92: -- Standard call to get message count and if count=1, get the message
93: FND_MSG_PUB.Count_And_Get (
94: p_encoded => FND_API.G_FALSE,
95: p_count => x_msg_count,
96: p_data => x_msg_data
97: );
98: IF x_msg_count > 1 THEN
101: END LOOP;
102: END IF;
103:
104: WHEN OTHERS THEN
105: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
106: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
107: fnd_message.set_token('ROUTINE', 'DPP_MIG_ADJ_PARA_APPROVAL_PVT.checkMigrationCompletion');
108: fnd_message.set_token('ERRNO', sqlcode);
109: fnd_message.set_token('REASON', sqlerrm);
110: FND_MSG_PUB.add;
111:
112: -- Standard call to get message count and if count=1, get the message
113: FND_MSG_PUB.Count_And_Get (
114: p_encoded => FND_API.G_FALSE,
115: p_count => x_msg_count,
116: p_data => x_msg_data
117: );
118: IF x_msg_count > 1 THEN
137: --
138: ----------------------------------------------------------------------
139: PROCEDURE validate_suppTradeProfile
140: ( p_api_version IN NUMBER
141: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
142: , p_commit IN VARCHAR2 := fnd_api.g_false
143: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
144: , x_return_status OUT nocopy VARCHAR2
145: , x_msg_count OUT nocopy NUMBER
138: ----------------------------------------------------------------------
139: PROCEDURE validate_suppTradeProfile
140: ( p_api_version IN NUMBER
141: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
142: , p_commit IN VARCHAR2 := fnd_api.g_false
143: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
144: , x_return_status OUT nocopy VARCHAR2
145: , x_msg_count OUT nocopy NUMBER
146: , x_msg_data OUT nocopy VARCHAR2
139: PROCEDURE validate_suppTradeProfile
140: ( p_api_version IN NUMBER
141: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
142: , p_commit IN VARCHAR2 := fnd_api.g_false
143: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
144: , x_return_status OUT nocopy VARCHAR2
145: , x_msg_count OUT nocopy NUMBER
146: , x_msg_data OUT nocopy VARCHAR2
147: )
187: and apss.org_id = hr.organization_id;
188:
189:
190: BEGIN
191: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
192: Fnd_Msg_Pub.initialize;
193: END IF;
194:
195: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
191: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
192: Fnd_Msg_Pub.initialize;
193: END IF;
194:
195: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
196: p_api_version,
197: l_api_name,
198: g_pkg_name
199: )
197: l_api_name,
198: g_pkg_name
199: )
200: THEN
201: RAISE Fnd_Api.g_exc_unexpected_error;
202: END IF;
203:
204: -- Initialize API return status to sucess
205: x_return_status := fnd_api.g_ret_sts_success;
201: RAISE Fnd_Api.g_exc_unexpected_error;
202: END IF;
203:
204: -- Initialize API return status to sucess
205: x_return_status := fnd_api.g_ret_sts_success;
206:
207: IF G_DEBUG THEN
208: fnd_file.put_line(fnd_file.log, ' Begin validate_suppTradeProfile ' );
209: END IF;
227: END LOOP;
228:
229: IF l_setup_missing = 'Y' THEN
230: fnd_file.put_line(fnd_file.log, ' Please perform the Supplier Trade Profile setup. ' );
231: RAISE FND_API.G_EXC_ERROR;
232: END IF;
233: EXCEPTION
234: WHEN FND_API.G_EXC_ERROR THEN
235: x_return_status := FND_API.G_RET_STS_ERROR;
230: fnd_file.put_line(fnd_file.log, ' Please perform the Supplier Trade Profile setup. ' );
231: RAISE FND_API.G_EXC_ERROR;
232: END IF;
233: EXCEPTION
234: WHEN FND_API.G_EXC_ERROR THEN
235: x_return_status := FND_API.G_RET_STS_ERROR;
236: -- Standard call to get message count and if count=1, get the message
237: FND_MSG_PUB.Count_And_Get (
238: p_encoded => FND_API.G_FALSE,
231: RAISE FND_API.G_EXC_ERROR;
232: END IF;
233: EXCEPTION
234: WHEN FND_API.G_EXC_ERROR THEN
235: x_return_status := FND_API.G_RET_STS_ERROR;
236: -- Standard call to get message count and if count=1, get the message
237: FND_MSG_PUB.Count_And_Get (
238: p_encoded => FND_API.G_FALSE,
239: p_count => x_msg_count,
234: WHEN FND_API.G_EXC_ERROR THEN
235: x_return_status := FND_API.G_RET_STS_ERROR;
236: -- Standard call to get message count and if count=1, get the message
237: FND_MSG_PUB.Count_And_Get (
238: p_encoded => FND_API.G_FALSE,
239: p_count => x_msg_count,
240: p_data => x_msg_data
241: );
242: IF x_msg_count > 1 THEN
244: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
245: END LOOP;
246: END IF;
247:
248: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
249: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
250: -- Standard call to get message count and if count=1, get the message
251: FND_MSG_PUB.Count_And_Get (
252: p_encoded => FND_API.G_FALSE,
245: END LOOP;
246: END IF;
247:
248: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
249: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
250: -- Standard call to get message count and if count=1, get the message
251: FND_MSG_PUB.Count_And_Get (
252: p_encoded => FND_API.G_FALSE,
253: p_count => x_msg_count,
248: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
249: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
250: -- Standard call to get message count and if count=1, get the message
251: FND_MSG_PUB.Count_And_Get (
252: p_encoded => FND_API.G_FALSE,
253: p_count => x_msg_count,
254: p_data => x_msg_data
255: );
256: IF x_msg_count > 1 THEN
259: END LOOP;
260: END IF;
261:
262: WHEN OTHERS THEN
263: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
264: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
265: fnd_message.set_token('ROUTINE', 'DPP_MIG_ADJ_PARA_APPROVAL_PVT.validate_suppTradeProfile');
266: fnd_message.set_token('ERRNO', sqlcode);
267: fnd_message.set_token('REASON', sqlerrm);
268: FND_MSG_PUB.add;
269:
270: -- Standard call to get message count and if count=1, get the message
271: FND_MSG_PUB.Count_And_Get (
272: p_encoded => FND_API.G_FALSE,
273: p_count => x_msg_count,
274: p_data => x_msg_data
275: );
276: IF x_msg_count > 1 THEN
295: --
296: ----------------------------------------------------------------------
297: PROCEDURE validate_execProcessSetup
298: ( p_api_version IN NUMBER
299: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
300: , p_commit IN VARCHAR2 := fnd_api.g_false
301: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
302: , x_return_status OUT nocopy VARCHAR2
303: , x_msg_count OUT nocopy NUMBER
296: ----------------------------------------------------------------------
297: PROCEDURE validate_execProcessSetup
298: ( p_api_version IN NUMBER
299: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
300: , p_commit IN VARCHAR2 := fnd_api.g_false
301: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
302: , x_return_status OUT nocopy VARCHAR2
303: , x_msg_count OUT nocopy NUMBER
304: , x_msg_data OUT nocopy VARCHAR2
297: PROCEDURE validate_execProcessSetup
298: ( p_api_version IN NUMBER
299: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
300: , p_commit IN VARCHAR2 := fnd_api.g_false
301: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
302: , x_return_status OUT nocopy VARCHAR2
303: , x_msg_count OUT nocopy NUMBER
304: , x_msg_data OUT nocopy VARCHAR2
305: )
339: from hr_operating_units hr
340: where hr.organization_id = p_org_id;
341:
342: BEGIN
343: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
344: Fnd_Msg_Pub.initialize;
345: END IF;
346:
347: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
343: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
344: Fnd_Msg_Pub.initialize;
345: END IF;
346:
347: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
348: p_api_version,
349: l_api_name,
350: g_pkg_name
351: )
349: l_api_name,
350: g_pkg_name
351: )
352: THEN
353: RAISE Fnd_Api.g_exc_unexpected_error;
354: END IF;
355:
356: -- Initialize API return status to sucess
357: x_return_status := fnd_api.g_ret_sts_success;
353: RAISE Fnd_Api.g_exc_unexpected_error;
354: END IF;
355:
356: -- Initialize API return status to sucess
357: x_return_status := fnd_api.g_ret_sts_success;
358:
359: IF G_DEBUG THEN
360: fnd_file.put_line(fnd_file.log, ' Begin validate_execProcessSetup ' );
361: END IF;
386: IF l_setup_missing = 'Y' THEN
387: IF G_DEBUG THEN
388: fnd_file.put_line(fnd_file.log, ' Please perform the Execution Process setup. ' );
389: END IF;
390: RAISE FND_API.G_EXC_ERROR;
391: END IF;
392: EXCEPTION
393: WHEN FND_API.G_EXC_ERROR THEN
394: x_return_status := FND_API.G_RET_STS_ERROR;
389: END IF;
390: RAISE FND_API.G_EXC_ERROR;
391: END IF;
392: EXCEPTION
393: WHEN FND_API.G_EXC_ERROR THEN
394: x_return_status := FND_API.G_RET_STS_ERROR;
395: x_msg_data := fnd_message.get_string('DPP','DPP_PROCESS_SETUP_MISSING_ERR');
396:
397: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
390: RAISE FND_API.G_EXC_ERROR;
391: END IF;
392: EXCEPTION
393: WHEN FND_API.G_EXC_ERROR THEN
394: x_return_status := FND_API.G_RET_STS_ERROR;
395: x_msg_data := fnd_message.get_string('DPP','DPP_PROCESS_SETUP_MISSING_ERR');
396:
397: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
398: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
393: WHEN FND_API.G_EXC_ERROR THEN
394: x_return_status := FND_API.G_RET_STS_ERROR;
395: x_msg_data := fnd_message.get_string('DPP','DPP_PROCESS_SETUP_MISSING_ERR');
396:
397: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
398: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
399: -- Standard call to get message count and if count=1, get the message
400: FND_MSG_PUB.Count_And_Get (
401: p_encoded => FND_API.G_FALSE,
394: x_return_status := FND_API.G_RET_STS_ERROR;
395: x_msg_data := fnd_message.get_string('DPP','DPP_PROCESS_SETUP_MISSING_ERR');
396:
397: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
398: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
399: -- Standard call to get message count and if count=1, get the message
400: FND_MSG_PUB.Count_And_Get (
401: p_encoded => FND_API.G_FALSE,
402: p_count => x_msg_count,
397: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
398: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
399: -- Standard call to get message count and if count=1, get the message
400: FND_MSG_PUB.Count_And_Get (
401: p_encoded => FND_API.G_FALSE,
402: p_count => x_msg_count,
403: p_data => x_msg_data
404: );
405: IF x_msg_count > 1 THEN
408: END LOOP;
409: END IF;
410:
411: WHEN OTHERS THEN
412: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
413: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
414: fnd_message.set_token('ROUTINE', 'DPP_MIG_ADJ_PARA_APPROVAL_PVT.validate_execProcessSetup');
415: fnd_message.set_token('ERRNO', sqlcode);
416: fnd_message.set_token('REASON', sqlerrm);
417: FND_MSG_PUB.add;
418:
419: -- Standard call to get message count and if count=1, get the message
420: FND_MSG_PUB.Count_And_Get (
421: p_encoded => FND_API.G_FALSE,
422: p_count => x_msg_count,
423: p_data => x_msg_data
424: );
425: IF x_msg_count > 1 THEN
446: --
447: ----------------------------------------------------------------------
448: PROCEDURE insertExecutionProcesses
449: ( p_api_version IN NUMBER
450: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
451: , p_commit IN VARCHAR2 := fnd_api.g_false
452: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
453: , x_return_status OUT nocopy VARCHAR2
454: , x_msg_count OUT nocopy NUMBER
447: ----------------------------------------------------------------------
448: PROCEDURE insertExecutionProcesses
449: ( p_api_version IN NUMBER
450: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
451: , p_commit IN VARCHAR2 := fnd_api.g_false
452: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
453: , x_return_status OUT nocopy VARCHAR2
454: , x_msg_count OUT nocopy NUMBER
455: , x_msg_data OUT nocopy VARCHAR2
448: PROCEDURE insertExecutionProcesses
449: ( p_api_version IN NUMBER
450: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
451: , p_commit IN VARCHAR2 := fnd_api.g_false
452: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
453: , x_return_status OUT nocopy VARCHAR2
454: , x_msg_count OUT nocopy NUMBER
455: , x_msg_data OUT nocopy VARCHAR2
456: )
517: AND opsa.org_id = p_org_id
518: AND dppl.lookup_code = opsa.process_code;
519:
520: BEGIN
521: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
522: Fnd_Msg_Pub.initialize;
523: END IF;
524:
525: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
521: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
522: Fnd_Msg_Pub.initialize;
523: END IF;
524:
525: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
526: p_api_version,
527: l_api_name,
528: g_pkg_name
529: )
527: l_api_name,
528: g_pkg_name
529: )
530: THEN
531: RAISE Fnd_Api.g_exc_unexpected_error;
532: END IF;
533:
534: -- Initialize API return status to sucess
535: x_return_status := fnd_api.g_ret_sts_success;
531: RAISE Fnd_Api.g_exc_unexpected_error;
532: END IF;
533:
534: -- Initialize API return status to sucess
535: x_return_status := fnd_api.g_ret_sts_success;
536:
537: IF G_DEBUG THEN
538: fnd_file.put_line(fnd_file.log, ' Begin insertExecutionProcesses ' );
539: END IF;
554: EXCEPTION
555: WHEN OTHERS THEN
556: fnd_file.put_line(fnd_file.log,'Exception while fetching supplier trade profile id and org id: ' || SQLERRM);
557: fnd_file.new_line(fnd_file.log);
558: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
559: END;
560:
561: --Check if the Process Setup is done for the Supplier, Supplier site and Operating Unit
562: BEGIN
575: EXCEPTION
576: WHEN OTHERS THEN
577: fnd_file.put_line(fnd_file.log,'Exception while checking if the process setup exists: ' || SQLERRM);
578: fnd_file.new_line(fnd_file.log);
579: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
580: END;
581:
582: --Get the process code either from either supplier trade profile or system parameters
583: BEGIN
605: EXCEPTION
606: WHEN OTHERS THEN
607: fnd_file.put_line(fnd_file.log,'Exception while fetching the process code and inserting into DPP_EXECUTION_PROCESSES: ' || SQLERRM);
608: fnd_file.new_line(fnd_file.log);
609: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
610: END;
611: END LOOP;
612:
613: EXCEPTION
610: END;
611: END LOOP;
612:
613: EXCEPTION
614: WHEN FND_API.G_EXC_ERROR THEN
615: x_return_status := FND_API.G_RET_STS_ERROR;
616: -- Standard call to get message count and if count=1, get the message
617: FND_MSG_PUB.Count_And_Get (
618: p_encoded => FND_API.G_FALSE,
611: END LOOP;
612:
613: EXCEPTION
614: WHEN FND_API.G_EXC_ERROR THEN
615: x_return_status := FND_API.G_RET_STS_ERROR;
616: -- Standard call to get message count and if count=1, get the message
617: FND_MSG_PUB.Count_And_Get (
618: p_encoded => FND_API.G_FALSE,
619: p_count => x_msg_count,
614: WHEN FND_API.G_EXC_ERROR THEN
615: x_return_status := FND_API.G_RET_STS_ERROR;
616: -- Standard call to get message count and if count=1, get the message
617: FND_MSG_PUB.Count_And_Get (
618: p_encoded => FND_API.G_FALSE,
619: p_count => x_msg_count,
620: p_data => x_msg_data
621: );
622: IF x_msg_count > 1 THEN
624: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
625: END LOOP;
626: END IF;
627:
628: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
629: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
630: -- Standard call to get message count and if count=1, get the message
631: FND_MSG_PUB.Count_And_Get (
632: p_encoded => FND_API.G_FALSE,
625: END LOOP;
626: END IF;
627:
628: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
629: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
630: -- Standard call to get message count and if count=1, get the message
631: FND_MSG_PUB.Count_And_Get (
632: p_encoded => FND_API.G_FALSE,
633: p_count => x_msg_count,
628: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
629: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
630: -- Standard call to get message count and if count=1, get the message
631: FND_MSG_PUB.Count_And_Get (
632: p_encoded => FND_API.G_FALSE,
633: p_count => x_msg_count,
634: p_data => x_msg_data
635: );
636: IF x_msg_count > 1 THEN
639: END LOOP;
640: END IF;
641:
642: WHEN OTHERS THEN
643: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
644: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
645: fnd_message.set_token('ROUTINE', 'DPP_MIG_ADJ_PARA_APPROVAL_PVT.insertExecutionProcesses');
646: fnd_message.set_token('ERRNO', sqlcode);
647: fnd_message.set_token('REASON', sqlerrm);
648: FND_MSG_PUB.add;
649:
650: -- Standard call to get message count and if count=1, get the message
651: FND_MSG_PUB.Count_And_Get (
652: p_encoded => FND_API.G_FALSE,
653: p_count => x_msg_count,
654: p_data => x_msg_data
655: );
656: IF x_msg_count > 1 THEN
678: --
679: ----------------------------------------------------------------------
680: PROCEDURE clearAllApprovals
681: ( p_api_version IN NUMBER
682: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
683: , p_commit IN VARCHAR2 := fnd_api.g_false
684: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
685: , x_return_status OUT nocopy VARCHAR2
686: , x_msg_count OUT nocopy NUMBER
679: ----------------------------------------------------------------------
680: PROCEDURE clearAllApprovals
681: ( p_api_version IN NUMBER
682: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
683: , p_commit IN VARCHAR2 := fnd_api.g_false
684: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
685: , x_return_status OUT nocopy VARCHAR2
686: , x_msg_count OUT nocopy NUMBER
687: , x_msg_data OUT nocopy VARCHAR2
680: PROCEDURE clearAllApprovals
681: ( p_api_version IN NUMBER
682: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
683: , p_commit IN VARCHAR2 := fnd_api.g_false
684: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
685: , x_return_status OUT nocopy VARCHAR2
686: , x_msg_count OUT nocopy NUMBER
687: , x_msg_data OUT nocopy VARCHAR2
688: )
708: where transaction_status IN ( 'APPROVED' , 'REJECTED' , 'PENDING_APPROVAL' )
709: and trunc(effective_start_date) > trunc(sysdate);
710:
711: BEGIN
712: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
713: Fnd_Msg_Pub.initialize;
714: END IF;
715:
716: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
712: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
713: Fnd_Msg_Pub.initialize;
714: END IF;
715:
716: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
717: p_api_version,
718: l_api_name,
719: g_pkg_name
720: )
718: l_api_name,
719: g_pkg_name
720: )
721: THEN
722: RAISE Fnd_Api.g_exc_unexpected_error;
723: END IF;
724:
725: -- Initialize API return status to sucess
726: x_return_status := fnd_api.g_ret_sts_success;
722: RAISE Fnd_Api.g_exc_unexpected_error;
723: END IF;
724:
725: -- Initialize API return status to sucess
726: x_return_status := fnd_api.g_ret_sts_success;
727:
728: IF G_DEBUG THEN
729: fnd_file.put_line(fnd_file.log, ' Begin clearAllApprovals ' );
730: END IF;
747: fnd_message.set_token('ROUTINE', 'DPP_MIG_ADJ_PARA_APPROVAL_PVT.clearAllApprovals');
748: fnd_message.set_token('ERRNO', sqlcode);
749: fnd_message.set_token('REASON', sqlerrm);
750: fnd_msg_pub.add;
751: RAISE fnd_api.g_exc_unexpected_error;
752: END;
753:
754: FOR validTransactionsRec IN validTransactionsCur
755: LOOP
769: fnd_message.set_token('ROUTINE', 'DPP_MIG_ADJ_PARA_APPROVAL_PVT.clearAllApprovals');
770: fnd_message.set_token('ERRNO', sqlcode);
771: fnd_message.set_token('REASON', sqlerrm);
772: FND_MSG_PUB.add;
773: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
774: END;
775: END LOOP;
776:
777: EXCEPTION
774: END;
775: END LOOP;
776:
777: EXCEPTION
778: WHEN FND_API.G_EXC_ERROR THEN
779: x_return_status := FND_API.G_RET_STS_ERROR;
780: -- Standard call to get message count and if count=1, get the message
781: FND_MSG_PUB.Count_And_Get (
782: p_encoded => FND_API.G_FALSE,
775: END LOOP;
776:
777: EXCEPTION
778: WHEN FND_API.G_EXC_ERROR THEN
779: x_return_status := FND_API.G_RET_STS_ERROR;
780: -- Standard call to get message count and if count=1, get the message
781: FND_MSG_PUB.Count_And_Get (
782: p_encoded => FND_API.G_FALSE,
783: p_count => x_msg_count,
778: WHEN FND_API.G_EXC_ERROR THEN
779: x_return_status := FND_API.G_RET_STS_ERROR;
780: -- Standard call to get message count and if count=1, get the message
781: FND_MSG_PUB.Count_And_Get (
782: p_encoded => FND_API.G_FALSE,
783: p_count => x_msg_count,
784: p_data => x_msg_data
785: );
786: IF x_msg_count > 1 THEN
788: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
789: END LOOP;
790: END IF;
791:
792: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
793: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
794: -- Standard call to get message count and if count=1, get the message
795: FND_MSG_PUB.Count_And_Get (
796: p_encoded => FND_API.G_FALSE,
789: END LOOP;
790: END IF;
791:
792: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
793: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
794: -- Standard call to get message count and if count=1, get the message
795: FND_MSG_PUB.Count_And_Get (
796: p_encoded => FND_API.G_FALSE,
797: p_count => x_msg_count,
792: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
793: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
794: -- Standard call to get message count and if count=1, get the message
795: FND_MSG_PUB.Count_And_Get (
796: p_encoded => FND_API.G_FALSE,
797: p_count => x_msg_count,
798: p_data => x_msg_data
799: );
800: IF x_msg_count > 1 THEN
803: END LOOP;
804: END IF;
805:
806: WHEN OTHERS THEN
807: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
808: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
809: fnd_message.set_token('ROUTINE', 'DPP_MIG_ADJ_PARA_APPROVAL_PVT.clearAllApprovals');
810: fnd_message.set_token('ERRNO', sqlcode);
811: fnd_message.set_token('REASON', sqlerrm);
812: FND_MSG_PUB.add;
813:
814: -- Standard call to get message count and if count=1, get the message
815: FND_MSG_PUB.Count_And_Get (
816: p_encoded => FND_API.G_FALSE,
817: p_count => x_msg_count,
818: p_data => x_msg_data
819: );
820: IF x_msg_count > 1 THEN
838: --
839: ----------------------------------------------------------------------
840: PROCEDURE update_status
841: ( p_api_version IN NUMBER
842: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
843: , p_commit IN VARCHAR2 := fnd_api.g_false
844: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
845: , x_return_status OUT nocopy VARCHAR2
846: , x_msg_count OUT nocopy NUMBER
839: ----------------------------------------------------------------------
840: PROCEDURE update_status
841: ( p_api_version IN NUMBER
842: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
843: , p_commit IN VARCHAR2 := fnd_api.g_false
844: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
845: , x_return_status OUT nocopy VARCHAR2
846: , x_msg_count OUT nocopy NUMBER
847: , x_msg_data OUT nocopy VARCHAR2
840: PROCEDURE update_status
841: ( p_api_version IN NUMBER
842: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
843: , p_commit IN VARCHAR2 := fnd_api.g_false
844: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
845: , x_return_status OUT nocopy VARCHAR2
846: , x_msg_count OUT nocopy NUMBER
847: , x_msg_data OUT nocopy VARCHAR2
848: )
861: l_msg_count NUMBER;
862: l_msg_data VARCHAR2(4000);
863:
864: BEGIN
865: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
866: Fnd_Msg_Pub.initialize;
867: END IF;
868:
869: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
865: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
866: Fnd_Msg_Pub.initialize;
867: END IF;
868:
869: IF NOT Fnd_Api.compatible_api_call ( l_api_version,
870: p_api_version,
871: l_api_name,
872: g_pkg_name
873: )
871: l_api_name,
872: g_pkg_name
873: )
874: THEN
875: RAISE Fnd_Api.g_exc_unexpected_error;
876: END IF;
877:
878: -- Initialize API return status to sucess
879: x_return_status := fnd_api.g_ret_sts_success;
875: RAISE Fnd_Api.g_exc_unexpected_error;
876: END IF;
877:
878: -- Initialize API return status to sucess
879: x_return_status := fnd_api.g_ret_sts_success;
880:
881: IF G_DEBUG THEN
882: fnd_file.put_line(fnd_file.log, ' Begin update_status ' );
883: END IF;
971:
972: fnd_file.put_line(fnd_file.log, ' No of transactions from PENDING_APPROVAL to ACTIVE: ' || SQL%ROWCOUNT );
973:
974: EXCEPTION
975: WHEN FND_API.G_EXC_ERROR THEN
976: x_return_status := FND_API.G_RET_STS_ERROR;
977: -- Standard call to get message count and if count=1, get the message
978: FND_MSG_PUB.Count_And_Get (
979: p_encoded => FND_API.G_FALSE,
972: fnd_file.put_line(fnd_file.log, ' No of transactions from PENDING_APPROVAL to ACTIVE: ' || SQL%ROWCOUNT );
973:
974: EXCEPTION
975: WHEN FND_API.G_EXC_ERROR THEN
976: x_return_status := FND_API.G_RET_STS_ERROR;
977: -- Standard call to get message count and if count=1, get the message
978: FND_MSG_PUB.Count_And_Get (
979: p_encoded => FND_API.G_FALSE,
980: p_count => x_msg_count,
975: WHEN FND_API.G_EXC_ERROR THEN
976: x_return_status := FND_API.G_RET_STS_ERROR;
977: -- Standard call to get message count and if count=1, get the message
978: FND_MSG_PUB.Count_And_Get (
979: p_encoded => FND_API.G_FALSE,
980: p_count => x_msg_count,
981: p_data => x_msg_data
982: );
983: IF x_msg_count > 1 THEN
985: x_msg_data := SUBSTR((x_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
986: END LOOP;
987: END IF;
988:
989: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
990: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
991: -- Standard call to get message count and if count=1, get the message
992: FND_MSG_PUB.Count_And_Get (
993: p_encoded => FND_API.G_FALSE,
986: END LOOP;
987: END IF;
988:
989: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
990: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
991: -- Standard call to get message count and if count=1, get the message
992: FND_MSG_PUB.Count_And_Get (
993: p_encoded => FND_API.G_FALSE,
994: p_count => x_msg_count,
989: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
990: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
991: -- Standard call to get message count and if count=1, get the message
992: FND_MSG_PUB.Count_And_Get (
993: p_encoded => FND_API.G_FALSE,
994: p_count => x_msg_count,
995: p_data => x_msg_data
996: );
997: IF x_msg_count > 1 THEN
1000: END LOOP;
1001: END IF;
1002:
1003: WHEN OTHERS THEN
1004: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1005: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
1006: fnd_message.set_token('ROUTINE', 'DPP_MIG_ADJ_PARA_APPROVAL_PVT.update_status');
1007: fnd_message.set_token('ERRNO', sqlcode);
1008: fnd_message.set_token('REASON', sqlerrm);
1009: FND_MSG_PUB.add;
1010:
1011: -- Standard call to get message count and if count=1, get the message
1012: FND_MSG_PUB.Count_And_Get (
1013: p_encoded => FND_API.G_FALSE,
1014: p_count => x_msg_count,
1015: p_data => x_msg_data
1016: );
1017: IF x_msg_count > 1 THEN
1047: l_return_status VARCHAR2(30);
1048: l_msg_count NUMBER;
1049: l_msg_data VARCHAR2(4000);
1050:
1051: l_init_msg_list VARCHAR2(30) := fnd_api.g_true;
1052: l_commit VARCHAR2(30) := fnd_api.g_false;
1053: l_validation_level NUMBER := fnd_api.g_valid_level_full;
1054:
1055: BEGIN
1048: l_msg_count NUMBER;
1049: l_msg_data VARCHAR2(4000);
1050:
1051: l_init_msg_list VARCHAR2(30) := fnd_api.g_true;
1052: l_commit VARCHAR2(30) := fnd_api.g_false;
1053: l_validation_level NUMBER := fnd_api.g_valid_level_full;
1054:
1055: BEGIN
1056: -- Standard API savepoint
1049: l_msg_data VARCHAR2(4000);
1050:
1051: l_init_msg_list VARCHAR2(30) := fnd_api.g_true;
1052: l_commit VARCHAR2(30) := fnd_api.g_false;
1053: l_validation_level NUMBER := fnd_api.g_valid_level_full;
1054:
1055: BEGIN
1056: -- Standard API savepoint
1057: SAVEPOINT update_transaction_status;
1058:
1059: -- Initialize API return status to sucess
1060: errbuf :='Success';
1061: retcode := 0;
1062: l_return_status := FND_API.G_RET_STS_SUCCESS;
1063:
1064: IF G_DEBUG THEN
1065: fnd_file.put_line(fnd_file.LOG,'Check if the migration has already been completed successfully.');
1066: END IF;
1078: IF G_DEBUG THEN
1079: fnd_file.put_line(fnd_file.log, ' Check migration completion. Return Status: ' || l_return_status || ' Error Msg: ' || l_msg_data);
1080: END IF;
1081:
1082: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1083: fnd_file.put_line(fnd_file.log, l_msg_data);
1084: errbuf := 'Warning';
1085: retcode := 1;
1086: RETURN;
1083: fnd_file.put_line(fnd_file.log, l_msg_data);
1084: errbuf := 'Warning';
1085: retcode := 1;
1086: RETURN;
1087: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1088: RAISE Fnd_Api.g_exc_unexpected_error;
1089: END IF;
1090:
1091: fnd_file.put_line(fnd_file.log,('-----------------------------------------------------------'));
1084: errbuf := 'Warning';
1085: retcode := 1;
1086: RETURN;
1087: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1088: RAISE Fnd_Api.g_exc_unexpected_error;
1089: END IF;
1090:
1091: fnd_file.put_line(fnd_file.log,('-----------------------------------------------------------'));
1092: fnd_file.put_line(fnd_file.log,(' Migration started at ' || to_char(sysdate,'dd-mon-yyyy hh24:mi:ss')));
1109: IF G_DEBUG THEN
1110: fnd_file.put_line(fnd_file.log, ' Validate Supplier Trade Profile. Return Status: ' || l_return_status || ' Error Msg: ' || l_msg_data);
1111: END IF;
1112:
1113: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1114: RAISE Fnd_Api.g_exc_error;
1115: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1116: RAISE Fnd_Api.g_exc_unexpected_error;
1117: END IF;
1110: fnd_file.put_line(fnd_file.log, ' Validate Supplier Trade Profile. Return Status: ' || l_return_status || ' Error Msg: ' || l_msg_data);
1111: END IF;
1112:
1113: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1114: RAISE Fnd_Api.g_exc_error;
1115: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1116: RAISE Fnd_Api.g_exc_unexpected_error;
1117: END IF;
1118:
1111: END IF;
1112:
1113: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1114: RAISE Fnd_Api.g_exc_error;
1115: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1116: RAISE Fnd_Api.g_exc_unexpected_error;
1117: END IF;
1118:
1119: IF G_DEBUG THEN
1112:
1113: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1114: RAISE Fnd_Api.g_exc_error;
1115: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1116: RAISE Fnd_Api.g_exc_unexpected_error;
1117: END IF;
1118:
1119: IF G_DEBUG THEN
1120: FND_FILE.PUT_LINE(FND_FILE.LOG,'Validate Execution Process Setup');
1133: IF G_DEBUG THEN
1134: fnd_file.put_line(fnd_file.log, ' Validate Execution Process Setup. Return Status: ' || l_return_status || ' Error Msg: ' || l_msg_data);
1135: END IF;
1136:
1137: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1138: fnd_file.put_line(fnd_file.log, l_msg_data);
1139: errbuf := 'Error';
1140: retcode := 2;
1141: RETURN;
1138: fnd_file.put_line(fnd_file.log, l_msg_data);
1139: errbuf := 'Error';
1140: retcode := 2;
1141: RETURN;
1142: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1143: RAISE Fnd_Api.g_exc_unexpected_error;
1144: END IF;
1145:
1146: IF G_DEBUG THEN
1139: errbuf := 'Error';
1140: retcode := 2;
1141: RETURN;
1142: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1143: RAISE Fnd_Api.g_exc_unexpected_error;
1144: END IF;
1145:
1146: IF G_DEBUG THEN
1147: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert Execution Processes');
1160: IF G_DEBUG THEN
1161: fnd_file.put_line(fnd_file.log, ' Insert Execution Processes. Return Status: ' || l_return_status || ' Error Msg: ' || l_msg_data);
1162: END IF;
1163:
1164: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1165: RAISE Fnd_Api.g_exc_error;
1166: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1167: RAISE Fnd_Api.g_exc_unexpected_error;
1168: END IF;
1161: fnd_file.put_line(fnd_file.log, ' Insert Execution Processes. Return Status: ' || l_return_status || ' Error Msg: ' || l_msg_data);
1162: END IF;
1163:
1164: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1165: RAISE Fnd_Api.g_exc_error;
1166: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1167: RAISE Fnd_Api.g_exc_unexpected_error;
1168: END IF;
1169:
1162: END IF;
1163:
1164: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1165: RAISE Fnd_Api.g_exc_error;
1166: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1167: RAISE Fnd_Api.g_exc_unexpected_error;
1168: END IF;
1169:
1170: IF G_DEBUG THEN
1163:
1164: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1165: RAISE Fnd_Api.g_exc_error;
1166: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1167: RAISE Fnd_Api.g_exc_unexpected_error;
1168: END IF;
1169:
1170: IF G_DEBUG THEN
1171: FND_FILE.PUT_LINE(FND_FILE.LOG,'Clear all the approvals in both Price Protection and AME');
1184: IF G_DEBUG THEN
1185: fnd_file.put_line(fnd_file.log, ' Clear All Approvals. Return Status: ' || l_return_status || ' Error Msg: ' || l_msg_data);
1186: END IF;
1187:
1188: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1189: RAISE Fnd_Api.g_exc_error;
1190: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1191: RAISE Fnd_Api.g_exc_unexpected_error;
1192: END IF;
1185: fnd_file.put_line(fnd_file.log, ' Clear All Approvals. Return Status: ' || l_return_status || ' Error Msg: ' || l_msg_data);
1186: END IF;
1187:
1188: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1189: RAISE Fnd_Api.g_exc_error;
1190: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1191: RAISE Fnd_Api.g_exc_unexpected_error;
1192: END IF;
1193:
1186: END IF;
1187:
1188: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1189: RAISE Fnd_Api.g_exc_error;
1190: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1191: RAISE Fnd_Api.g_exc_unexpected_error;
1192: END IF;
1193:
1194: IF G_DEBUG THEN
1187:
1188: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1189: RAISE Fnd_Api.g_exc_error;
1190: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1191: RAISE Fnd_Api.g_exc_unexpected_error;
1192: END IF;
1193:
1194: IF G_DEBUG THEN
1195: FND_FILE.PUT_LINE(FND_FILE.LOG,'Update status');
1208: IF G_DEBUG THEN
1209: fnd_file.put_line(fnd_file.log, ' Update status. Return Status: ' || l_return_status || ' Error Msg: ' || l_msg_data);
1210: END IF;
1211:
1212: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1213: RAISE Fnd_Api.g_exc_error;
1214: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1215: RAISE Fnd_Api.g_exc_unexpected_error;
1216: END IF;
1209: fnd_file.put_line(fnd_file.log, ' Update status. Return Status: ' || l_return_status || ' Error Msg: ' || l_msg_data);
1210: END IF;
1211:
1212: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1213: RAISE Fnd_Api.g_exc_error;
1214: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1215: RAISE Fnd_Api.g_exc_unexpected_error;
1216: END IF;
1217:
1210: END IF;
1211:
1212: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1213: RAISE Fnd_Api.g_exc_error;
1214: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1215: RAISE Fnd_Api.g_exc_unexpected_error;
1216: END IF;
1217:
1218: COMMIT;
1211:
1212: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
1213: RAISE Fnd_Api.g_exc_error;
1214: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
1215: RAISE Fnd_Api.g_exc_unexpected_error;
1216: END IF;
1217:
1218: COMMIT;
1219:
1221: fnd_file.put_line(fnd_file.log,(' Migration completed at ' || to_char(sysdate,'dd-mon-yyyy hh24:mi:ss')));
1222: fnd_file.put_line(fnd_file.log,('-----------------------------------------------------------'));
1223:
1224: EXCEPTION
1225: WHEN FND_API.G_EXC_ERROR THEN
1226: ROLLBACK TO update_transaction_status;
1227: errbuf :='Error';
1228: retcode := 2;
1229: -- Standard call to get message count and if count=1, get the message
1227: errbuf :='Error';
1228: retcode := 2;
1229: -- Standard call to get message count and if count=1, get the message
1230: FND_MSG_PUB.Count_And_Get (
1231: p_encoded => FND_API.G_FALSE,
1232: p_count => l_msg_count,
1233: p_data => l_msg_data
1234: );
1235: IF l_msg_count > 1 THEN
1237: l_msg_data := SUBSTR((l_msg_data||' '|| FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F')), 1, 4000);
1238: END LOOP;
1239: END IF;
1240:
1241: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1242: ROLLBACK TO update_transaction_status;
1243: errbuf :='Error';
1244: retcode := 2;
1245: -- Standard call to get message count and if count=1, get the message
1243: errbuf :='Error';
1244: retcode := 2;
1245: -- Standard call to get message count and if count=1, get the message
1246: FND_MSG_PUB.Count_And_Get (
1247: p_encoded => FND_API.G_FALSE,
1248: p_count => l_msg_count,
1249: p_data => l_msg_data
1250: );
1251: IF l_msg_count > 1 THEN
1265: FND_MSG_PUB.add;
1266:
1267: -- Standard call to get message count and if count=1, get the message
1268: FND_MSG_PUB.Count_And_Get (
1269: p_encoded => FND_API.G_FALSE,
1270: p_count => l_msg_count,
1271: p_data => l_msg_data
1272: );
1273: IF l_msg_count > 1 THEN