51: BEGIN
52: -- Standard begin of API savepoint
53: SAVEPOINT Validate_trans_PVT;
54: -- Standard call to check for call compatibility.
55: IF NOT FND_API.Compatible_API_Call (
56: l_api_version,
57: p_api_version,
58: l_api_name,
59: G_PKG_NAME)
57: p_api_version,
58: l_api_name,
59: G_PKG_NAME)
60: THEN
61: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
62: END IF;
63:
64: --Initialize message list if p_init_msg_list is TRUE.
65: IF FND_API.To_Boolean (p_init_msg_list) THEN
61: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
62: END IF;
63:
64: --Initialize message list if p_init_msg_list is TRUE.
65: IF FND_API.To_Boolean (p_init_msg_list) THEN
66: FND_MSG_PUB.initialize;
67: END IF;
68:
69: -- Debug Message
71: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
72: END IF;
73:
74: -- Initialize API return status to sucess
75: x_return_status := FND_API.G_RET_STS_SUCCESS;
76:
77: If p_transaction.source_code = 'OM' THEN
78: IF OZF_DEBUG_LOW_ON THEN
79: ozf_utility_PVT.debug_message('IN OM:' );
90: p_transaction.bill_to_site_use_id is NULL OR
91: p_transaction.ship_to_site_use_id is NULL THEN
92:
93: ozf_utility_PVT.error_message('OZF_TRANS_BILLTO_NULL');
94: RAISE FND_API.g_exc_unexpected_error;
95: END IF;
96:
97: IF p_transaction.header_id is NULL OR
98: p_transaction.line_id is NULL THEN
97: IF p_transaction.header_id is NULL OR
98: p_transaction.line_id is NULL THEN
99:
100: ozf_utility_PVT.error_message('OZF_TRANS_ORDER_REF_NULL');
101: RAISE FND_API.g_exc_unexpected_error;
102: END IF;
103:
104: ELSIF p_transaction.source_code = 'IS' THEN
105: IF OZF_DEBUG_LOW_ON THEN
111:
112: IF p_transaction.sold_from_party_id is null THEN
113:
114: ozf_utility_PVT.error_message('OZF_TRANS_SOLDFROM_NULL');
115: RAISE FND_API.g_exc_unexpected_error;
116: END IF;
117:
118: IF p_transaction.header_id is NULL OR
119: p_transaction.line_id is NULL THEN
118: IF p_transaction.header_id is NULL OR
119: p_transaction.line_id is NULL THEN
120:
121: ozf_utility_PVT.error_message('OZF_TRANS_ORDER_REF_NULL');
122: RAISE FND_API.g_exc_unexpected_error;
123: END IF;
124:
125: ELSIF p_transaction.source_code = 'MA' THEN
126: IF OZF_DEBUG_LOW_ON THEN
129: END IF;
130:
131: IF p_transaction.sold_to_party_id is null THEN
132: OZF_UTILITY_PVT.error_message('OZF_TRANS_SOLD_TO_PTY_NULL');
133: RAISE FND_API.g_exc_unexpected_error;
134: END IF;
135: ELSE
136: OZF_UTILITY_PVT.error_message('OZF_TRANS_SOURCE_CD_WRG');
137: RAISE FND_API.g_exc_unexpected_error;
133: RAISE FND_API.g_exc_unexpected_error;
134: END IF;
135: ELSE
136: OZF_UTILITY_PVT.error_message('OZF_TRANS_SOURCE_CD_WRG');
137: RAISE FND_API.g_exc_unexpected_error;
138: END IF;
139:
140: -- Debug Message
141: IF OZF_DEBUG_LOW_ON THEN
142: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
143: END IF;
144: --Standard call to get message count and if count=1, get the message
145: FND_MSG_PUB.Count_And_Get (
146: p_encoded => FND_API.G_FALSE,
147: p_count => x_msg_count,
148: p_data => x_msg_data
149: );
150: EXCEPTION
147: p_count => x_msg_count,
148: p_data => x_msg_data
149: );
150: EXCEPTION
151: WHEN FND_API.G_EXC_ERROR THEN
152: ROLLBACK TO Validate_trans_PVT;
153: x_return_status := FND_API.G_RET_STS_ERROR;
154: -- Standard call to get message count and if count=1, get the message
155: FND_MSG_PUB.Count_And_Get (
149: );
150: EXCEPTION
151: WHEN FND_API.G_EXC_ERROR THEN
152: ROLLBACK TO Validate_trans_PVT;
153: x_return_status := FND_API.G_RET_STS_ERROR;
154: -- Standard call to get message count and if count=1, get the message
155: FND_MSG_PUB.Count_And_Get (
156: p_encoded => FND_API.G_FALSE,
157: p_count => x_msg_count,
152: ROLLBACK TO Validate_trans_PVT;
153: x_return_status := FND_API.G_RET_STS_ERROR;
154: -- Standard call to get message count and if count=1, get the message
155: FND_MSG_PUB.Count_And_Get (
156: p_encoded => FND_API.G_FALSE,
157: p_count => x_msg_count,
158: p_data => x_msg_data
159: );
160: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
156: p_encoded => FND_API.G_FALSE,
157: p_count => x_msg_count,
158: p_data => x_msg_data
159: );
160: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
161: ROLLBACK TO Validate_trans_PVT;
162: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
163: -- Standard call to get message count and if count=1, get the message
164: FND_MSG_PUB.Count_And_Get (
158: p_data => x_msg_data
159: );
160: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
161: ROLLBACK TO Validate_trans_PVT;
162: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
163: -- Standard call to get message count and if count=1, get the message
164: FND_MSG_PUB.Count_And_Get (
165: p_encoded => FND_API.G_FALSE,
166: p_count => x_msg_count,
161: ROLLBACK TO Validate_trans_PVT;
162: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
163: -- Standard call to get message count and if count=1, get the message
164: FND_MSG_PUB.Count_And_Get (
165: p_encoded => FND_API.G_FALSE,
166: p_count => x_msg_count,
167: p_data => x_msg_data
168: );
169: WHEN OTHERS THEN
167: p_data => x_msg_data
168: );
169: WHEN OTHERS THEN
170: ROLLBACK TO Validate_trans_PVT;
171: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
172: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
173: THEN
174: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
175: END IF;
174: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
175: END IF;
176: -- Standard call to get message count and if count=1, get the message
177: FND_MSG_PUB.Count_And_Get (
178: p_encoded => FND_API.G_FALSE,
179: p_count => x_msg_count,
180: p_data => x_msg_data
181: );
182: END Validate_Transaction;
240: SELECT exchange_rate_type
241: FROM ozf_sys_parameters_all
242: WHERE org_id = p_org_id;
243:
244: l_exchange_rate_type VARCHAR2(30) := FND_API.G_MISS_CHAR;
245: l_rate NUMBER;
246: l_vol_offr_apply_discount NUMBER;
247: l_sales_trans NUMBER;
248: BEGIN
248: BEGIN
249: -- Standard begin of API savepoint
250: SAVEPOINT CREATE_TRANSACTION;
251: -- Standard call to check for call compatibility.
252: IF NOT FND_API.Compatible_API_Call (
253: l_api_version,
254: p_api_version,
255: l_api_name,
256: G_PKG_NAME)
254: p_api_version,
255: l_api_name,
256: G_PKG_NAME)
257: THEN
258: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
259: END IF;
260:
261: --Initialize message list if p_init_msg_list is TRUE.
262: IF FND_API.To_Boolean (p_init_msg_list) THEN
258: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
259: END IF;
260:
261: --Initialize message list if p_init_msg_list is TRUE.
262: IF FND_API.To_Boolean (p_init_msg_list) THEN
263: FND_MSG_PUB.initialize;
264: END IF;
265:
266: -- Debug Message
268: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
269: END IF;
270:
271: -- Initialize API return status to sucess
272: x_return_status := FND_API.G_RET_STS_SUCCESS;
273:
274: IF OZF_DEBUG_LOW_ON THEN
275: OZF_UTILITY_PVT.debug_message('inventory_item_id:' ||l_transaction_rec.inventory_item_id);
276: OZF_UTILITY_PVT.debug_message('transaction_date:' ||l_transaction_rec.transaction_date);
283: l_transaction_rec.quantity is null OR
284: l_transaction_rec.uom_code is null THEN
285:
286: OZF_UTILITY_PVT.error_message('OZF_SALES_TRANS_MISS');
287: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
288: END IF;
289:
290: -- Validate the record
291: Validate_Transaction (
289:
290: -- Validate the record
291: Validate_Transaction (
292: p_api_version => 1.0
293: ,p_init_msg_list => FND_API.G_FALSE
294: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
295: ,x_return_status => l_return_status
296: ,x_msg_count => l_msg_count
297: ,x_msg_data => l_msg_data
290: -- Validate the record
291: Validate_Transaction (
292: p_api_version => 1.0
293: ,p_init_msg_list => FND_API.G_FALSE
294: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
295: ,x_return_status => l_return_status
296: ,x_msg_count => l_msg_count
297: ,x_msg_data => l_msg_data
298: ,p_transaction => l_transaction_rec
296: ,x_msg_count => l_msg_count
297: ,x_msg_data => l_msg_data
298: ,p_transaction => l_transaction_rec
299: );
300: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
301: RAISE FND_API.G_EXC_ERROR;
302: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
303: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
304: END IF;
297: ,x_msg_data => l_msg_data
298: ,p_transaction => l_transaction_rec
299: );
300: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
301: RAISE FND_API.G_EXC_ERROR;
302: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
303: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
304: END IF;
305:
298: ,p_transaction => l_transaction_rec
299: );
300: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
301: RAISE FND_API.G_EXC_ERROR;
302: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
303: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
304: END IF;
305:
306: -- Default transfer_type if necessary
299: );
300: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
301: RAISE FND_API.G_EXC_ERROR;
302: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
303: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
304: END IF;
305:
306: -- Default transfer_type if necessary
307: IF l_transaction_rec.transfer_type IS NULL THEN
563:
564:
565: IF l_transaction_rec.SOURCE_CODE = 'OM' THEN
566: OZF_VOLUME_CALCULATION_PUB.Create_Volume(
567: p_init_msg_list => FND_API.g_false
568: ,p_api_version => 1.0
569: ,p_commit => FND_API.g_false
570: ,x_return_status => l_return_status
571: ,x_msg_count => l_msg_count
565: IF l_transaction_rec.SOURCE_CODE = 'OM' THEN
566: OZF_VOLUME_CALCULATION_PUB.Create_Volume(
567: p_init_msg_list => FND_API.g_false
568: ,p_api_version => 1.0
569: ,p_commit => FND_API.g_false
570: ,x_return_status => l_return_status
571: ,x_msg_count => l_msg_count
572: ,x_msg_data => l_msg_data
573: ,p_volume_detail_rec => l_transaction_rec
573: ,p_volume_detail_rec => l_transaction_rec
574: ,p_qp_list_header_id => l_transaction_rec.qp_list_header_id
575: ,x_apply_discount => l_vol_offr_apply_discount
576: );
577: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
578: RAISE FND_API.G_EXC_ERROR;
579: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
580: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
581: END IF;
574: ,p_qp_list_header_id => l_transaction_rec.qp_list_header_id
575: ,x_apply_discount => l_vol_offr_apply_discount
576: );
577: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
578: RAISE FND_API.G_EXC_ERROR;
579: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
580: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
581: END IF;
582: END IF;
575: ,x_apply_discount => l_vol_offr_apply_discount
576: );
577: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
578: RAISE FND_API.G_EXC_ERROR;
579: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
580: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
581: END IF;
582: END IF;
583:
576: );
577: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
578: RAISE FND_API.G_EXC_ERROR;
579: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
580: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
581: END IF;
582: END IF;
583:
584:
587: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
588: END IF;
589: --Standard call to get message count and if count=1, get the message
590: FND_MSG_PUB.Count_And_Get (
591: p_encoded => FND_API.G_FALSE,
592: p_count => x_msg_count,
593: p_data => x_msg_data
594: );
595: x_return_status := l_return_status;
593: p_data => x_msg_data
594: );
595: x_return_status := l_return_status;
596: EXCEPTION
597: WHEN FND_API.G_EXC_ERROR THEN
598: ROLLBACK TO CREATE_TRANSACTION;
599: x_return_status := FND_API.G_RET_STS_ERROR;
600: -- Standard call to get message count and if count=1, get the message
601: FND_MSG_PUB.Count_And_Get (
595: x_return_status := l_return_status;
596: EXCEPTION
597: WHEN FND_API.G_EXC_ERROR THEN
598: ROLLBACK TO CREATE_TRANSACTION;
599: x_return_status := FND_API.G_RET_STS_ERROR;
600: -- Standard call to get message count and if count=1, get the message
601: FND_MSG_PUB.Count_And_Get (
602: p_encoded => FND_API.G_FALSE,
603: p_count => x_msg_count,
598: ROLLBACK TO CREATE_TRANSACTION;
599: x_return_status := FND_API.G_RET_STS_ERROR;
600: -- Standard call to get message count and if count=1, get the message
601: FND_MSG_PUB.Count_And_Get (
602: p_encoded => FND_API.G_FALSE,
603: p_count => x_msg_count,
604: p_data => x_msg_data
605: );
606: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
602: p_encoded => FND_API.G_FALSE,
603: p_count => x_msg_count,
604: p_data => x_msg_data
605: );
606: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
607: ROLLBACK TO CREATE_TRANSACTION;
608: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
609:
610: -- Standard call to get message count and if count=1, get the message
604: p_data => x_msg_data
605: );
606: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
607: ROLLBACK TO CREATE_TRANSACTION;
608: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
609:
610: -- Standard call to get message count and if count=1, get the message
611: FND_MSG_PUB.Count_And_Get (
612: p_encoded => FND_API.G_FALSE,
608: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
609:
610: -- Standard call to get message count and if count=1, get the message
611: FND_MSG_PUB.Count_And_Get (
612: p_encoded => FND_API.G_FALSE,
613: p_count => x_msg_count,
614: p_data => x_msg_data
615: );
616: WHEN OTHERS THEN
614: p_data => x_msg_data
615: );
616: WHEN OTHERS THEN
617: ROLLBACK TO CREATE_TRANSACTION;
618: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
619:
620: -- Standard call to get message count and if count=1, get the message
621: FND_MSG_PUB.Count_And_Get (
622: p_encoded => FND_API.G_FALSE,
618: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
619:
620: -- Standard call to get message count and if count=1, get the message
621: FND_MSG_PUB.Count_And_Get (
622: p_encoded => FND_API.G_FALSE,
623: p_count => x_msg_count,
624: p_data => x_msg_data
625: );
626: END create_transaction;
668: BEGIN
669: -- Standard begin of API savepoint
670: SAVEPOINT INIT_INVEN_TMP;
671: -- Standard call to check for call compatibility.
672: IF NOT FND_API.Compatible_API_Call (
673: l_api_version,
674: p_api_version,
675: l_api_name,
676: G_PKG_NAME)
674: p_api_version,
675: l_api_name,
676: G_PKG_NAME)
677: THEN
678: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
679: END IF;
680:
681: --Initialize message list if p_init_msg_list is TRUE.
682: IF FND_API.To_Boolean (p_init_msg_list) THEN
678: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
679: END IF;
680:
681: --Initialize message list if p_init_msg_list is TRUE.
682: IF FND_API.To_Boolean (p_init_msg_list) THEN
683: FND_MSG_PUB.initialize;
684: END IF;
685:
686: -- Debug Message
688: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
689: END IF;
690:
691: -- Initialize API return status to sucess
692: x_return_status := FND_API.G_RET_STS_SUCCESS;
693:
694:
695:
696: -- Force refresh snapshot before the query
919: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
920: END IF;
921: --Standard call to get message count and if count=1, get the message
922: FND_MSG_PUB.Count_And_Get (
923: p_encoded => FND_API.G_FALSE,
924: p_count => x_msg_count,
925: p_data => x_msg_data
926: );
927: x_return_status := l_return_status;
925: p_data => x_msg_data
926: );
927: x_return_status := l_return_status;
928: EXCEPTION
929: WHEN FND_API.G_EXC_ERROR THEN
930: ROLLBACK TO INIT_INVEN_TMP;
931: x_return_status := FND_API.G_RET_STS_ERROR;
932: -- Standard call to get message count and if count=1, get the message
933: FND_MSG_PUB.Count_And_Get (
927: x_return_status := l_return_status;
928: EXCEPTION
929: WHEN FND_API.G_EXC_ERROR THEN
930: ROLLBACK TO INIT_INVEN_TMP;
931: x_return_status := FND_API.G_RET_STS_ERROR;
932: -- Standard call to get message count and if count=1, get the message
933: FND_MSG_PUB.Count_And_Get (
934: p_encoded => FND_API.G_FALSE,
935: p_count => x_msg_count,
930: ROLLBACK TO INIT_INVEN_TMP;
931: x_return_status := FND_API.G_RET_STS_ERROR;
932: -- Standard call to get message count and if count=1, get the message
933: FND_MSG_PUB.Count_And_Get (
934: p_encoded => FND_API.G_FALSE,
935: p_count => x_msg_count,
936: p_data => x_msg_data
937: );
938: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
934: p_encoded => FND_API.G_FALSE,
935: p_count => x_msg_count,
936: p_data => x_msg_data
937: );
938: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
939: ROLLBACK TO INIT_INVEN_TMP;
940: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
941:
942: -- Standard call to get message count and if count=1, get the message
936: p_data => x_msg_data
937: );
938: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
939: ROLLBACK TO INIT_INVEN_TMP;
940: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
941:
942: -- Standard call to get message count and if count=1, get the message
943: FND_MSG_PUB.Count_And_Get (
944: p_encoded => FND_API.G_FALSE,
940: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
941:
942: -- Standard call to get message count and if count=1, get the message
943: FND_MSG_PUB.Count_And_Get (
944: p_encoded => FND_API.G_FALSE,
945: p_count => x_msg_count,
946: p_data => x_msg_data
947: );
948: WHEN OTHERS THEN
946: p_data => x_msg_data
947: );
948: WHEN OTHERS THEN
949: ROLLBACK TO INIT_INVEN_TMP;
950: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
951:
952: -- Standard call to get message count and if count=1, get the message
953: FND_MSG_PUB.Count_And_Get (
954: p_encoded => FND_API.G_FALSE,
950: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
951:
952: -- Standard call to get message count and if count=1, get the message
953: FND_MSG_PUB.Count_And_Get (
954: p_encoded => FND_API.G_FALSE,
955: p_count => x_msg_count,
956: p_data => x_msg_data
957: );
958: END Initiate_Inventory_Tmp;
998: BEGIN
999: -- Standard begin of API savepoint
1000: SAVEPOINT UPD_INVEN_TMP;
1001: -- Standard call to check for call compatibility.
1002: IF NOT FND_API.Compatible_API_Call (
1003: l_api_version,
1004: p_api_version,
1005: l_api_name,
1006: G_PKG_NAME)
1004: p_api_version,
1005: l_api_name,
1006: G_PKG_NAME)
1007: THEN
1008: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1009: END IF;
1010:
1011: --Initialize message list if p_init_msg_list is TRUE.
1012: IF FND_API.To_Boolean (p_init_msg_list) THEN
1008: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1009: END IF;
1010:
1011: --Initialize message list if p_init_msg_list is TRUE.
1012: IF FND_API.To_Boolean (p_init_msg_list) THEN
1013: FND_MSG_PUB.initialize;
1014: END IF;
1015:
1016: -- Debug Message
1018: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
1019: END IF;
1020:
1021: -- Initialize API return status to sucess
1022: x_return_status := FND_API.G_RET_STS_SUCCESS;
1023:
1024: OPEN transaction_info_csr (p_sales_transaction_id);
1025: FETCH transaction_info_csr into l_primary_quantity, l_inventory_item_id, l_party_id;
1026: CLOSE transaction_info_csr;
1041: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
1042: END IF;
1043: --Standard call to get message count and if count=1, get the message
1044: FND_MSG_PUB.Count_And_Get (
1045: p_encoded => FND_API.G_FALSE,
1046: p_count => x_msg_count,
1047: p_data => x_msg_data
1048: );
1049: x_return_status := l_return_status;
1047: p_data => x_msg_data
1048: );
1049: x_return_status := l_return_status;
1050: EXCEPTION
1051: WHEN FND_API.G_EXC_ERROR THEN
1052: ROLLBACK TO UPD_INVEN_TMP;
1053: x_return_status := FND_API.G_RET_STS_ERROR;
1054: -- Standard call to get message count and if count=1, get the message
1055: FND_MSG_PUB.Count_And_Get (
1049: x_return_status := l_return_status;
1050: EXCEPTION
1051: WHEN FND_API.G_EXC_ERROR THEN
1052: ROLLBACK TO UPD_INVEN_TMP;
1053: x_return_status := FND_API.G_RET_STS_ERROR;
1054: -- Standard call to get message count and if count=1, get the message
1055: FND_MSG_PUB.Count_And_Get (
1056: p_encoded => FND_API.G_FALSE,
1057: p_count => x_msg_count,
1052: ROLLBACK TO UPD_INVEN_TMP;
1053: x_return_status := FND_API.G_RET_STS_ERROR;
1054: -- Standard call to get message count and if count=1, get the message
1055: FND_MSG_PUB.Count_And_Get (
1056: p_encoded => FND_API.G_FALSE,
1057: p_count => x_msg_count,
1058: p_data => x_msg_data
1059: );
1060: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1056: p_encoded => FND_API.G_FALSE,
1057: p_count => x_msg_count,
1058: p_data => x_msg_data
1059: );
1060: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1061: ROLLBACK TO UPD_INVEN_TMP;
1062: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1063:
1064: -- Standard call to get message count and if count=1, get the message
1058: p_data => x_msg_data
1059: );
1060: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1061: ROLLBACK TO UPD_INVEN_TMP;
1062: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1063:
1064: -- Standard call to get message count and if count=1, get the message
1065: FND_MSG_PUB.Count_And_Get (
1066: p_encoded => FND_API.G_FALSE,
1062: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1063:
1064: -- Standard call to get message count and if count=1, get the message
1065: FND_MSG_PUB.Count_And_Get (
1066: p_encoded => FND_API.G_FALSE,
1067: p_count => x_msg_count,
1068: p_data => x_msg_data
1069: );
1070: WHEN OTHERS THEN
1068: p_data => x_msg_data
1069: );
1070: WHEN OTHERS THEN
1071: ROLLBACK TO UPD_INVEN_TMP;
1072: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1073:
1074: -- Standard call to get message count and if count=1, get the message
1075: FND_MSG_PUB.Count_And_Get (
1076: p_encoded => FND_API.G_FALSE,
1072: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1073:
1074: -- Standard call to get message count and if count=1, get the message
1075: FND_MSG_PUB.Count_And_Get (
1076: p_encoded => FND_API.G_FALSE,
1077: p_count => x_msg_count,
1078: p_data => x_msg_data
1079: );
1080: END update_inventory_tmp;
1163: BEGIN
1164: -- Standard begin of API savepoint
1165: SAVEPOINT VALID_INV_LVL;
1166: -- Standard call to check for call compatibility.
1167: IF NOT FND_API.Compatible_API_Call (
1168: l_api_version,
1169: p_api_version,
1170: l_api_name,
1171: G_PKG_NAME) THEN
1168: l_api_version,
1169: p_api_version,
1170: l_api_name,
1171: G_PKG_NAME) THEN
1172: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1173: END IF;
1174:
1175: --Initialize message list if p_init_msg_list is TRUE.
1176: IF FND_API.To_Boolean (p_init_msg_list) THEN
1172: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1173: END IF;
1174:
1175: --Initialize message list if p_init_msg_list is TRUE.
1176: IF FND_API.To_Boolean (p_init_msg_list) THEN
1177: FND_MSG_PUB.initialize;
1178: END IF;
1179:
1180: -- Debug Message
1182: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
1183: END IF;
1184:
1185: -- Initialize API return status to sucess
1186: x_return_status := FND_API.G_RET_STS_SUCCESS;
1187:
1188: x_valid := false;
1189:
1190: -- Bug 4380203 (+)
1320: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
1321: END IF;
1322: --Standard call to get message count and if count=1, get the message
1323: FND_MSG_PUB.Count_And_Get (
1324: p_encoded => FND_API.G_FALSE,
1325: p_count => x_msg_count,
1326: p_data => x_msg_data
1327: );
1328: x_return_status := l_return_status;
1327: );
1328: x_return_status := l_return_status;
1329:
1330: EXCEPTION
1331: WHEN FND_API.G_EXC_ERROR THEN
1332: ROLLBACK TO VALID_INV_LVL;
1333: x_return_status := FND_API.G_RET_STS_ERROR;
1334: -- Standard call to get message count and if count=1, get the message
1335: FND_MSG_PUB.Count_And_Get (
1329:
1330: EXCEPTION
1331: WHEN FND_API.G_EXC_ERROR THEN
1332: ROLLBACK TO VALID_INV_LVL;
1333: x_return_status := FND_API.G_RET_STS_ERROR;
1334: -- Standard call to get message count and if count=1, get the message
1335: FND_MSG_PUB.Count_And_Get (
1336: p_encoded => FND_API.G_FALSE,
1337: p_count => x_msg_count,
1332: ROLLBACK TO VALID_INV_LVL;
1333: x_return_status := FND_API.G_RET_STS_ERROR;
1334: -- Standard call to get message count and if count=1, get the message
1335: FND_MSG_PUB.Count_And_Get (
1336: p_encoded => FND_API.G_FALSE,
1337: p_count => x_msg_count,
1338: p_data => x_msg_data
1339: );
1340: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1336: p_encoded => FND_API.G_FALSE,
1337: p_count => x_msg_count,
1338: p_data => x_msg_data
1339: );
1340: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1341: ROLLBACK TO VALID_INV_LVL;
1342: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1343:
1344: -- Standard call to get message count and if count=1, get the message
1338: p_data => x_msg_data
1339: );
1340: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1341: ROLLBACK TO VALID_INV_LVL;
1342: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1343:
1344: -- Standard call to get message count and if count=1, get the message
1345: FND_MSG_PUB.Count_And_Get (
1346: p_encoded => FND_API.G_FALSE,
1342: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1343:
1344: -- Standard call to get message count and if count=1, get the message
1345: FND_MSG_PUB.Count_And_Get (
1346: p_encoded => FND_API.G_FALSE,
1347: p_count => x_msg_count,
1348: p_data => x_msg_data
1349: );
1350: WHEN OTHERS THEN
1348: p_data => x_msg_data
1349: );
1350: WHEN OTHERS THEN
1351: ROLLBACK TO VALID_INV_LVL;
1352: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1353:
1354: -- Standard call to get message count and if count=1, get the message
1355: FND_MSG_PUB.Count_And_Get (
1356: p_encoded => FND_API.G_FALSE,
1352: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1353:
1354: -- Standard call to get message count and if count=1, get the message
1355: FND_MSG_PUB.Count_And_Get (
1356: p_encoded => FND_API.G_FALSE,
1357: p_count => x_msg_count,
1358: p_data => x_msg_data
1359: );
1360: END Validate_Inventory_Level;
1440: BEGIN
1441: -- Standard begin of API savepoint
1442: SAVEPOINT GET_WAC;
1443: -- Standard call to check for call compatibility.
1444: IF NOT FND_API.Compatible_API_Call (
1445: l_api_version,
1446: p_api_version,
1447: l_api_name,
1448: G_PKG_NAME)
1446: p_api_version,
1447: l_api_name,
1448: G_PKG_NAME)
1449: THEN
1450: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1451: END IF;
1452:
1453: --Initialize message list if p_init_msg_list is TRUE.
1454: IF FND_API.To_Boolean (p_init_msg_list) THEN
1450: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1451: END IF;
1452:
1453: --Initialize message list if p_init_msg_list is TRUE.
1454: IF FND_API.To_Boolean (p_init_msg_list) THEN
1455: FND_MSG_PUB.initialize;
1456: END IF;
1457:
1458: -- Debug Message
1460: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
1461: END IF;
1462:
1463: -- Initialize API return status to sucess
1464: x_return_status := FND_API.G_RET_STS_SUCCESS;
1465:
1466: OPEN Sales_Order_info_csr(p_order_date,
1467: p_inventory_item_id,
1468: p_sold_from_cust_account_id);
1526: ,p_from_amount => l_unit_price_tbl(i)
1527: ,x_return_status => l_return_status
1528: ,x_to_amount => l_used_unit_price_tbl(i)
1529: ,x_rate => l_rate);
1530: IF l_return_status = FND_API.g_ret_sts_error THEN
1531: RAISE FND_API.g_exc_error;
1532: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1533: RAISE FND_API.g_exc_unexpected_error;
1534: END IF;
1527: ,x_return_status => l_return_status
1528: ,x_to_amount => l_used_unit_price_tbl(i)
1529: ,x_rate => l_rate);
1530: IF l_return_status = FND_API.g_ret_sts_error THEN
1531: RAISE FND_API.g_exc_error;
1532: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1533: RAISE FND_API.g_exc_unexpected_error;
1534: END IF;
1535: END IF;
1528: ,x_to_amount => l_used_unit_price_tbl(i)
1529: ,x_rate => l_rate);
1530: IF l_return_status = FND_API.g_ret_sts_error THEN
1531: RAISE FND_API.g_exc_error;
1532: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1533: RAISE FND_API.g_exc_unexpected_error;
1534: END IF;
1535: END IF;
1536: END IF;
1529: ,x_rate => l_rate);
1530: IF l_return_status = FND_API.g_ret_sts_error THEN
1531: RAISE FND_API.g_exc_error;
1532: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1533: RAISE FND_API.g_exc_unexpected_error;
1534: END IF;
1535: END IF;
1536: END IF;
1537: END LOOP;
1579: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
1580: END IF;
1581: --Standard call to get message count and if count=1, get the message
1582: FND_MSG_PUB.Count_And_Get (
1583: p_encoded => FND_API.G_FALSE,
1584: p_count => x_msg_count,
1585: p_data => x_msg_data
1586: );
1587: x_return_status := l_return_status;
1586: );
1587: x_return_status := l_return_status;
1588:
1589: EXCEPTION
1590: WHEN FND_API.G_EXC_ERROR THEN
1591: ROLLBACK TO GET_WAC;
1592: x_return_status := FND_API.G_RET_STS_ERROR;
1593: -- Standard call to get message count and if count=1, get the message
1594: FND_MSG_PUB.Count_And_Get (
1588:
1589: EXCEPTION
1590: WHEN FND_API.G_EXC_ERROR THEN
1591: ROLLBACK TO GET_WAC;
1592: x_return_status := FND_API.G_RET_STS_ERROR;
1593: -- Standard call to get message count and if count=1, get the message
1594: FND_MSG_PUB.Count_And_Get (
1595: p_encoded => FND_API.G_FALSE,
1596: p_count => x_msg_count,
1591: ROLLBACK TO GET_WAC;
1592: x_return_status := FND_API.G_RET_STS_ERROR;
1593: -- Standard call to get message count and if count=1, get the message
1594: FND_MSG_PUB.Count_And_Get (
1595: p_encoded => FND_API.G_FALSE,
1596: p_count => x_msg_count,
1597: p_data => x_msg_data
1598: );
1599: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1595: p_encoded => FND_API.G_FALSE,
1596: p_count => x_msg_count,
1597: p_data => x_msg_data
1598: );
1599: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1600: ROLLBACK TO GET_WAC;
1601: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1602:
1603: -- Standard call to get message count and if count=1, get the message
1597: p_data => x_msg_data
1598: );
1599: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1600: ROLLBACK TO GET_WAC;
1601: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1602:
1603: -- Standard call to get message count and if count=1, get the message
1604: FND_MSG_PUB.Count_And_Get (
1605: p_encoded => FND_API.G_FALSE,
1601: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1602:
1603: -- Standard call to get message count and if count=1, get the message
1604: FND_MSG_PUB.Count_And_Get (
1605: p_encoded => FND_API.G_FALSE,
1606: p_count => x_msg_count,
1607: p_data => x_msg_data
1608: );
1609: WHEN OTHERS THEN
1607: p_data => x_msg_data
1608: );
1609: WHEN OTHERS THEN
1610: ROLLBACK TO GET_WAC;
1611: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1612:
1613: -- Standard call to get message count and if count=1, get the message
1614: FND_MSG_PUB.Count_And_Get (
1615: p_encoded => FND_API.G_FALSE,
1611: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1612:
1613: -- Standard call to get message count and if count=1, get the message
1614: FND_MSG_PUB.Count_And_Get (
1615: p_encoded => FND_API.G_FALSE,
1616: p_count => x_msg_count,
1617: p_data => x_msg_data
1618: );
1619: END Get_Purchase_Price;