7: -- Pre-reqs : None.
8: -- Parameters :
9: -- IN P_API_VERSION IN NUMBER REQUIRED
10: -- P_INIT_MSG_LIST IN VARCHAR2 OPTIONAL
11: -- DEFAULT = FND_API.G_FALSE
12: -- P_COMMIT IN VARCHAR2 OPTIONAL
13: -- DEFAULT = FND_API.G_FALSE
14: -- P_VALIDATION_LEVEL IN NUMBER OPTIONAL
15: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL
9: -- IN P_API_VERSION IN NUMBER REQUIRED
10: -- P_INIT_MSG_LIST IN VARCHAR2 OPTIONAL
11: -- DEFAULT = FND_API.G_FALSE
12: -- P_COMMIT IN VARCHAR2 OPTIONAL
13: -- DEFAULT = FND_API.G_FALSE
14: -- P_VALIDATION_LEVEL IN NUMBER OPTIONAL
15: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL
16: -- P_ROWID IN OUT VARCHAR2 REQUIRED
17: -- P_ACTIVITY_ASSOCIATION_ID IN OUT NUMBER REQUIRED
11: -- DEFAULT = FND_API.G_FALSE
12: -- P_COMMIT IN VARCHAR2 OPTIONAL
13: -- DEFAULT = FND_API.G_FALSE
14: -- P_VALIDATION_LEVEL IN NUMBER OPTIONAL
15: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL
16: -- P_ROWID IN OUT VARCHAR2 REQUIRED
17: -- P_ACTIVITY_ASSOCIATION_ID IN OUT NUMBER REQUIRED
18: -- P_ORGANIZATION_ID IN NUMBER REQUIRED
19: -- P_ASSET_ACTIVITY_ID IN NUMBER REQUIRED
65: FUNCTION to_fnd_std_num(p_value NUMBER)
66: RETURN NUMBER IS
67: BEGIN
68: IF (p_value IS NULL) THEN
69: RETURN fnd_api.g_miss_num;
70: ELSE
71: RETURN p_value;
72: END IF;
73: END to_fnd_std_num;
75: FUNCTION to_fnd_std_char(p_value VARCHAR2)
76: RETURN VARCHAR2 IS
77: BEGIN
78: IF (p_value IS NULL) THEN
79: RETURN fnd_api.g_miss_char;
80: ELSE
81: RETURN p_value;
82: END IF;
83: END to_fnd_std_char;
83: END to_fnd_std_char;
84:
85: PROCEDURE INSERT_ROW(
86: P_API_VERSION IN NUMBER,
87: P_INIT_MSG_LIST IN VARCHAR2 := FND_API.G_FALSE,
88: P_COMMIT IN VARCHAR2 := FND_API.G_FALSE,
89: P_VALIDATION_LEVEL IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
90: P_ROWID IN OUT NOCOPY VARCHAR2,
91: P_ACTIVITY_ASSOCIATION_ID IN OUT NOCOPY NUMBER,
84:
85: PROCEDURE INSERT_ROW(
86: P_API_VERSION IN NUMBER,
87: P_INIT_MSG_LIST IN VARCHAR2 := FND_API.G_FALSE,
88: P_COMMIT IN VARCHAR2 := FND_API.G_FALSE,
89: P_VALIDATION_LEVEL IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
90: P_ROWID IN OUT NOCOPY VARCHAR2,
91: P_ACTIVITY_ASSOCIATION_ID IN OUT NOCOPY NUMBER,
92: P_ORGANIZATION_ID NUMBER,
85: PROCEDURE INSERT_ROW(
86: P_API_VERSION IN NUMBER,
87: P_INIT_MSG_LIST IN VARCHAR2 := FND_API.G_FALSE,
88: P_COMMIT IN VARCHAR2 := FND_API.G_FALSE,
89: P_VALIDATION_LEVEL IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
90: P_ROWID IN OUT NOCOPY VARCHAR2,
91: P_ACTIVITY_ASSOCIATION_ID IN OUT NOCOPY NUMBER,
92: P_ORGANIZATION_ID NUMBER,
93: P_ASSET_ACTIVITY_ID NUMBER,
154: -- Standard Start of API savepoint
155: SAVEPOINT insert_row;
156:
157: -- Standard call to check for call compatibility.
158: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
159: RAISE fnd_api.g_exc_unexpected_error;
160: END IF;
161:
162: -- Initialize message list if p_init_msg_list is set to TRUE.
155: SAVEPOINT insert_row;
156:
157: -- Standard call to check for call compatibility.
158: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
159: RAISE fnd_api.g_exc_unexpected_error;
160: END IF;
161:
162: -- Initialize message list if p_init_msg_list is set to TRUE.
163: IF fnd_api.to_boolean(p_init_msg_list) THEN
159: RAISE fnd_api.g_exc_unexpected_error;
160: END IF;
161:
162: -- Initialize message list if p_init_msg_list is set to TRUE.
163: IF fnd_api.to_boolean(p_init_msg_list) THEN
164: fnd_msg_pub.initialize;
165: END IF;
166:
167: -- Initialize API return status to success
164: fnd_msg_pub.initialize;
165: END IF;
166:
167: -- Initialize API return status to success
168: x_return_status := fnd_api.g_ret_sts_success;
169:
170: -- API body
171:
172: INSERT INTO MTL_EAM_ASSET_ACTIVITIES(
271: ,x_msg_count => x_msg_count
272: ,x_msg_data => x_msg_data
273: );
274:
275: IF x_return_status <> fnd_api.g_ret_sts_success THEN
276: RAISE fnd_api.g_exc_error;
277: END IF;
278:
279:
272: ,x_msg_data => x_msg_data
273: );
274:
275: IF x_return_status <> fnd_api.g_ret_sts_success THEN
276: RAISE fnd_api.g_exc_error;
277: END IF;
278:
279:
280: OPEN C;
286: CLOSE C;
287:
288: -- End of API body.
289: -- Standard check of p_commit.
290: IF fnd_api.to_boolean(p_commit) THEN
291: COMMIT WORK;
292: END IF;
293:
294: -- Standard call to get message count and if count is 1, get message info.
293:
294: -- Standard call to get message count and if count is 1, get message info.
295: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
296: EXCEPTION
297: WHEN fnd_api.g_exc_error THEN
298: ROLLBACK TO insert_row;
299: x_return_status := fnd_api.g_ret_sts_error;
300: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
301: WHEN fnd_api.g_exc_unexpected_error THEN
295: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
296: EXCEPTION
297: WHEN fnd_api.g_exc_error THEN
298: ROLLBACK TO insert_row;
299: x_return_status := fnd_api.g_ret_sts_error;
300: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
301: WHEN fnd_api.g_exc_unexpected_error THEN
302: ROLLBACK TO insert_row;
303: x_return_status := fnd_api.g_ret_sts_unexp_error;
297: WHEN fnd_api.g_exc_error THEN
298: ROLLBACK TO insert_row;
299: x_return_status := fnd_api.g_ret_sts_error;
300: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
301: WHEN fnd_api.g_exc_unexpected_error THEN
302: ROLLBACK TO insert_row;
303: x_return_status := fnd_api.g_ret_sts_unexp_error;
304: fnd_msg_pub.count_and_get(
305: p_count => x_msg_count
299: x_return_status := fnd_api.g_ret_sts_error;
300: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
301: WHEN fnd_api.g_exc_unexpected_error THEN
302: ROLLBACK TO insert_row;
303: x_return_status := fnd_api.g_ret_sts_unexp_error;
304: fnd_msg_pub.count_and_get(
305: p_count => x_msg_count
306: ,p_data => x_msg_data);
307: WHEN OTHERS THEN
305: p_count => x_msg_count
306: ,p_data => x_msg_data);
307: WHEN OTHERS THEN
308: ROLLBACK TO insert_row;
309: x_return_status := fnd_api.g_ret_sts_unexp_error;
310:
311: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
312: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
313: END IF;
317: END Insert_Row;
318:
319: PROCEDURE LOCK_ROW(
320: P_API_VERSION IN NUMBER,
321: P_INIT_MSG_LIST IN VARCHAR2 := FND_API.G_FALSE,
322: P_COMMIT IN VARCHAR2 := FND_API.G_FALSE,
323: P_VALIDATION_LEVEL IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
324: P_ROWID VARCHAR2,
325: P_ACTIVITY_ASSOCIATION_ID NUMBER,
318:
319: PROCEDURE LOCK_ROW(
320: P_API_VERSION IN NUMBER,
321: P_INIT_MSG_LIST IN VARCHAR2 := FND_API.G_FALSE,
322: P_COMMIT IN VARCHAR2 := FND_API.G_FALSE,
323: P_VALIDATION_LEVEL IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
324: P_ROWID VARCHAR2,
325: P_ACTIVITY_ASSOCIATION_ID NUMBER,
326: P_ORGANIZATION_ID NUMBER,
319: PROCEDURE LOCK_ROW(
320: P_API_VERSION IN NUMBER,
321: P_INIT_MSG_LIST IN VARCHAR2 := FND_API.G_FALSE,
322: P_COMMIT IN VARCHAR2 := FND_API.G_FALSE,
323: P_VALIDATION_LEVEL IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
324: P_ROWID VARCHAR2,
325: P_ACTIVITY_ASSOCIATION_ID NUMBER,
326: P_ORGANIZATION_ID NUMBER,
327: P_ASSET_ACTIVITY_ID NUMBER,
379: -- Standard Start of API savepoint
380: SAVEPOINT lock_row;
381:
382: -- Standard call to check for call compatibility.
383: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
384: RAISE fnd_api.g_exc_unexpected_error;
385: END IF;
386:
387: -- Initialize message list if p_init_msg_list is set to TRUE.
380: SAVEPOINT lock_row;
381:
382: -- Standard call to check for call compatibility.
383: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
384: RAISE fnd_api.g_exc_unexpected_error;
385: END IF;
386:
387: -- Initialize message list if p_init_msg_list is set to TRUE.
388: IF fnd_api.to_boolean(p_init_msg_list) THEN
384: RAISE fnd_api.g_exc_unexpected_error;
385: END IF;
386:
387: -- Initialize message list if p_init_msg_list is set to TRUE.
388: IF fnd_api.to_boolean(p_init_msg_list) THEN
389: fnd_msg_pub.initialize;
390: END IF;
391:
392: -- Initialize API return status to success
389: fnd_msg_pub.initialize;
390: END IF;
391:
392: -- Initialize API return status to success
393: x_return_status := fnd_api.g_ret_sts_success;
394:
395: -- API body
396:
397: OPEN C;
488: end if;
489:
490: -- End of API body.
491: -- Standard check of p_commit.
492: IF fnd_api.to_boolean(p_commit) THEN
493: COMMIT WORK;
494: END IF;
495:
496: -- Standard call to get message count and if count is 1, get message info.
495:
496: -- Standard call to get message count and if count is 1, get message info.
497: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
498: EXCEPTION
499: WHEN fnd_api.g_exc_error THEN
500: ROLLBACK TO lock_row;
501: x_return_status := fnd_api.g_ret_sts_error;
502: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
503: WHEN fnd_api.g_exc_unexpected_error THEN
497: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
498: EXCEPTION
499: WHEN fnd_api.g_exc_error THEN
500: ROLLBACK TO lock_row;
501: x_return_status := fnd_api.g_ret_sts_error;
502: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
503: WHEN fnd_api.g_exc_unexpected_error THEN
504: ROLLBACK TO lock_row;
505: x_return_status := fnd_api.g_ret_sts_unexp_error;
499: WHEN fnd_api.g_exc_error THEN
500: ROLLBACK TO lock_row;
501: x_return_status := fnd_api.g_ret_sts_error;
502: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
503: WHEN fnd_api.g_exc_unexpected_error THEN
504: ROLLBACK TO lock_row;
505: x_return_status := fnd_api.g_ret_sts_unexp_error;
506: fnd_msg_pub.count_and_get(
507: p_count => x_msg_count
501: x_return_status := fnd_api.g_ret_sts_error;
502: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
503: WHEN fnd_api.g_exc_unexpected_error THEN
504: ROLLBACK TO lock_row;
505: x_return_status := fnd_api.g_ret_sts_unexp_error;
506: fnd_msg_pub.count_and_get(
507: p_count => x_msg_count
508: ,p_data => x_msg_data);
509: WHEN OTHERS THEN
507: p_count => x_msg_count
508: ,p_data => x_msg_data);
509: WHEN OTHERS THEN
510: ROLLBACK TO lock_row;
511: x_return_status := fnd_api.g_ret_sts_unexp_error;
512:
513: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
514: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
515: END IF;
519: END Lock_Row;
520:
521: PROCEDURE UPDATE_ROW(
522: P_API_VERSION IN NUMBER,
523: P_INIT_MSG_LIST IN VARCHAR2 := FND_API.G_FALSE,
524: P_COMMIT IN VARCHAR2 := FND_API.G_FALSE,
525: P_VALIDATION_LEVEL IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
526: P_ROWID VARCHAR2,
527: P_ACTIVITY_ASSOCIATION_ID NUMBER,
520:
521: PROCEDURE UPDATE_ROW(
522: P_API_VERSION IN NUMBER,
523: P_INIT_MSG_LIST IN VARCHAR2 := FND_API.G_FALSE,
524: P_COMMIT IN VARCHAR2 := FND_API.G_FALSE,
525: P_VALIDATION_LEVEL IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
526: P_ROWID VARCHAR2,
527: P_ACTIVITY_ASSOCIATION_ID NUMBER,
528: P_ORGANIZATION_ID NUMBER,
521: PROCEDURE UPDATE_ROW(
522: P_API_VERSION IN NUMBER,
523: P_INIT_MSG_LIST IN VARCHAR2 := FND_API.G_FALSE,
524: P_COMMIT IN VARCHAR2 := FND_API.G_FALSE,
525: P_VALIDATION_LEVEL IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
526: P_ROWID VARCHAR2,
527: P_ACTIVITY_ASSOCIATION_ID NUMBER,
528: P_ORGANIZATION_ID NUMBER,
529: P_ASSET_ACTIVITY_ID NUMBER,
587: -- Standard Start of API savepoint
588: SAVEPOINT update_row;
589:
590: -- Standard call to check for call compatibility.
591: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
592: RAISE fnd_api.g_exc_unexpected_error;
593: END IF;
594:
595: -- Initialize message list if p_init_msg_list is set to TRUE.
588: SAVEPOINT update_row;
589:
590: -- Standard call to check for call compatibility.
591: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
592: RAISE fnd_api.g_exc_unexpected_error;
593: END IF;
594:
595: -- Initialize message list if p_init_msg_list is set to TRUE.
596: IF fnd_api.to_boolean(p_init_msg_list) THEN
592: RAISE fnd_api.g_exc_unexpected_error;
593: END IF;
594:
595: -- Initialize message list if p_init_msg_list is set to TRUE.
596: IF fnd_api.to_boolean(p_init_msg_list) THEN
597: fnd_msg_pub.initialize;
598: END IF;
599:
600: -- Initialize API return status to success
597: fnd_msg_pub.initialize;
598: END IF;
599:
600: -- Initialize API return status to success
601: x_return_status := fnd_api.g_ret_sts_success;
602:
603: -- API body
604:
605: UPDATE MTL_EAM_ASSET_ACTIVITIES
668: ,x_msg_count => x_msg_count
669: ,x_msg_data => x_msg_data
670: );
671:
672: IF x_return_status <> fnd_api.g_ret_sts_success THEN
673: RAISE fnd_api.g_exc_error;
674: END IF;
675:
676: /*bug 10381070: when activity association is enddated, if PM exists then update PM last cyclic activity*/
669: ,x_msg_data => x_msg_data
670: );
671:
672: IF x_return_status <> fnd_api.g_ret_sts_success THEN
673: RAISE fnd_api.g_exc_error;
674: END IF;
675:
676: /*bug 10381070: when activity association is enddated, if PM exists then update PM last cyclic activity*/
677: BEGIN
695:
696:
697: -- End of API body.
698: -- Standard check of p_commit.
699: IF fnd_api.to_boolean(p_commit) THEN
700: COMMIT WORK;
701: END IF;
702:
703: -- Standard call to get message count and if count is 1, get message info.
702:
703: -- Standard call to get message count and if count is 1, get message info.
704: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
705: EXCEPTION
706: WHEN fnd_api.g_exc_error THEN
707: ROLLBACK TO update_row;
708: x_return_status := fnd_api.g_ret_sts_error;
709: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
710: WHEN fnd_api.g_exc_unexpected_error THEN
704: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
705: EXCEPTION
706: WHEN fnd_api.g_exc_error THEN
707: ROLLBACK TO update_row;
708: x_return_status := fnd_api.g_ret_sts_error;
709: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
710: WHEN fnd_api.g_exc_unexpected_error THEN
711: ROLLBACK TO update_row;
712: x_return_status := fnd_api.g_ret_sts_unexp_error;
706: WHEN fnd_api.g_exc_error THEN
707: ROLLBACK TO update_row;
708: x_return_status := fnd_api.g_ret_sts_error;
709: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
710: WHEN fnd_api.g_exc_unexpected_error THEN
711: ROLLBACK TO update_row;
712: x_return_status := fnd_api.g_ret_sts_unexp_error;
713: fnd_msg_pub.count_and_get(
714: p_count => x_msg_count
708: x_return_status := fnd_api.g_ret_sts_error;
709: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
710: WHEN fnd_api.g_exc_unexpected_error THEN
711: ROLLBACK TO update_row;
712: x_return_status := fnd_api.g_ret_sts_unexp_error;
713: fnd_msg_pub.count_and_get(
714: p_count => x_msg_count
715: ,p_data => x_msg_data);
716: WHEN OTHERS THEN
714: p_count => x_msg_count
715: ,p_data => x_msg_data);
716: WHEN OTHERS THEN
717: ROLLBACK TO update_row;
718: x_return_status := fnd_api.g_ret_sts_unexp_error;
719:
720: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
721: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
722: END IF;