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;
401: x_return_status => l_return_status,
402: x_msg_count => l_msg_count,
403: x_msg_data => l_msg_data);
404:
405: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
406: RAISE fnd_api.g_exc_error;
407: end if;
408:
409: elsif (l_pn_gen_mode = 1) then
402: x_msg_count => l_msg_count,
403: x_msg_data => l_msg_data);
404:
405: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
406: RAISE fnd_api.g_exc_error;
407: end if;
408:
409: elsif (l_pn_gen_mode = 1) then
410: inv_genealogy_pub.update_genealogy(
419: x_return_status => l_return_status,
420: x_msg_count => l_msg_count,
421: x_msg_data => l_msg_data);
422:
423: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
424: RAISE fnd_api.g_exc_error;
425: end if;
426: END IF;
427:
420: x_msg_count => l_msg_count,
421: x_msg_data => l_msg_data);
422:
423: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
424: RAISE fnd_api.g_exc_error;
425: end if;
426: END IF;
427:
428: end if;
429: end if;
430: end if;
431:
432: EXCEPTION
433: WHEN fnd_api.g_exc_error THEN
434: ROLLBACK TO pn_eam_genealogy;
435: x_return_status := fnd_api.g_ret_sts_error;
436: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
437: WHEN fnd_api.g_exc_unexpected_error THEN
431:
432: EXCEPTION
433: WHEN fnd_api.g_exc_error THEN
434: ROLLBACK TO pn_eam_genealogy;
435: x_return_status := fnd_api.g_ret_sts_error;
436: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
437: WHEN fnd_api.g_exc_unexpected_error THEN
438: ROLLBACK TO pn_eam_genealogy;
439: x_return_status := fnd_api.g_ret_sts_unexp_error;
433: WHEN fnd_api.g_exc_error THEN
434: ROLLBACK TO pn_eam_genealogy;
435: x_return_status := fnd_api.g_ret_sts_error;
436: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
437: WHEN fnd_api.g_exc_unexpected_error THEN
438: ROLLBACK TO pn_eam_genealogy;
439: x_return_status := fnd_api.g_ret_sts_unexp_error;
440: fnd_msg_pub.count_and_get(
441: p_count => x_msg_count
435: x_return_status := fnd_api.g_ret_sts_error;
436: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
437: WHEN fnd_api.g_exc_unexpected_error THEN
438: ROLLBACK TO pn_eam_genealogy;
439: x_return_status := fnd_api.g_ret_sts_unexp_error;
440: fnd_msg_pub.count_and_get(
441: p_count => x_msg_count
442: ,p_data => x_msg_data);
443: WHEN OTHERS THEN
441: p_count => x_msg_count
442: ,p_data => x_msg_data);
443: WHEN OTHERS THEN
444: ROLLBACK TO pn_eam_genealogy;
445: x_return_status := fnd_api.g_ret_sts_unexp_error;
446:
447: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
448:
449: end pn_genealogy_change;
479: l_application_id CONSTANT NUMBER := 401;
480: l_application_code CONSTANT VARCHAR2(3) := 'INV';
481: l_number1 NUMBER;
482: l_varchar2000 VARCHAR2(2000);
483: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
484: l_count NUMBER;
485: l_data VARCHAR2(240);
486: l_object_id NUMBER;
487: l_msg_data varchar2(2000);
751: p_checkin_status => asset_rec.checkin_status,
752: p_supplier_warranty_exp_date => asset_rec.supplier_warranty_exp_date
753: );
754:
755: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
756: l_error_code := 150;
757:
758: l_error_message := 'Asset insertion failed with return status: '
759: || l_return_status || ' and message: ' || l_data;
806: 'Now updating asset with ROWID: ' || l_serial_rowid || '...');
807: end if;
808:
809: -- 2002-01-16: chrng: Fixed bug 2185999.
810: -- If asset_criticality_id is FND_API.G_MISS_NUM,
811: -- then asset_criticality_code should be FND_API.G_MISS_CHAR
812: IF asset_rec.asset_criticality_id = FND_API.G_MISS_NUM
813: THEN
814: l_asset_criticality_code := FND_API.G_MISS_CHAR;
807: end if;
808:
809: -- 2002-01-16: chrng: Fixed bug 2185999.
810: -- If asset_criticality_id is FND_API.G_MISS_NUM,
811: -- then asset_criticality_code should be FND_API.G_MISS_CHAR
812: IF asset_rec.asset_criticality_id = FND_API.G_MISS_NUM
813: THEN
814: l_asset_criticality_code := FND_API.G_MISS_CHAR;
815: ELSE
808:
809: -- 2002-01-16: chrng: Fixed bug 2185999.
810: -- If asset_criticality_id is FND_API.G_MISS_NUM,
811: -- then asset_criticality_code should be FND_API.G_MISS_CHAR
812: IF asset_rec.asset_criticality_id = FND_API.G_MISS_NUM
813: THEN
814: l_asset_criticality_code := FND_API.G_MISS_CHAR;
815: ELSE
816: l_asset_criticality_code := TO_CHAR(asset_rec.asset_criticality_id);
810: -- If asset_criticality_id is FND_API.G_MISS_NUM,
811: -- then asset_criticality_code should be FND_API.G_MISS_CHAR
812: IF asset_rec.asset_criticality_id = FND_API.G_MISS_NUM
813: THEN
814: l_asset_criticality_code := FND_API.G_MISS_CHAR;
815: ELSE
816: l_asset_criticality_code := TO_CHAR(asset_rec.asset_criticality_id);
817: END IF;
818:
874: p_supplier_warranty_exp_date => asset_rec.supplier_warranty_exp_date
875: );
876:
877:
878: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
879: l_error_code := 160;
880: l_error_message := 'Asset update failed with return status: '
881: || l_return_status || ' and message: ' || l_data;
882:
915: x_return_status => l_return_status,
916: x_msg_count => l_count,
917: x_msg_data => l_data
918: );
919: IF NOT l_return_status = fnd_api.g_ret_sts_success THEN
920: l_error_code := 300;
921:
922: -- 2002-01-11: chrng: The following message is long and it causes an error.
923: