63: begin
64: if (p_import_mode = 0) then
65: return (p_id is null);
66: else --it must be update mode (1)
67: return (p_id = FND_API.G_MISS_NUM);
68: end if;
69: end skip;
70:
71: -- checks whether this code (a char only field) is to be skipped (in either mode)
76: begin
77: if (p_import_mode = 0) then
78: return (p_code is null);
79: else --it must be update mode (1)
80: return (p_code = FND_API.G_MISS_CHAR);
81: end if;
82: end skip;
83:
84: -- checks whether this id/code combination field is to be skipped (in update mode)
91: begin
92: if (p_import_mode = 0) then
93: l_skip_update := ((p_id is null) and (p_code is null));
94: else --it must be update mode (1)
95: l_skip_update := (((p_id is not null) and (p_id = FND_API.G_MISS_NUM)) OR
96: ((p_id is null) and (p_code is not null) and (p_code = FND_API.G_MISS_CHAR)));
97: --if id null, set to g_miss_num so that update (looks only at ids) works
98: if (l_skip_update) then
99: p_id := FND_API.G_MISS_NUM;
92: if (p_import_mode = 0) then
93: l_skip_update := ((p_id is null) and (p_code is null));
94: else --it must be update mode (1)
95: l_skip_update := (((p_id is not null) and (p_id = FND_API.G_MISS_NUM)) OR
96: ((p_id is null) and (p_code is not null) and (p_code = FND_API.G_MISS_CHAR)));
97: --if id null, set to g_miss_num so that update (looks only at ids) works
98: if (l_skip_update) then
99: p_id := FND_API.G_MISS_NUM;
100: end if;
95: l_skip_update := (((p_id is not null) and (p_id = FND_API.G_MISS_NUM)) OR
96: ((p_id is null) and (p_code is not null) and (p_code = FND_API.G_MISS_CHAR)));
97: --if id null, set to g_miss_num so that update (looks only at ids) works
98: if (l_skip_update) then
99: p_id := FND_API.G_MISS_NUM;
100: end if;
101: end if;
102: return l_skip_update;
103: end skip;
395: x_return_status => l_return_status,
396: x_msg_count => l_msg_count,
397: x_msg_data => l_msg_data);
398:
399: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
400: RAISE fnd_api.g_exc_error;
401: end if;
402:
403: elsif (l_pn_gen_mode = 1) then
396: x_msg_count => l_msg_count,
397: x_msg_data => l_msg_data);
398:
399: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
400: RAISE fnd_api.g_exc_error;
401: end if;
402:
403: elsif (l_pn_gen_mode = 1) then
404: inv_genealogy_pub.update_genealogy(
413: x_return_status => l_return_status,
414: x_msg_count => l_msg_count,
415: x_msg_data => l_msg_data);
416:
417: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
418: RAISE fnd_api.g_exc_error;
419: end if;
420: END IF;
421:
414: x_msg_count => l_msg_count,
415: x_msg_data => l_msg_data);
416:
417: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
418: RAISE fnd_api.g_exc_error;
419: end if;
420: END IF;
421:
422: end if;
423: end if;
424: end if;
425:
426: EXCEPTION
427: WHEN fnd_api.g_exc_error THEN
428: ROLLBACK TO pn_eam_genealogy;
429: x_return_status := fnd_api.g_ret_sts_error;
430: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
431: WHEN fnd_api.g_exc_unexpected_error THEN
425:
426: EXCEPTION
427: WHEN fnd_api.g_exc_error THEN
428: ROLLBACK TO pn_eam_genealogy;
429: x_return_status := fnd_api.g_ret_sts_error;
430: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
431: WHEN fnd_api.g_exc_unexpected_error THEN
432: ROLLBACK TO pn_eam_genealogy;
433: x_return_status := fnd_api.g_ret_sts_unexp_error;
427: WHEN fnd_api.g_exc_error THEN
428: ROLLBACK TO pn_eam_genealogy;
429: x_return_status := fnd_api.g_ret_sts_error;
430: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
431: WHEN fnd_api.g_exc_unexpected_error THEN
432: ROLLBACK TO pn_eam_genealogy;
433: x_return_status := fnd_api.g_ret_sts_unexp_error;
434: fnd_msg_pub.count_and_get(
435: p_count => x_msg_count
429: x_return_status := fnd_api.g_ret_sts_error;
430: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
431: WHEN fnd_api.g_exc_unexpected_error THEN
432: ROLLBACK TO pn_eam_genealogy;
433: x_return_status := fnd_api.g_ret_sts_unexp_error;
434: fnd_msg_pub.count_and_get(
435: p_count => x_msg_count
436: ,p_data => x_msg_data);
437: WHEN OTHERS THEN
435: p_count => x_msg_count
436: ,p_data => x_msg_data);
437: WHEN OTHERS THEN
438: ROLLBACK TO pn_eam_genealogy;
439: x_return_status := fnd_api.g_ret_sts_unexp_error;
440:
441: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
442:
443: end pn_genealogy_change;
473: l_application_id CONSTANT NUMBER := 401;
474: l_application_code CONSTANT VARCHAR2(3) := 'INV';
475: l_number1 NUMBER;
476: l_varchar2000 VARCHAR2(2000);
477: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
478: l_count NUMBER;
479: l_data VARCHAR2(240);
480: l_object_id NUMBER;
481: l_msg_data varchar2(2000);
736: p_checkin_status => asset_rec.checkin_status,
737: p_supplier_warranty_exp_date => asset_rec.supplier_warranty_exp_date
738: );
739:
740: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
741: l_error_code := 150;
742:
743: l_error_message := 'Asset insertion failed with return status: '
744: || l_return_status || ' and message: ' || l_data;
791: 'Now updating asset with ROWID: ' || l_serial_rowid || '...');
792: end if;
793:
794: -- 2002-01-16: chrng: Fixed bug 2185999.
795: -- If asset_criticality_id is FND_API.G_MISS_NUM,
796: -- then asset_criticality_code should be FND_API.G_MISS_CHAR
797: IF asset_rec.asset_criticality_id = FND_API.G_MISS_NUM
798: THEN
799: l_asset_criticality_code := FND_API.G_MISS_CHAR;
792: end if;
793:
794: -- 2002-01-16: chrng: Fixed bug 2185999.
795: -- If asset_criticality_id is FND_API.G_MISS_NUM,
796: -- then asset_criticality_code should be FND_API.G_MISS_CHAR
797: IF asset_rec.asset_criticality_id = FND_API.G_MISS_NUM
798: THEN
799: l_asset_criticality_code := FND_API.G_MISS_CHAR;
800: ELSE
793:
794: -- 2002-01-16: chrng: Fixed bug 2185999.
795: -- If asset_criticality_id is FND_API.G_MISS_NUM,
796: -- then asset_criticality_code should be FND_API.G_MISS_CHAR
797: IF asset_rec.asset_criticality_id = FND_API.G_MISS_NUM
798: THEN
799: l_asset_criticality_code := FND_API.G_MISS_CHAR;
800: ELSE
801: l_asset_criticality_code := TO_CHAR(asset_rec.asset_criticality_id);
795: -- If asset_criticality_id is FND_API.G_MISS_NUM,
796: -- then asset_criticality_code should be FND_API.G_MISS_CHAR
797: IF asset_rec.asset_criticality_id = FND_API.G_MISS_NUM
798: THEN
799: l_asset_criticality_code := FND_API.G_MISS_CHAR;
800: ELSE
801: l_asset_criticality_code := TO_CHAR(asset_rec.asset_criticality_id);
802: END IF;
803:
859: p_supplier_warranty_exp_date => asset_rec.supplier_warranty_exp_date
860: );
861:
862:
863: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
864: l_error_code := 160;
865: l_error_message := 'Asset update failed with return status: '
866: || l_return_status || ' and message: ' || l_data;
867:
900: x_return_status => l_return_status,
901: x_msg_count => l_count,
902: x_msg_data => l_data
903: );
904: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
905: l_error_code := 300;
906:
907: -- 2002-01-11: chrng: The following message is long and it causes an error.
908: