82:
83: l_stmt_num := 30;
84: -- Initialize message list if p_init_msg_list is set to TRUE.
85: IF fnd_api.to_boolean(p_init_msg_list) THEN
86: fnd_msg_pub.initialize;
87: END IF;
88:
89: l_stmt_num := 40;
90: -- Initialize API return status to success
98: IF (p_organization_id IS NULL) THEN
99:
100: fnd_message.set_name('EAM', 'EAM_INPUT_PARAMS_NULL');
101: fnd_message.set_token('EAM_DEBUG',l_full_name||'('||l_stmt_num||')');
102: fnd_msg_pub.add;
103: RAISE fnd_api.g_exc_error;
104: END IF;
105:
106: l_organization_id := p_organization_id;
112: IF (c_org_code%NOTFOUND) THEN
113:
114: fnd_message.set_name('EAM', 'EAM_ORG_CODE_NULL');
115: fnd_message.set_token('EAM_DEBUG',l_full_name||'('||l_stmt_num||')');
116: fnd_msg_pub.add;
117: RAISE fnd_api.g_exc_error;
118: END IF;
119: CLOSE c_org_code;
120:
128: END IF;
129:
130: l_stmt_num := 999;
131: -- Standard call to get message count and if count is 1, get message info.
132: fnd_msg_pub.count_and_get(
133: p_count => x_msg_count
134: ,p_data => x_msg_data);
135: EXCEPTION
136: WHEN fnd_api.g_exc_error THEN
135: EXCEPTION
136: WHEN fnd_api.g_exc_error THEN
137: ROLLBACK TO get_org_code_pvt;
138: x_return_status := fnd_api.g_ret_sts_error;
139: fnd_msg_pub.count_and_get(
140: p_count => x_msg_count
141: ,p_data => x_msg_data);
142: WHEN fnd_api.g_exc_unexpected_error THEN
143: ROLLBACK TO get_org_code_pvt;
142: WHEN fnd_api.g_exc_unexpected_error THEN
143: ROLLBACK TO get_org_code_pvt;
144: x_return_status := fnd_api.g_ret_sts_unexp_error;
145:
146: fnd_msg_pub.count_and_get(
147: p_count => x_msg_count
148: ,p_data => x_msg_data);
149: WHEN OTHERS THEN
150: ROLLBACK TO get_org_code_pvt;
148: ,p_data => x_msg_data);
149: WHEN OTHERS THEN
150: ROLLBACK TO get_org_code_pvt;
151: x_return_status := fnd_api.g_ret_sts_unexp_error;
152: IF fnd_msg_pub.check_msg_level(
153: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
154: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
155: END IF;
156:
149: WHEN OTHERS THEN
150: ROLLBACK TO get_org_code_pvt;
151: x_return_status := fnd_api.g_ret_sts_unexp_error;
152: IF fnd_msg_pub.check_msg_level(
153: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
154: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
155: END IF;
156:
157: fnd_msg_pub.count_and_get(
150: ROLLBACK TO get_org_code_pvt;
151: x_return_status := fnd_api.g_ret_sts_unexp_error;
152: IF fnd_msg_pub.check_msg_level(
153: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
154: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
155: END IF;
156:
157: fnd_msg_pub.count_and_get(
158: p_count => x_msg_count
153: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
154: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
155: END IF;
156:
157: fnd_msg_pub.count_and_get(
158: p_count => x_msg_count
159: ,p_data => x_msg_data);
160: END get_org_code;
161:
196:
197: l_stmt_num := 30;
198: -- Initialize message list if p_init_msg_list is set to TRUE.
199: IF fnd_api.to_boolean(p_init_msg_list) THEN
200: fnd_msg_pub.initialize;
201: END IF;
202:
203: l_stmt_num := 40;
204: -- Initialize API return status to success
214: IF (p_organization_id IS NULL OR p_concatenated_segments IS NULL) THEN
215:
216: fnd_message.set_name('EAM', 'EAM_INPUT_PARAMS_NULL');
217: fnd_message.set_token('EAM_DEBUG',l_full_name||'('||l_stmt_num||')');
218: fnd_msg_pub.add;
219: RAISE fnd_api.g_exc_error;
220: END IF;
221:
222: l_organization_id := p_organization_id;
242: END IF;
243:
244: l_stmt_num := 999;
245: -- Standard call to get message count and if count is 1, get message info.
246: fnd_msg_pub.count_and_get(
247: p_count => x_msg_count
248: ,p_data => x_msg_data);
249: EXCEPTION
250: WHEN fnd_api.g_exc_error THEN
249: EXCEPTION
250: WHEN fnd_api.g_exc_error THEN
251: ROLLBACK TO get_org_code_pvt;
252: x_return_status := fnd_api.g_ret_sts_error;
253: fnd_msg_pub.count_and_get(
254: p_count => x_msg_count
255: ,p_data => x_msg_data);
256: WHEN fnd_api.g_exc_unexpected_error THEN
257: ROLLBACK TO get_org_code_pvt;
255: ,p_data => x_msg_data);
256: WHEN fnd_api.g_exc_unexpected_error THEN
257: ROLLBACK TO get_org_code_pvt;
258: x_return_status := fnd_api.g_ret_sts_unexp_error;
259: fnd_msg_pub.count_and_get(
260: p_count => x_msg_count
261: ,p_data => x_msg_data);
262: WHEN OTHERS THEN
263: ROLLBACK TO get_org_code_pvt;
262: WHEN OTHERS THEN
263: ROLLBACK TO get_org_code_pvt;
264: x_return_status := fnd_api.g_ret_sts_unexp_error;
265:
266: IF fnd_msg_pub.check_msg_level(
267: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
268: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
269: END IF;
270:
263: ROLLBACK TO get_org_code_pvt;
264: x_return_status := fnd_api.g_ret_sts_unexp_error;
265:
266: IF fnd_msg_pub.check_msg_level(
267: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
268: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
269: END IF;
270:
271: fnd_msg_pub.count_and_get(
264: x_return_status := fnd_api.g_ret_sts_unexp_error;
265:
266: IF fnd_msg_pub.check_msg_level(
267: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
268: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
269: END IF;
270:
271: fnd_msg_pub.count_and_get(
272: p_count => x_msg_count
267: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
268: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
269: END IF;
270:
271: fnd_msg_pub.count_and_get(
272: p_count => x_msg_count
273: ,p_data => x_msg_data);
274: END get_item_id;
275:
316:
317: l_stmt_num := 30;
318: -- Initialize message list if p_init_msg_list is set to TRUE.
319: IF fnd_api.to_boolean(p_init_msg_list) THEN
320: fnd_msg_pub.initialize;
321: END IF;
322:
323: l_stmt_num := 40;
324: -- Initialize API return status to success
333: IF (p_organization_id IS NULL) THEN
334:
335: fnd_message.set_name('EAM', 'EAM_INPUT_PARAMS_NULL');
336: fnd_message.set_token('EAM_DEBUG',l_full_name||'('||l_stmt_num||')');
337: fnd_msg_pub.add;
338: RAISE fnd_api.g_exc_error;
339: END IF;
340:
341: l_organization_id := p_organization_id;
362: END IF;
363:
364: l_stmt_num := 999;
365: -- Standard call to get message count and if count is 1, get message info.
366: fnd_msg_pub.count_and_get(
367: p_count => x_msg_count
368: ,p_data => x_msg_data);
369: EXCEPTION
370: WHEN fnd_api.g_exc_error THEN
369: EXCEPTION
370: WHEN fnd_api.g_exc_error THEN
371: ROLLBACK TO get_current_period_pvt;
372: x_return_status := fnd_api.g_ret_sts_error;
373: fnd_msg_pub.count_and_get(
374: p_count => x_msg_count
375: ,p_data => x_msg_data);
376: WHEN fnd_api.g_exc_unexpected_error THEN
377: ROLLBACK TO get_current_period_pvt;
375: ,p_data => x_msg_data);
376: WHEN fnd_api.g_exc_unexpected_error THEN
377: ROLLBACK TO get_current_period_pvt;
378: x_return_status := fnd_api.g_ret_sts_unexp_error;
379: fnd_msg_pub.count_and_get(
380: p_count => x_msg_count
381: ,p_data => x_msg_data);
382: WHEN OTHERS THEN
383: ROLLBACK TO get_current_period_pvt;
382: WHEN OTHERS THEN
383: ROLLBACK TO get_current_period_pvt;
384: x_return_status := fnd_api.g_ret_sts_unexp_error;
385:
386: IF fnd_msg_pub.check_msg_level(
387: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
388: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
389: END IF;
390:
383: ROLLBACK TO get_current_period_pvt;
384: x_return_status := fnd_api.g_ret_sts_unexp_error;
385:
386: IF fnd_msg_pub.check_msg_level(
387: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
388: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
389: END IF;
390:
391: fnd_msg_pub.count_and_get(
384: x_return_status := fnd_api.g_ret_sts_unexp_error;
385:
386: IF fnd_msg_pub.check_msg_level(
387: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
388: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
389: END IF;
390:
391: fnd_msg_pub.count_and_get(
392: p_count => x_msg_count
387: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
388: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
389: END IF;
390:
391: fnd_msg_pub.count_and_get(
392: p_count => x_msg_count
393: ,p_data => x_msg_data);
394: END get_current_period;
395:
433:
434: l_stmt_num := 30;
435: -- Initialize message list if p_init_msg_list is set to TRUE.
436: IF fnd_api.to_boolean(p_init_msg_list) THEN
437: fnd_msg_pub.initialize;
438: END IF;
439:
440: l_stmt_num := 40;
441: -- Initialize API return status to success
450: IF (p_organization_id IS NULL) THEN
451:
452: fnd_message.set_name('EAM', 'EAM_INPUT_PARAMS_NULL');
453: fnd_message.set_token('EAM_DEBUG',l_full_name||'('||l_stmt_num||')');
454: fnd_msg_pub.add;
455: RAISE fnd_api.g_exc_error;
456: END IF;
457:
458: l_organization_id := p_organization_id;
471: END IF;
472:
473: l_stmt_num := 999;
474: -- Standard call to get message count and if count is 1, get message info.
475: fnd_msg_pub.count_and_get(
476: p_count => x_msg_count
477: ,p_data => x_msg_data);
478: EXCEPTION
479: WHEN fnd_api.g_exc_error THEN
478: EXCEPTION
479: WHEN fnd_api.g_exc_error THEN
480: ROLLBACK TO get_currency_pvt;
481: x_return_status := fnd_api.g_ret_sts_error;
482: fnd_msg_pub.count_and_get(
483: p_count => x_msg_count
484: ,p_data => x_msg_data);
485: WHEN fnd_api.g_exc_unexpected_error THEN
486: ROLLBACK TO get_currency_pvt;
484: ,p_data => x_msg_data);
485: WHEN fnd_api.g_exc_unexpected_error THEN
486: ROLLBACK TO get_currency_pvt;
487: x_return_status := fnd_api.g_ret_sts_unexp_error;
488: fnd_msg_pub.count_and_get(
489: p_count => x_msg_count
490: ,p_data => x_msg_data);
491: WHEN OTHERS THEN
492: ROLLBACK TO get_currency_pvt;
491: WHEN OTHERS THEN
492: ROLLBACK TO get_currency_pvt;
493: x_return_status := fnd_api.g_ret_sts_unexp_error;
494:
495: IF fnd_msg_pub.check_msg_level(
496: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
497: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
498: END IF;
499:
492: ROLLBACK TO get_currency_pvt;
493: x_return_status := fnd_api.g_ret_sts_unexp_error;
494:
495: IF fnd_msg_pub.check_msg_level(
496: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
497: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
498: END IF;
499:
500: fnd_msg_pub.count_and_get(
493: x_return_status := fnd_api.g_ret_sts_unexp_error;
494:
495: IF fnd_msg_pub.check_msg_level(
496: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
497: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
498: END IF;
499:
500: fnd_msg_pub.count_and_get(
501: p_count => x_msg_count
496: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
497: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
498: END IF;
499:
500: fnd_msg_pub.count_and_get(
501: p_count => x_msg_count
502: ,p_data => x_msg_data);
503: END get_currency;
504:
551:
552: l_stmt_num := 30;
553: -- Initialize message list if p_init_msg_list is set to TRUE.
554: IF fnd_api.to_boolean(p_init_msg_list) THEN
555: fnd_msg_pub.initialize;
556: END IF;
557:
558: l_stmt_num := 40;
559: -- Initialize API return status to success
877: END IF;
878:
879: l_stmt_num := 999;
880: -- Standard call to get message count and if count is 1, get message info.
881: fnd_msg_pub.count_and_get(
882: p_encoded => fnd_api.g_false
883: ,p_count => x_msg_count
884: ,p_data => x_msg_data);
885:
887: WHEN fnd_api.g_exc_error THEN
888: ROLLBACK TO get_next_asset_number_pvt;
889: x_return_status := fnd_api.g_ret_sts_error;
890: x_asset_number := NULL;
891: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
892: fnd_msg_pub.count_and_get(
893: p_encoded => fnd_api.g_false
894: ,p_count => x_msg_count
895: ,p_data => x_msg_data);
888: ROLLBACK TO get_next_asset_number_pvt;
889: x_return_status := fnd_api.g_ret_sts_error;
890: x_asset_number := NULL;
891: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
892: fnd_msg_pub.count_and_get(
893: p_encoded => fnd_api.g_false
894: ,p_count => x_msg_count
895: ,p_data => x_msg_data);
896: WHEN fnd_api.g_exc_unexpected_error THEN
896: WHEN fnd_api.g_exc_unexpected_error THEN
897: ROLLBACK TO get_next_asset_number_pvt;
898: x_return_status := fnd_api.g_ret_sts_unexp_error;
899: x_asset_number := NULL;
900: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
901: fnd_msg_pub.count_and_get(
902: p_encoded => fnd_api.g_false
903: ,p_count => x_msg_count
904: ,p_data => x_msg_data);
897: ROLLBACK TO get_next_asset_number_pvt;
898: x_return_status := fnd_api.g_ret_sts_unexp_error;
899: x_asset_number := NULL;
900: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
901: fnd_msg_pub.count_and_get(
902: p_encoded => fnd_api.g_false
903: ,p_count => x_msg_count
904: ,p_data => x_msg_data);
905: WHEN OTHERS THEN
905: WHEN OTHERS THEN
906: ROLLBACK TO get_next_asset_number_pvt;
907: x_return_status := fnd_api.g_ret_sts_unexp_error;
908: x_asset_number := NULL;
909: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
910: IF fnd_msg_pub.check_msg_level(
911: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
912: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
913: END IF;
906: ROLLBACK TO get_next_asset_number_pvt;
907: x_return_status := fnd_api.g_ret_sts_unexp_error;
908: x_asset_number := NULL;
909: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
910: IF fnd_msg_pub.check_msg_level(
911: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
912: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
913: END IF;
914:
907: x_return_status := fnd_api.g_ret_sts_unexp_error;
908: x_asset_number := NULL;
909: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
910: IF fnd_msg_pub.check_msg_level(
911: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
912: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
913: END IF;
914:
915: fnd_msg_pub.count_and_get(
908: x_asset_number := NULL;
909: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
910: IF fnd_msg_pub.check_msg_level(
911: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
912: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
913: END IF;
914:
915: fnd_msg_pub.count_and_get(
916: p_encoded => fnd_api.g_false
911: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
912: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
913: END IF;
914:
915: fnd_msg_pub.count_and_get(
916: p_encoded => fnd_api.g_false
917: ,p_count => x_msg_count
918: ,p_data => x_msg_data);
919:
985: EXCEPTION
986: WHEN OTHERS THEN
987: rollback;
988: x_return_status := fnd_api.g_ret_sts_unexp_error;
989: IF fnd_msg_pub.check_msg_level(
990: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
991: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
992: END IF;
993:
986: WHEN OTHERS THEN
987: rollback;
988: x_return_status := fnd_api.g_ret_sts_unexp_error;
989: IF fnd_msg_pub.check_msg_level(
990: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
991: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
992: END IF;
993:
994: fnd_msg_pub.count_and_get(
987: rollback;
988: x_return_status := fnd_api.g_ret_sts_unexp_error;
989: IF fnd_msg_pub.check_msg_level(
990: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
991: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
992: END IF;
993:
994: fnd_msg_pub.count_and_get(
995: p_count => x_msg_count
990: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
991: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
992: END IF;
993:
994: fnd_msg_pub.count_and_get(
995: p_count => x_msg_count
996: ,p_data => x_msg_data);
997:
998: END verify_org;
1600:
1601: l_stmt_num := 30;
1602: -- Initialize message list if p_init_msg_list is set to TRUE.
1603: IF fnd_api.to_boolean(p_init_msg_list) THEN
1604: fnd_msg_pub.initialize;
1605: END IF;
1606:
1607: l_stmt_num := 40;
1608: -- Initialize API return status to success
2035: END IF;
2036:
2037: l_stmt_num := 999;
2038: -- Standard call to get message count and if count is 1, get message info.
2039: fnd_msg_pub.count_and_get(
2040: p_encoded => fnd_api.g_false
2041: ,p_count => x_msg_count
2042: ,p_data => x_msg_data);
2043:
2044: EXCEPTION
2045: WHEN fnd_api.g_exc_error THEN
2046: ROLLBACK TO get_work_order_count_pvt;
2047: x_return_status := fnd_api.g_ret_sts_error;
2048: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2049: fnd_msg_pub.count_and_get(
2050: p_encoded => fnd_api.g_false
2051: ,p_count => x_msg_count
2052: ,p_data => x_msg_data);
2045: WHEN fnd_api.g_exc_error THEN
2046: ROLLBACK TO get_work_order_count_pvt;
2047: x_return_status := fnd_api.g_ret_sts_error;
2048: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2049: fnd_msg_pub.count_and_get(
2050: p_encoded => fnd_api.g_false
2051: ,p_count => x_msg_count
2052: ,p_data => x_msg_data);
2053: WHEN fnd_api.g_exc_unexpected_error THEN
2052: ,p_data => x_msg_data);
2053: WHEN fnd_api.g_exc_unexpected_error THEN
2054: ROLLBACK TO get_work_order_count_pvt;
2055: x_return_status := fnd_api.g_ret_sts_unexp_error;
2056: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2057: fnd_msg_pub.count_and_get(
2058: p_encoded => fnd_api.g_false
2059: ,p_count => x_msg_count
2060: ,p_data => x_msg_data);
2053: WHEN fnd_api.g_exc_unexpected_error THEN
2054: ROLLBACK TO get_work_order_count_pvt;
2055: x_return_status := fnd_api.g_ret_sts_unexp_error;
2056: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2057: fnd_msg_pub.count_and_get(
2058: p_encoded => fnd_api.g_false
2059: ,p_count => x_msg_count
2060: ,p_data => x_msg_data);
2061: WHEN OTHERS THEN
2060: ,p_data => x_msg_data);
2061: WHEN OTHERS THEN
2062: ROLLBACK TO get_work_order_count_pvt;
2063: x_return_status := fnd_api.g_ret_sts_unexp_error;
2064: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2065: IF fnd_msg_pub.check_msg_level(
2066: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2067: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2068: END IF;
2061: WHEN OTHERS THEN
2062: ROLLBACK TO get_work_order_count_pvt;
2063: x_return_status := fnd_api.g_ret_sts_unexp_error;
2064: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2065: IF fnd_msg_pub.check_msg_level(
2066: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2067: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2068: END IF;
2069:
2062: ROLLBACK TO get_work_order_count_pvt;
2063: x_return_status := fnd_api.g_ret_sts_unexp_error;
2064: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2065: IF fnd_msg_pub.check_msg_level(
2066: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2067: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2068: END IF;
2069:
2070: fnd_msg_pub.count_and_get(
2063: x_return_status := fnd_api.g_ret_sts_unexp_error;
2064: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2065: IF fnd_msg_pub.check_msg_level(
2066: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2067: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2068: END IF;
2069:
2070: fnd_msg_pub.count_and_get(
2071: p_encoded => fnd_api.g_false
2066: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2067: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2068: END IF;
2069:
2070: fnd_msg_pub.count_and_get(
2071: p_encoded => fnd_api.g_false
2072: ,p_count => x_msg_count
2073: ,p_data => x_msg_data);
2074:
2168:
2169: l_stmt_num := 30;
2170: -- Initialize message list if p_init_msg_list is set to TRUE.
2171: IF fnd_api.to_boolean(p_init_msg_list) THEN
2172: fnd_msg_pub.initialize;
2173: END IF;
2174:
2175: l_stmt_num := 40;
2176: -- Initialize API return status to success
2273: END IF;
2274:
2275: l_stmt_num := 999;
2276: -- Standard call to get message count and if count is 1, get message info.
2277: fnd_msg_pub.count_and_get(
2278: p_encoded => fnd_api.g_false
2279: ,p_count => x_msg_count
2280: ,p_data => x_msg_data);
2281:
2282: EXCEPTION
2283: WHEN fnd_api.g_exc_error THEN
2284: ROLLBACK TO insert_into_wori_pvt;
2285: x_return_status := fnd_api.g_ret_sts_error;
2286: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2287: fnd_msg_pub.count_and_get(
2288: p_encoded => fnd_api.g_false
2289: ,p_count => x_msg_count
2290: ,p_data => x_msg_data);
2283: WHEN fnd_api.g_exc_error THEN
2284: ROLLBACK TO insert_into_wori_pvt;
2285: x_return_status := fnd_api.g_ret_sts_error;
2286: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2287: fnd_msg_pub.count_and_get(
2288: p_encoded => fnd_api.g_false
2289: ,p_count => x_msg_count
2290: ,p_data => x_msg_data);
2291: WHEN fnd_api.g_exc_unexpected_error THEN
2290: ,p_data => x_msg_data);
2291: WHEN fnd_api.g_exc_unexpected_error THEN
2292: ROLLBACK TO insert_into_wori_pvt;
2293: x_return_status := fnd_api.g_ret_sts_unexp_error;
2294: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2295: fnd_msg_pub.count_and_get(
2296: p_encoded => fnd_api.g_false
2297: ,p_count => x_msg_count
2298: ,p_data => x_msg_data);
2291: WHEN fnd_api.g_exc_unexpected_error THEN
2292: ROLLBACK TO insert_into_wori_pvt;
2293: x_return_status := fnd_api.g_ret_sts_unexp_error;
2294: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2295: fnd_msg_pub.count_and_get(
2296: p_encoded => fnd_api.g_false
2297: ,p_count => x_msg_count
2298: ,p_data => x_msg_data);
2299: WHEN OTHERS THEN
2298: ,p_data => x_msg_data);
2299: WHEN OTHERS THEN
2300: ROLLBACK TO insert_into_wori_pvt;
2301: x_return_status := fnd_api.g_ret_sts_unexp_error;
2302: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2303: IF fnd_msg_pub.check_msg_level(
2304: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2305: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2306: END IF;
2299: WHEN OTHERS THEN
2300: ROLLBACK TO insert_into_wori_pvt;
2301: x_return_status := fnd_api.g_ret_sts_unexp_error;
2302: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2303: IF fnd_msg_pub.check_msg_level(
2304: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2305: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2306: END IF;
2307:
2300: ROLLBACK TO insert_into_wori_pvt;
2301: x_return_status := fnd_api.g_ret_sts_unexp_error;
2302: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2303: IF fnd_msg_pub.check_msg_level(
2304: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2305: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2306: END IF;
2307:
2308: fnd_msg_pub.count_and_get(
2301: x_return_status := fnd_api.g_ret_sts_unexp_error;
2302: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name, SQLERRM);
2303: IF fnd_msg_pub.check_msg_level(
2304: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2305: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2306: END IF;
2307:
2308: fnd_msg_pub.count_and_get(
2309: p_encoded => fnd_api.g_false
2304: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2305: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2306: END IF;
2307:
2308: fnd_msg_pub.count_and_get(
2309: p_encoded => fnd_api.g_false
2310: ,p_count => x_msg_count
2311: ,p_data => x_msg_data);
2312:
2414:
2415: l_stmt_num := 30;
2416: -- Initialize message list if p_init_msg_list is set to TRUE.
2417: IF fnd_api.to_boolean(p_init_msg_list) THEN
2418: fnd_msg_pub.initialize;
2419: END IF;
2420:
2421: l_stmt_num := 40;
2422: -- Initialize API return status to success
2474: end;
2475:
2476: if (l_hr_exists = 'Y') then
2477: fnd_message.set_name('EAM','EAM_HIERARCHY_EXISTS');
2478: fnd_msg_pub.add;
2479: RAISE fnd_api.g_exc_error;
2480: end if;
2481:
2482: -- ROUTES CHECK
2499:
2500:
2501: if (nvl(l_routes_exists,'N') = 'Y') then
2502: fnd_message.set_name('EAM','EAM_ROUTE_EXISTS');
2503: fnd_msg_pub.add;
2504: RAISE fnd_api.g_exc_error;
2505: end if;
2506:
2507: -- WORK REQUEST AND WORK ORDER CHECK
2529: end;
2530:
2531: if (nvl(l_wo_exists,'N') = 'Y') then
2532: fnd_message.set_name('EAM','EAM_WO_EXISTS');
2533: fnd_msg_pub.add;
2534: RAISE fnd_api.g_exc_error;
2535: end if;
2536:
2537: -- check open Service Reqests
2554: end;
2555:
2556: if (nvl(l_sr_exists,'N') = 'Y') then
2557: fnd_message.set_name('EAM','EAM_SR_EXISTS');
2558: fnd_msg_pub.add;
2559: RAISE fnd_api.g_exc_error;
2560: end if;
2561: eam_asset_number_pvt.update_asset(
2562: P_API_VERSION => 1.0
2574: EXCEPTION
2575: WHEN fnd_api.g_exc_error THEN
2576: ROLLBACK TO asset_util_pvt;
2577: x_return_status := fnd_api.g_ret_sts_error;
2578: fnd_msg_pub.count_and_get(
2579: p_encoded => fnd_api.g_false
2580: ,p_count => x_msg_count
2581: ,p_data => x_msg_data);
2582: WHEN fnd_api.g_exc_unexpected_error THEN
2581: ,p_data => x_msg_data);
2582: WHEN fnd_api.g_exc_unexpected_error THEN
2583: ROLLBACK TO asset_util_pvt;
2584: x_return_status := fnd_api.g_ret_sts_unexp_error;
2585: fnd_msg_pub.count_and_get(
2586: p_encoded => fnd_api.g_false
2587: ,p_count => x_msg_count
2588: ,p_data => x_msg_data);
2589:
2590: WHEN OTHERS THEN
2591: ROLLBACK TO asset_util_pvt;
2592: x_return_status := fnd_api.g_ret_sts_unexp_error;
2593:
2594: IF fnd_msg_pub.check_msg_level(
2595: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2596: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name||'('||l_stmt_num||')');
2597: END IF;
2598:
2591: ROLLBACK TO asset_util_pvt;
2592: x_return_status := fnd_api.g_ret_sts_unexp_error;
2593:
2594: IF fnd_msg_pub.check_msg_level(
2595: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2596: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name||'('||l_stmt_num||')');
2597: END IF;
2598:
2599: fnd_msg_pub.count_and_get(
2592: x_return_status := fnd_api.g_ret_sts_unexp_error;
2593:
2594: IF fnd_msg_pub.check_msg_level(
2595: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2596: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name||'('||l_stmt_num||')');
2597: END IF;
2598:
2599: fnd_msg_pub.count_and_get(
2600: p_encoded => fnd_api.g_false
2595: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2596: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name||'('||l_stmt_num||')');
2597: END IF;
2598:
2599: fnd_msg_pub.count_and_get(
2600: p_encoded => fnd_api.g_false
2601: ,p_count => x_msg_count
2602: ,p_data => x_msg_data);
2603:
2630: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, p_module,
2631: 'Last Message = ' || REPLACE(p_msg_data, CHR(0), ' ')); --null p_msg_data is OK
2632: end if;
2633: end if;
2634: FND_MSG_PUB.Count_And_Get('T', l_msg_count_1, l_msg_data_1);
2635: if ((l_msg_count_1 is not null) and (l_msg_count_1 > 0) and
2636: ((p_msg_count is null) or (l_msg_count_1 <> p_msg_count))) then
2637: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
2638: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, p_module,
2638: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, p_module,
2639: 'Message Count (from message Stack)= ' || l_msg_count_1);
2640: end if;
2641: end if;
2642: l_msg_data_1 := fnd_msg_pub.get(fnd_msg_pub.G_FIRST, FND_API.G_FALSE); --set encoded to true
2643: if (l_msg_count_1 is not null and l_msg_count_1 > 0) then
2644: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
2645: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, p_module,
2646: 'Message #1 (from message stack) =' || l_msg_data_1);
2645: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, p_module,
2646: 'Message #1 (from message stack) =' || l_msg_data_1);
2647: end if;
2648: for i in 2..l_msg_count_1 LOOP
2649: l_msg_data_1 := fnd_msg_pub.get(fnd_msg_pub.G_NEXT, FND_API.G_FALSE); --set encoded to true
2650: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
2651: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, p_module,
2652: 'Message #' || to_char(i) || ' (from message stack) =' || l_msg_data_1);
2653: end if;
2845: END IF;
2846:
2847: -- Initialize message list if p_init_msg_list is set to TRUE.
2848: IF fnd_api.to_boolean(p_init_msg_list) THEN
2849: fnd_msg_pub.initialize;
2850: END IF;
2851:
2852: -- Initialize API return status to success
2853: l_stmt_num := 10;
2869:
2870: EXCEPTION
2871:
2872: WHEN NO_DATA_FOUND THEN
2873: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
2874: THEN
2875: FND_MSG_PUB.add_exc_msg
2876: ( 'EAM_COMMON_UTILITIES_PVT'
2877: , '.Create_Asset : Statement -'||to_char(l_stmt_num)
2871:
2872: WHEN NO_DATA_FOUND THEN
2873: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
2874: THEN
2875: FND_MSG_PUB.add_exc_msg
2876: ( 'EAM_COMMON_UTILITIES_PVT'
2877: , '.Create_Asset : Statement -'||to_char(l_stmt_num)
2878: );
2879: END IF;
2929:
2930: EXCEPTION
2931:
2932: WHEN NO_DATA_FOUND THEN
2933: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2934: FND_MSG_PUB.add_exc_msg
2935: ( 'EAM_COMMON_UTILITIES_PVT'
2936: , '.Create_Asset : Statement -'||to_char(l_stmt_num)
2937: );
2930: EXCEPTION
2931:
2932: WHEN NO_DATA_FOUND THEN
2933: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2934: FND_MSG_PUB.add_exc_msg
2935: ( 'EAM_COMMON_UTILITIES_PVT'
2936: , '.Create_Asset : Statement -'||to_char(l_stmt_num)
2937: );
2938: END IF;
2957: COMMIT WORK;
2958: END IF;
2959:
2960: -- Standard call to get message count and if count is 1, get message info.
2961: fnd_msg_pub.count_and_get(
2962: p_count => x_msg_count
2963: ,p_data => x_msg_data);
2964:
2965:
2966: EXCEPTION
2967: WHEN fnd_api.g_exc_error THEN
2968: ROLLBACK TO create_asset;
2969: x_return_status := fnd_api.g_ret_sts_error;
2970: fnd_msg_pub.count_and_get(
2971: p_count => x_msg_count
2972: ,p_data => x_msg_data);
2973: WHEN fnd_api.g_exc_unexpected_error THEN
2974: ROLLBACK TO create_asset;
2972: ,p_data => x_msg_data);
2973: WHEN fnd_api.g_exc_unexpected_error THEN
2974: ROLLBACK TO create_asset;
2975: x_return_status := fnd_api.g_ret_sts_unexp_error;
2976: fnd_msg_pub.count_and_get(
2977: p_count => x_msg_count
2978: ,p_data => x_msg_data);
2979: WHEN OTHERS THEN
2980: ROLLBACK TO create_asset;
2979: WHEN OTHERS THEN
2980: ROLLBACK TO create_asset;
2981: x_return_status := fnd_api.g_ret_sts_unexp_error;
2982:
2983: IF fnd_msg_pub.check_msg_level(
2984: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2985: fnd_msg_pub.add_exc_msg(G_PKG_NAME, l_api_name);
2986: END IF;
2987:
2980: ROLLBACK TO create_asset;
2981: x_return_status := fnd_api.g_ret_sts_unexp_error;
2982:
2983: IF fnd_msg_pub.check_msg_level(
2984: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2985: fnd_msg_pub.add_exc_msg(G_PKG_NAME, l_api_name);
2986: END IF;
2987:
2988: fnd_msg_pub.count_and_get(
2981: x_return_status := fnd_api.g_ret_sts_unexp_error;
2982:
2983: IF fnd_msg_pub.check_msg_level(
2984: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2985: fnd_msg_pub.add_exc_msg(G_PKG_NAME, l_api_name);
2986: END IF;
2987:
2988: fnd_msg_pub.count_and_get(
2989: p_count => x_msg_count
2984: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2985: fnd_msg_pub.add_exc_msg(G_PKG_NAME, l_api_name);
2986: END IF;
2987:
2988: fnd_msg_pub.count_and_get(
2989: p_count => x_msg_count
2990: ,p_data => x_msg_data);
2991:
2992: end create_asset;
3052: end;
3053:
3054: if (l_hr_exists = 'Y') then
3055: fnd_message.set_name('EAM','EAM_HIERARCHY_EXISTS');
3056: fnd_msg_pub.add;
3057: l_result := false;
3058:
3059: end if;
3060: end if;
3078:
3079:
3080: if (l_routes_exists = 'Y') then
3081: fnd_message.set_name('EAM','EAM_ROUTE_EXISTS');
3082: fnd_msg_pub.add;
3083: l_result := false;
3084: end if;
3085:
3086: -- WORK REQUEST AND WORK ORDER CHECK
3107: end;
3108:
3109: if (l_wo_exists = 'Y') then
3110: fnd_message.set_name('EAM','EAM_WO_EXISTS');
3111: fnd_msg_pub.add;
3112: l_result := false;
3113: end if;
3114:
3115: -- ROUTES CHECK: Route assets cannot be de-activated
3125: end;
3126:
3127: if (l_network_asset_flag = 'Y') then
3128: fnd_message.set_name('EAM','EAM_ROUTE_DEACTIVATE');
3129: fnd_msg_pub.add;
3130: l_result := false;
3131: end if;
3132:
3133: return l_result;
3350: END IF;
3351:
3352: -- Initialize message list if p_init_msg_list is set to TRUE.
3353: IF fnd_api.to_boolean(p_init_msg_list) THEN
3354: fnd_msg_pub.initialize;
3355: END IF;
3356:
3357: -- Initialize API return status to success
3358: l_stmt_num := 10;
3409:
3410: EXCEPTION
3411:
3412: WHEN NO_DATA_FOUND THEN
3413: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
3414: THEN
3415: FND_MSG_PUB.add_exc_msg
3416: ( 'EAM_COMMON_UTILITIES_PVT'
3417: , '.Adjust_WORU : Statement -'||to_char(l_stmt_num)
3411:
3412: WHEN NO_DATA_FOUND THEN
3413: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
3414: THEN
3415: FND_MSG_PUB.add_exc_msg
3416: ( 'EAM_COMMON_UTILITIES_PVT'
3417: , '.Adjust_WORU : Statement -'||to_char(l_stmt_num)
3418: );
3419: END IF;
3554: COMMIT WORK;
3555: END IF;
3556:
3557: -- Standard call to get message count and if count is 1, get message info.
3558: fnd_msg_pub.count_and_get(
3559: p_count => x_msg_count
3560: ,p_data => x_msg_data);
3561:
3562:
3563: EXCEPTION
3564: WHEN SHRINK_WITH_ASSIGNMENTS THEN
3565: rollback to adjust_woru;
3566: x_return_status := fnd_api.g_ret_sts_error;
3567: fnd_msg_pub.count_and_get(
3568: p_count => x_msg_count
3569: ,p_data => x_msg_data);
3570:
3571: WHEN fnd_api.g_exc_error THEN
3570:
3571: WHEN fnd_api.g_exc_error THEN
3572: ROLLBACK TO adjust_woru;
3573: x_return_status := fnd_api.g_ret_sts_error;
3574: fnd_msg_pub.count_and_get(
3575: p_count => x_msg_count
3576: ,p_data => x_msg_data);
3577: WHEN fnd_api.g_exc_unexpected_error THEN
3578: ROLLBACK TO adjust_woru;
3576: ,p_data => x_msg_data);
3577: WHEN fnd_api.g_exc_unexpected_error THEN
3578: ROLLBACK TO adjust_woru;
3579: x_return_status := fnd_api.g_ret_sts_unexp_error;
3580: fnd_msg_pub.count_and_get(
3581: p_count => x_msg_count
3582: ,p_data => x_msg_data);
3583: WHEN OTHERS THEN
3584: ROLLBACK TO adjust_woru;
3583: WHEN OTHERS THEN
3584: ROLLBACK TO adjust_woru;
3585: x_return_status := fnd_api.g_ret_sts_unexp_error;
3586:
3587: IF fnd_msg_pub.check_msg_level(
3588: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3589: fnd_msg_pub.add_exc_msg(G_PKG_NAME, l_api_name);
3590: END IF;
3591:
3584: ROLLBACK TO adjust_woru;
3585: x_return_status := fnd_api.g_ret_sts_unexp_error;
3586:
3587: IF fnd_msg_pub.check_msg_level(
3588: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3589: fnd_msg_pub.add_exc_msg(G_PKG_NAME, l_api_name);
3590: END IF;
3591:
3592: fnd_msg_pub.count_and_get(
3585: x_return_status := fnd_api.g_ret_sts_unexp_error;
3586:
3587: IF fnd_msg_pub.check_msg_level(
3588: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3589: fnd_msg_pub.add_exc_msg(G_PKG_NAME, l_api_name);
3590: END IF;
3591:
3592: fnd_msg_pub.count_and_get(
3593: p_count => x_msg_count
3588: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3589: fnd_msg_pub.add_exc_msg(G_PKG_NAME, l_api_name);
3590: END IF;
3591:
3592: fnd_msg_pub.count_and_get(
3593: p_count => x_msg_count
3594: ,p_data => x_msg_data);
3595:
3596: end adjust_woru;