158: x_obj_version_number OUT NOCOPY NUMBER,
159: x_return_status OUT NOCOPY VARCHAR2)
160: IS
161: BEGIN
162: x_return_status := fnd_api.g_ret_sts_success;
163:
164: api_log('get_ext_attribs');
165:
166: SELECT object_version_number,
178: fnd_message.set_name('CSI','CSI_INT_INV_EXT_ATTR_ID');
179: fnd_message.set_token('INSTANCE_ID',p_instance_id);
180: fnd_message.set_token('ATTRIBUTE_ID',p_attribute_id );
181: fnd_msg_pub.add;
182: x_return_status := fnd_api.g_ret_sts_error;
183: WHEN too_many_rows THEN
184: fnd_message.set_name('CSI','CSI_INT_MANY_ATTR_FOUND');
185: fnd_message.set_token('INSTANCE_ID',p_instance_id);
186: fnd_message.set_token('ATTRIBUTE_ID',p_attribute_id );
184: fnd_message.set_name('CSI','CSI_INT_MANY_ATTR_FOUND');
185: fnd_message.set_token('INSTANCE_ID',p_instance_id);
186: fnd_message.set_token('ATTRIBUTE_ID',p_attribute_id );
187: fnd_msg_pub.add;
188: x_return_status := fnd_api.g_ret_sts_error;
189: END get_ext_attribs;
190:
191: PROCEDURE get_org_assign(
192: p_instance_id IN NUMBER,
196: x_obj_version_number OUT NOCOPY NUMBER,
197: x_return_status OUT NOCOPY VARCHAR2)
198: IS
199: BEGIN
200: x_return_status := fnd_api.g_ret_sts_success;
201: api_log('get_org_assign');
202:
203: SELECT object_version_number,
204: instance_ou_id
216: fnd_message.set_token('INSTANCE_ID',p_instance_id);
217: fnd_message.set_token('OPERATING_UNIT_ID',p_operating_unit_id);
218: fnd_message.set_token('RELATIONSHIP_TYPE_CODE',p_rel_type_code);
219: fnd_msg_pub.add;
220: x_return_status := fnd_api.g_ret_sts_error;
221: WHEN too_many_rows THEN
222: fnd_message.set_name('CSI','CSI_INT_MANY_OU_FOUND');
223: fnd_message.set_token('INSTANCE_PARTY_ID',p_instance_id);
224: fnd_message.set_token('OPERATING_UNIT_ID',p_operating_unit_id);
223: fnd_message.set_token('INSTANCE_PARTY_ID',p_instance_id);
224: fnd_message.set_token('OPERATING_UNIT_ID',p_operating_unit_id);
225: fnd_message.set_token('RELATIONSHIP_TYPE_CODE',p_rel_type_code);
226: fnd_msg_pub.add;
227: x_return_status := fnd_api.g_ret_sts_error;
228: END get_org_assign;
229:
230: PROCEDURE get_party_account(
231: p_instance_pty_id IN NUMBER ,
235: x_return_status OUT NOCOPY VARCHAR2)
236: IS
237: BEGIN
238:
239: x_return_status := fnd_api.g_ret_sts_success;
240: api_log('get_party_account');
241:
242: SELECT object_version_number,
243: ip_account_id
254: fnd_message.set_name('CSI','CSI_INT_INV_ACCT_ID');
255: fnd_message.set_token('INSTANCE_PARTY_ID',p_instance_pty_id);
256: fnd_message.set_token('RELATIONSHIP_TYPE_CODE',p_rel_type_code);
257: fnd_msg_pub.add;
258: x_return_status := fnd_api.g_ret_sts_error;
259: WHEN too_many_rows THEN
260: fnd_message.set_name('CSI','CSI_INT_MANY_ACCT_FOUND');
261: fnd_message.set_token('INSTANCE_PARTY_ID',p_instance_pty_id);
262: fnd_message.set_token('RELATIONSHIP_TYPE_CODE',p_rel_type_code);
260: fnd_message.set_name('CSI','CSI_INT_MANY_ACCT_FOUND');
261: fnd_message.set_token('INSTANCE_PARTY_ID',p_instance_pty_id);
262: fnd_message.set_token('RELATIONSHIP_TYPE_CODE',p_rel_type_code);
263: fnd_msg_pub.add;
264: x_return_status := fnd_api.g_ret_sts_error;
265: END get_party_account;
266:
267: PROCEDURE get_instance_party(
268: p_instance_id IN NUMBER ,
274: BEGIN
275:
276: api_log('get_instance_party');
277:
278: x_return_status := fnd_api.g_ret_sts_success;
279:
280: SELECT object_version_number,
281: instance_party_id
282: INTO x_obj_version_number,
293: fnd_message.set_name('CSI','CSI_INT_INV_INSTA_PTY_ID');
294: fnd_message.set_token('INSTANCE_ID',p_instance_id);
295: fnd_message.set_token('RELATIONSHIP_TYPE_CODE',p_rel_type_code);
296: fnd_msg_pub.add;
297: x_return_status := fnd_api.g_ret_sts_error;
298: WHEN too_many_rows THEN
299: fnd_message.set_name('CSI','CSI_INT_MANY_INSTA_PTY_FOUND');
300: fnd_message.set_token('INSTANCE_ID',p_instance_id);
301: fnd_message.set_token('RELATIONSHIP_TYPE_CODE',p_rel_type_code);
299: fnd_message.set_name('CSI','CSI_INT_MANY_INSTA_PTY_FOUND');
300: fnd_message.set_token('INSTANCE_ID',p_instance_id);
301: fnd_message.set_token('RELATIONSHIP_TYPE_CODE',p_rel_type_code);
302: fnd_msg_pub.add;
303: x_return_status := fnd_api.g_ret_sts_error;
304:
305: END get_instance_party;
306:
307: PROCEDURE get_instance(
311: x_return_status OUT NOCOPY VARCHAR2)
312: IS
313: BEGIN
314:
315: x_return_status := fnd_api.g_ret_sts_success;
316:
317: api_log('get_instance');
318:
319: SELECT object_version_number,
331: WHEN no_data_found THEN
332: fnd_message.set_name('CSI','CSI_INT_INV_INST_ID');
333: fnd_message.set_token('INSTANCE_ID',p_instance_id);
334: fnd_msg_pub.add;
335: x_return_status := fnd_api.g_ret_sts_error;
336: END get_instance;
337:
338: FUNCTION get_ext_obj_ver_num(
339: p_attrib_value_id IN NUMBER)
423: BEGIN
424:
425: api_log('get_dflt_sub_type_id');
426:
427: x_return_status := fnd_api.g_ret_sts_success;
428:
429: SELECT sub_type_id
430: INTO x_sub_type_id
431: FROM csi_source_ib_types
439: WHEN no_data_found THEN
440: fnd_message.set_name('CSI', 'CSI_DFLT_SUB_TYPE_MISSING');
441: fnd_message.set_token('TXN_TYPE_ID', p_transaction_type_id);
442: fnd_msg_pub.add;
443: x_return_status := fnd_api.g_ret_sts_error;
444: WHEN too_many_rows THEN
445: fnd_message.set_name('CSI', 'CSI_MANY_DFLT_SUB_TYPES');
446: fnd_message.set_token('TXN_TYPE_ID', p_transaction_type_id);
447: fnd_msg_pub.add;
444: WHEN too_many_rows THEN
445: fnd_message.set_name('CSI', 'CSI_MANY_DFLT_SUB_TYPES');
446: fnd_message.set_token('TXN_TYPE_ID', p_transaction_type_id);
447: fnd_msg_pub.add;
448: x_return_status := fnd_api.g_ret_sts_error;
449: END get_dflt_sub_type_id;
450:
451: PROCEDURE get_dflt_inst_status_id(
452: x_instance_status_id OUT NOCOPY number,
454: IS
455: l_status_name varchar2(80);
456: BEGIN
457:
458: x_return_status := fnd_api.g_ret_sts_success;
459:
460: l_status_name := fnd_profile.value('CSI_DEFAULT_INSTANCE_STATUS');
461:
462: SELECT instance_status_id
468: WHEN no_data_found THEN
469: fnd_message.set_name('CSI','CSI_API_INVALID_STATUS_ID');
470: fnd_message.set_token('INSTANCE_STATUS', l_status_name);
471: fnd_msg_pub.add;
472: x_return_status := fnd_api.g_ret_sts_error;
473: WHEN too_many_rows THEN
474: fnd_message.set_name('CSI','CSI_API_INVALID_STATUS_ID');
475: fnd_message.set_token('INSTANCE_STATUS', l_status_name);
476: fnd_msg_pub.add;
473: WHEN too_many_rows THEN
474: fnd_message.set_name('CSI','CSI_API_INVALID_STATUS_ID');
475: fnd_message.set_token('INSTANCE_STATUS', l_status_name);
476: fnd_msg_pub.add;
477: x_return_status := fnd_api.g_ret_sts_error;
478: END get_dflt_inst_status_id;
479:
480: FUNCTION get_primay_uom(
481: p_inv_item_id IN NUMBER,
802:
803: l_install_party_site_id NUMBER;
804: BEGIN
805:
806: x_return_status := fnd_api.g_ret_sts_success;
807:
808: api_log('split_ship_rec');
809:
810: l_rem_qty_to_proc := p_proc_qty;
844:
845: x_txn_line_dtl_rec := x_txn_line_detail_rec ;
846:
847: /* assign values for the columns in Txn_line_details_tbl */
848: x_txn_line_dtl_rec.txn_line_detail_id := FND_API.G_MISS_NUM;
849: x_txn_line_dtl_rec.instance_id := l_instance_id;
850: x_txn_line_dtl_rec.instance_exists_flag := 'Y';
851: x_txn_line_dtl_rec.source_transaction_flag := 'Y';
852: x_txn_line_dtl_rec.inventory_item_id := p_order_shipment_rec.inventory_item_id ;
851: x_txn_line_dtl_rec.source_transaction_flag := 'Y';
852: x_txn_line_dtl_rec.inventory_item_id := p_order_shipment_rec.inventory_item_id ;
853: x_txn_line_dtl_rec.inv_organization_id := p_order_shipment_rec.organization_id ;
854: x_txn_line_dtl_rec.inventory_revision := p_order_shipment_rec.revision ;
855: x_txn_line_dtl_rec.item_condition_id := fnd_api.g_miss_num;
856: x_txn_line_dtl_rec.instance_type_code := fnd_api.g_miss_char;
857: x_txn_line_dtl_rec.quantity := l_rem_qty_to_proc;
858: x_txn_line_dtl_rec.unit_of_measure := p_order_shipment_rec.transaction_uom ;
859: x_txn_line_dtl_rec.serial_number := p_order_shipment_rec.serial_number;
852: x_txn_line_dtl_rec.inventory_item_id := p_order_shipment_rec.inventory_item_id ;
853: x_txn_line_dtl_rec.inv_organization_id := p_order_shipment_rec.organization_id ;
854: x_txn_line_dtl_rec.inventory_revision := p_order_shipment_rec.revision ;
855: x_txn_line_dtl_rec.item_condition_id := fnd_api.g_miss_num;
856: x_txn_line_dtl_rec.instance_type_code := fnd_api.g_miss_char;
857: x_txn_line_dtl_rec.quantity := l_rem_qty_to_proc;
858: x_txn_line_dtl_rec.unit_of_measure := p_order_shipment_rec.transaction_uom ;
859: x_txn_line_dtl_rec.serial_number := p_order_shipment_rec.serial_number;
860: x_txn_line_dtl_rec.processing_status := 'IN_PROCESS';
876: WHEN no_data_found THEN
877: fnd_message.set_name('CSI','CSI_INT_PTY_SITE_MISSING');
878: fnd_message.set_token('LOCATION_ID', p_order_shipment_rec.ib_current_loc_id); -- ship_to_org_id);
879: fnd_msg_pub.add;
880: RAISE fnd_api.g_exc_error;
881: WHEN too_many_rows THEN
882: fnd_message.set_name('CSI','CSI_INT_MANY_PTY_SITE_FOUND');
883: fnd_message.set_token('LOCATION_ID', p_order_shipment_rec.ib_current_loc_id); -- ship_to_org_id);
884: fnd_msg_pub.add;
881: WHEN too_many_rows THEN
882: fnd_message.set_name('CSI','CSI_INT_MANY_PTY_SITE_FOUND');
883: fnd_message.set_token('LOCATION_ID', p_order_shipment_rec.ib_current_loc_id); -- ship_to_org_id);
884: fnd_msg_pub.add;
885: RAISE fnd_api.g_exc_error;
886: END ;
887:
888: IF p_order_shipment_rec.ib_install_loc is not null
889: AND
888: IF p_order_shipment_rec.ib_install_loc is not null
889: AND
890: p_order_shipment_rec.ib_install_loc_id is not null
891: AND
892: p_order_shipment_rec.ib_install_loc_id <> fnd_api.g_miss_num
893: Then
894: BEGIN
895: SELECT party_site_id
896: INTO l_install_party_site_id
903: fnd_message.set_name('CSI','CSI_INT_PTY_SITE_MISSING');
904: fnd_message.set_token('LOCATION_ID', p_order_shipment_rec.ib_install_loc_id); -- ship_to_org_id);
905: fnd_msg_pub.add;
906: debug('Party_site_id not found');
907: raise fnd_api.g_exc_error;
908: when too_many_rows then
909: fnd_message.set_name('CSI','CSI_INT_MANY_PTY_SITE_FOUND');
910: fnd_message.set_token('LOCATION_ID', p_order_shipment_rec.ib_install_loc_id); -- ship_to_org_id);
911: fnd_msg_pub.add;
909: fnd_message.set_name('CSI','CSI_INT_MANY_PTY_SITE_FOUND');
910: fnd_message.set_token('LOCATION_ID', p_order_shipment_rec.ib_install_loc_id); -- ship_to_org_id);
911: fnd_msg_pub.add;
912: debug('Party_site_id not found');
913: raise fnd_api.g_exc_error;
914: end ;
915: END IF;
916:
917: x_txn_line_dtl_rec.lot_number := p_order_shipment_rec.lot_number;
928:
929: l_inst_party_id := csi_utl_pkg.get_instance_party_id(l_instance_id);
930: IF l_inst_party_id = -1 THEN
931: debug('get_instance_party_id failed');
932: RAISE fnd_api.g_exc_error;
933: END IF;
934:
935: -- assign values for the columns in x_txn_party_dtl_tbl
936: x_txn_party_dtl_tbl(l_index).instance_party_id := l_inst_party_id;
964: x_txn_pty_acct_dtl_tbl(l_index).object_version_number := 1;
965: x_txn_pty_acct_dtl_tbl(l_index).txn_party_details_index := l_index;
966:
967: -- assign values for the columns in x_txn_org_assgn_tbl
968: IF nvl(p_order_shipment_rec.sold_from_org_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
969: x_txn_org_assgn_tbl(l_index).txn_operating_unit_id := fnd_api.g_miss_num;
970: x_txn_org_assgn_tbl(l_index).txn_line_detail_id := fnd_api.g_miss_num;
971: x_txn_org_assgn_tbl(l_index).instance_ou_id := fnd_api.g_miss_num;
972: x_txn_org_assgn_tbl(l_index).operating_unit_id := p_order_shipment_rec.sold_from_org_id;
965: x_txn_pty_acct_dtl_tbl(l_index).txn_party_details_index := l_index;
966:
967: -- assign values for the columns in x_txn_org_assgn_tbl
968: IF nvl(p_order_shipment_rec.sold_from_org_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
969: x_txn_org_assgn_tbl(l_index).txn_operating_unit_id := fnd_api.g_miss_num;
970: x_txn_org_assgn_tbl(l_index).txn_line_detail_id := fnd_api.g_miss_num;
971: x_txn_org_assgn_tbl(l_index).instance_ou_id := fnd_api.g_miss_num;
972: x_txn_org_assgn_tbl(l_index).operating_unit_id := p_order_shipment_rec.sold_from_org_id;
973: x_txn_org_assgn_tbl(l_index).relationship_type_code := 'SOLD_FROM';
966:
967: -- assign values for the columns in x_txn_org_assgn_tbl
968: IF nvl(p_order_shipment_rec.sold_from_org_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
969: x_txn_org_assgn_tbl(l_index).txn_operating_unit_id := fnd_api.g_miss_num;
970: x_txn_org_assgn_tbl(l_index).txn_line_detail_id := fnd_api.g_miss_num;
971: x_txn_org_assgn_tbl(l_index).instance_ou_id := fnd_api.g_miss_num;
972: x_txn_org_assgn_tbl(l_index).operating_unit_id := p_order_shipment_rec.sold_from_org_id;
973: x_txn_org_assgn_tbl(l_index).relationship_type_code := 'SOLD_FROM';
974: x_txn_org_assgn_tbl(l_index).active_start_date := sysdate;
967: -- assign values for the columns in x_txn_org_assgn_tbl
968: IF nvl(p_order_shipment_rec.sold_from_org_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
969: x_txn_org_assgn_tbl(l_index).txn_operating_unit_id := fnd_api.g_miss_num;
970: x_txn_org_assgn_tbl(l_index).txn_line_detail_id := fnd_api.g_miss_num;
971: x_txn_org_assgn_tbl(l_index).instance_ou_id := fnd_api.g_miss_num;
972: x_txn_org_assgn_tbl(l_index).operating_unit_id := p_order_shipment_rec.sold_from_org_id;
973: x_txn_org_assgn_tbl(l_index).relationship_type_code := 'SOLD_FROM';
974: x_txn_org_assgn_tbl(l_index).active_start_date := sysdate;
975: x_txn_org_assgn_tbl(l_index).preserve_detail_flag := 'Y';
979:
980: -- call api to create the transaction line details
981: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
982: p_api_version => 1.0 ,
983: p_commit => fnd_api.g_false,
984: p_init_msg_list => fnd_api.g_true,
985: p_validation_level => fnd_api.g_valid_level_none,
986: p_txn_line_dtl_index => l_index,
987: p_txn_line_dtl_rec => x_txn_line_dtl_rec,
980: -- call api to create the transaction line details
981: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
982: p_api_version => 1.0 ,
983: p_commit => fnd_api.g_false,
984: p_init_msg_list => fnd_api.g_true,
985: p_validation_level => fnd_api.g_valid_level_none,
986: p_txn_line_dtl_index => l_index,
987: p_txn_line_dtl_rec => x_txn_line_dtl_rec,
988: px_txn_party_dtl_tbl => x_txn_party_dtl_tbl,
981: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
982: p_api_version => 1.0 ,
983: p_commit => fnd_api.g_false,
984: p_init_msg_list => fnd_api.g_true,
985: p_validation_level => fnd_api.g_valid_level_none,
986: p_txn_line_dtl_index => l_index,
987: p_txn_line_dtl_rec => x_txn_line_dtl_rec,
988: px_txn_party_dtl_tbl => x_txn_party_dtl_tbl,
989: px_txn_pty_acct_detail_tbl => x_txn_pty_acct_dtl_tbl,
993: x_return_status => x_return_status,
994: x_msg_count => x_msg_count,
995: x_msg_data => x_msg_data);
996:
997: IF x_return_status <> fnd_api.g_ret_sts_success THEN
998: raise fnd_api.g_exc_error;
999: END IF;
1000:
1001: END IF;
994: x_msg_count => x_msg_count,
995: x_msg_data => x_msg_data);
996:
997: IF x_return_status <> fnd_api.g_ret_sts_success THEN
998: raise fnd_api.g_exc_error;
999: END IF;
1000:
1001: END IF;
1002: EXCEPTION
999: END IF;
1000:
1001: END IF;
1002: EXCEPTION
1003: WHEN fnd_api.g_exc_error THEN
1004: x_return_status := fnd_api.g_ret_sts_error ;
1005: WHEN fnd_api.g_exc_unexpected_error THEN
1006: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1007: END split_ship_rec;
1000:
1001: END IF;
1002: EXCEPTION
1003: WHEN fnd_api.g_exc_error THEN
1004: x_return_status := fnd_api.g_ret_sts_error ;
1005: WHEN fnd_api.g_exc_unexpected_error THEN
1006: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1007: END split_ship_rec;
1008:
1001: END IF;
1002: EXCEPTION
1003: WHEN fnd_api.g_exc_error THEN
1004: x_return_status := fnd_api.g_ret_sts_error ;
1005: WHEN fnd_api.g_exc_unexpected_error THEN
1006: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1007: END split_ship_rec;
1008:
1009: PROCEDURE create_txn_details(
1002: EXCEPTION
1003: WHEN fnd_api.g_exc_error THEN
1004: x_return_status := fnd_api.g_ret_sts_error ;
1005: WHEN fnd_api.g_exc_unexpected_error THEN
1006: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1007: END split_ship_rec;
1008:
1009: PROCEDURE create_txn_details(
1010: x_txn_line_dtl_rec IN OUT NOCOPY csi_t_datastructures_grp.txn_line_detail_rec,
1031: x_txn_ii_rltns_tbl csi_t_datastructures_grp.txn_ii_rltns_tbl;
1032:
1033: BEGIN
1034:
1035: x_return_status := fnd_api.g_ret_sts_success;
1036:
1037: api_log('create_txn_details');
1038:
1039: x_txn_line_dtl_rec := x_txn_line_dtl_rec;
1042:
1043: l_instance_id := p_order_shipment_rec.instance_id;
1044:
1045: /* assign values for the columns in Txn_line_details_tbl */
1046: x_txn_line_dtl_rec.txn_line_detail_id := FND_API.G_MISS_NUM;
1047: x_txn_line_dtl_rec.instance_id := l_instance_id;
1048: x_txn_line_dtl_rec.instance_exists_flag := 'Y';
1049: x_txn_line_dtl_rec.source_transaction_flag := 'Y';
1050: x_txn_line_dtl_rec.sub_type_id := p_txn_sub_type_rec.sub_type_id;
1050: x_txn_line_dtl_rec.sub_type_id := p_txn_sub_type_rec.sub_type_id;
1051: x_txn_line_dtl_rec.inventory_item_id := p_order_shipment_rec.inventory_item_id ;
1052: x_txn_line_dtl_rec.inv_organization_id := p_order_shipment_rec.organization_id ;
1053: x_txn_line_dtl_rec.inventory_revision := p_order_shipment_rec.revision ;
1054: x_txn_line_dtl_rec.item_condition_id := fnd_api.g_miss_num;
1055: x_txn_line_dtl_rec.instance_type_code := fnd_api.g_miss_char;
1056: x_txn_line_dtl_rec.quantity := p_order_shipment_rec.shipped_quantity ;
1057: x_txn_line_dtl_rec.unit_of_measure := p_order_shipment_rec.transaction_uom ;
1058: x_txn_line_dtl_rec.serial_number := p_order_shipment_rec.serial_number;
1051: x_txn_line_dtl_rec.inventory_item_id := p_order_shipment_rec.inventory_item_id ;
1052: x_txn_line_dtl_rec.inv_organization_id := p_order_shipment_rec.organization_id ;
1053: x_txn_line_dtl_rec.inventory_revision := p_order_shipment_rec.revision ;
1054: x_txn_line_dtl_rec.item_condition_id := fnd_api.g_miss_num;
1055: x_txn_line_dtl_rec.instance_type_code := fnd_api.g_miss_char;
1056: x_txn_line_dtl_rec.quantity := p_order_shipment_rec.shipped_quantity ;
1057: x_txn_line_dtl_rec.unit_of_measure := p_order_shipment_rec.transaction_uom ;
1058: x_txn_line_dtl_rec.serial_number := p_order_shipment_rec.serial_number;
1059: x_txn_line_dtl_rec.processing_status := 'IN_PROCESS';
1075: WHEN no_data_found then
1076: fnd_message.set_name('CSI','CSI_INT_PTY_SITE_MISSING');
1077: fnd_message.set_token('LOCATION_ID', p_order_shipment_rec.ship_to_org_id);
1078: fnd_msg_pub.add;
1079: RAISE fnd_api.g_exc_error;
1080: WHEN too_many_rows then
1081: fnd_message.set_name('CSI','CSI_INT_MANY_PTY_SITE_FOUND');
1082: fnd_message.set_token('LOCATION_ID', p_order_shipment_rec.ship_to_org_id);
1083: fnd_msg_pub.add;
1080: WHEN too_many_rows then
1081: fnd_message.set_name('CSI','CSI_INT_MANY_PTY_SITE_FOUND');
1082: fnd_message.set_token('LOCATION_ID', p_order_shipment_rec.ship_to_org_id);
1083: fnd_msg_pub.add;
1084: RAISE fnd_api.g_exc_error;
1085: END;
1086:
1087: x_txn_line_dtl_rec.lot_number := p_order_shipment_rec.lot_number;
1088: x_txn_line_dtl_rec.location_type_code := 'HZ_PARTY_SITES';
1095: l_inst_party_id := csi_utl_pkg.get_instance_party_id(l_instance_id);
1096:
1097: IF l_inst_party_id = -1 THEN
1098: debug('get_instance_party_id failed');
1099: RAISE fnd_api.g_exc_error;
1100: END IF;
1101:
1102: -- assign values for the columns in txn_party_detail_tbl
1103: x_txn_party_dtl_tbl(l_index).instance_party_id := l_inst_party_id;
1133: x_txn_pty_acct_dtl_tbl(l_index).preserve_detail_flag := 'Y';
1134: x_txn_pty_acct_dtl_tbl(l_index).object_version_number := 1;
1135: x_txn_pty_acct_dtl_tbl(l_index).txn_party_details_index := l_index;
1136:
1137: IF nvl(p_order_shipment_rec.sold_from_org_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
1138: x_txn_org_assgn_tbl(l_index).txn_operating_unit_id := fnd_api.g_miss_num;
1139: x_txn_org_assgn_tbl(l_index).txn_line_detail_id := fnd_api.g_miss_num;
1140: x_txn_org_assgn_tbl(l_index).instance_ou_id := fnd_api.g_miss_num;
1141: x_txn_org_assgn_tbl(l_index).operating_unit_id := p_order_shipment_rec.sold_from_org_id;
1134: x_txn_pty_acct_dtl_tbl(l_index).object_version_number := 1;
1135: x_txn_pty_acct_dtl_tbl(l_index).txn_party_details_index := l_index;
1136:
1137: IF nvl(p_order_shipment_rec.sold_from_org_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
1138: x_txn_org_assgn_tbl(l_index).txn_operating_unit_id := fnd_api.g_miss_num;
1139: x_txn_org_assgn_tbl(l_index).txn_line_detail_id := fnd_api.g_miss_num;
1140: x_txn_org_assgn_tbl(l_index).instance_ou_id := fnd_api.g_miss_num;
1141: x_txn_org_assgn_tbl(l_index).operating_unit_id := p_order_shipment_rec.sold_from_org_id;
1142: x_txn_org_assgn_tbl(l_index).relationship_type_code := 'SOLD_FROM';
1135: x_txn_pty_acct_dtl_tbl(l_index).txn_party_details_index := l_index;
1136:
1137: IF nvl(p_order_shipment_rec.sold_from_org_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
1138: x_txn_org_assgn_tbl(l_index).txn_operating_unit_id := fnd_api.g_miss_num;
1139: x_txn_org_assgn_tbl(l_index).txn_line_detail_id := fnd_api.g_miss_num;
1140: x_txn_org_assgn_tbl(l_index).instance_ou_id := fnd_api.g_miss_num;
1141: x_txn_org_assgn_tbl(l_index).operating_unit_id := p_order_shipment_rec.sold_from_org_id;
1142: x_txn_org_assgn_tbl(l_index).relationship_type_code := 'SOLD_FROM';
1143: x_txn_org_assgn_tbl(l_index).active_start_date := sysdate;
1136:
1137: IF nvl(p_order_shipment_rec.sold_from_org_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
1138: x_txn_org_assgn_tbl(l_index).txn_operating_unit_id := fnd_api.g_miss_num;
1139: x_txn_org_assgn_tbl(l_index).txn_line_detail_id := fnd_api.g_miss_num;
1140: x_txn_org_assgn_tbl(l_index).instance_ou_id := fnd_api.g_miss_num;
1141: x_txn_org_assgn_tbl(l_index).operating_unit_id := p_order_shipment_rec.sold_from_org_id;
1142: x_txn_org_assgn_tbl(l_index).relationship_type_code := 'SOLD_FROM';
1143: x_txn_org_assgn_tbl(l_index).active_start_date := sysdate;
1144: x_txn_org_assgn_tbl(l_index).txn_line_details_index := l_index;
1148:
1149: -- call api to create the transaction line details
1150: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
1151: p_api_version => 1.0 ,
1152: p_commit => fnd_api.g_false,
1153: p_init_msg_list => fnd_api.g_true,
1154: p_validation_level => fnd_api.g_valid_level_none,
1155: p_txn_line_dtl_index => l_index,
1156: p_txn_line_dtl_rec => x_txn_line_dtl_rec,
1149: -- call api to create the transaction line details
1150: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
1151: p_api_version => 1.0 ,
1152: p_commit => fnd_api.g_false,
1153: p_init_msg_list => fnd_api.g_true,
1154: p_validation_level => fnd_api.g_valid_level_none,
1155: p_txn_line_dtl_index => l_index,
1156: p_txn_line_dtl_rec => x_txn_line_dtl_rec,
1157: px_txn_party_dtl_tbl => x_txn_party_dtl_tbl,
1150: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
1151: p_api_version => 1.0 ,
1152: p_commit => fnd_api.g_false,
1153: p_init_msg_list => fnd_api.g_true,
1154: p_validation_level => fnd_api.g_valid_level_none,
1155: p_txn_line_dtl_index => l_index,
1156: p_txn_line_dtl_rec => x_txn_line_dtl_rec,
1157: px_txn_party_dtl_tbl => x_txn_party_dtl_tbl,
1158: px_txn_pty_acct_detail_tbl => x_txn_pty_acct_dtl_tbl,
1162: x_return_status => x_return_status,
1163: x_msg_count => x_msg_count,
1164: x_msg_data => x_msg_data);
1165:
1166: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1167: raise fnd_api.g_exc_error;
1168: END IF;
1169:
1170: EXCEPTION
1163: x_msg_count => x_msg_count,
1164: x_msg_data => x_msg_data);
1165:
1166: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1167: raise fnd_api.g_exc_error;
1168: END IF;
1169:
1170: EXCEPTION
1171: WHEN fnd_api.g_exc_error THEN
1167: raise fnd_api.g_exc_error;
1168: END IF;
1169:
1170: EXCEPTION
1171: WHEN fnd_api.g_exc_error THEN
1172: x_return_status := fnd_api.g_ret_sts_error ;
1173: WHEN fnd_api.g_exc_unexpected_error THEN
1174: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1175: END create_txn_details;
1168: END IF;
1169:
1170: EXCEPTION
1171: WHEN fnd_api.g_exc_error THEN
1172: x_return_status := fnd_api.g_ret_sts_error ;
1173: WHEN fnd_api.g_exc_unexpected_error THEN
1174: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1175: END create_txn_details;
1176:
1169:
1170: EXCEPTION
1171: WHEN fnd_api.g_exc_error THEN
1172: x_return_status := fnd_api.g_ret_sts_error ;
1173: WHEN fnd_api.g_exc_unexpected_error THEN
1174: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1175: END create_txn_details;
1176:
1177:
1170: EXCEPTION
1171: WHEN fnd_api.g_exc_error THEN
1172: x_return_status := fnd_api.g_ret_sts_error ;
1173: WHEN fnd_api.g_exc_unexpected_error THEN
1174: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1175: END create_txn_details;
1176:
1177:
1178: FUNCTION Check_config_exists(
1205: BEGIN
1206:
1207: api_log('get_party_id');
1208:
1209: x_return_status := fnd_api.g_ret_sts_success;
1210:
1211: BEGIN
1212: SELECT party_id,
1213: status
1226: WHEN no_data_found THEN
1227: fnd_message.set_name('CSI','CSI_INT_INV_CUST_ACCT_ID');
1228: fnd_message.set_token('CUST_ACCOUNT_ID', p_cust_acct_id);
1229: fnd_msg_pub.add;
1230: RAISE fnd_api.g_exc_error;
1231: END;
1232:
1233: EXCEPTION
1234: WHEN fnd_api.g_exc_error THEN
1230: RAISE fnd_api.g_exc_error;
1231: END;
1232:
1233: EXCEPTION
1234: WHEN fnd_api.g_exc_error THEN
1235: x_return_status := fnd_api.g_ret_sts_error;
1236: END get_party_id;
1237:
1238:
1231: END;
1232:
1233: EXCEPTION
1234: WHEN fnd_api.g_exc_error THEN
1235: x_return_status := fnd_api.g_ret_sts_error;
1236: END get_party_id;
1237:
1238:
1239: FUNCTION validate_inst_party(
1451: p_master_organization_id OUT NOCOPY NUMBER,
1452: x_return_status OUT NOCOPY VARCHAR2
1453: ) IS
1454:
1455: l_fnd_success VARCHAR2(1) := fnd_api.g_ret_sts_success;
1456: l_fnd_error VARCHAR2(1) := fnd_api.g_ret_sts_error;
1457: l_fnd_unexpected VARCHAR2(1) := fnd_api.g_ret_sts_unexp_error;
1458: l_master_org_id NUMBER;
1459:
1452: x_return_status OUT NOCOPY VARCHAR2
1453: ) IS
1454:
1455: l_fnd_success VARCHAR2(1) := fnd_api.g_ret_sts_success;
1456: l_fnd_error VARCHAR2(1) := fnd_api.g_ret_sts_error;
1457: l_fnd_unexpected VARCHAR2(1) := fnd_api.g_ret_sts_unexp_error;
1458: l_master_org_id NUMBER;
1459:
1460: BEGIN
1453: ) IS
1454:
1455: l_fnd_success VARCHAR2(1) := fnd_api.g_ret_sts_success;
1456: l_fnd_error VARCHAR2(1) := fnd_api.g_ret_sts_error;
1457: l_fnd_unexpected VARCHAR2(1) := fnd_api.g_ret_sts_unexp_error;
1458: l_master_org_id NUMBER;
1459:
1460: BEGIN
1461:
1488:
1489: BEGIN
1490: api_log('get_int_party');
1491:
1492: x_return_status := fnd_api.g_ret_sts_success;
1493:
1494: --commented SQL below to make changes for the bug 4028827
1495: /*
1496: SELECT internal_party_id
1501:
1502: IF x_int_party_id IS NULL THEN
1503: fnd_message.set_name('CSI','CSI_INT_INT_PTY_ID_MISSING');
1504: fnd_msg_pub.add;
1505: x_return_status := fnd_api.g_ret_sts_error;
1506: ELSE
1507: x_return_status := fnd_api.g_ret_sts_success;
1508: END IF;
1509:
1503: fnd_message.set_name('CSI','CSI_INT_INT_PTY_ID_MISSING');
1504: fnd_msg_pub.add;
1505: x_return_status := fnd_api.g_ret_sts_error;
1506: ELSE
1507: x_return_status := fnd_api.g_ret_sts_success;
1508: END IF;
1509:
1510: exception
1511: when others then
1510: exception
1511: when others then
1512: fnd_message.set_name('CSI','CSI_INT_INT_PTY_ID_MISSING');
1513: fnd_msg_pub.add;
1514: x_return_status := fnd_api.g_ret_sts_error;
1515: END get_int_party;
1516:
1517: FUNCTION get_serial_contl_code
1518: ( p_inv_item_id IN NUMBER,
1568:
1569: BEGIN
1570: api_log('get_order_line_dtls');
1571:
1572: x_return_status := fnd_api.g_ret_sts_success;
1573:
1574: SELECT b.header_id,
1575: b.line_id,
1576: mmt.inventory_item_id,
1664: WHEN no_data_found THEN
1665: fnd_message.set_name('CSI','CSI_INT_PTY_SITE_MISSING');
1666: fnd_message.set_token('LOCATION_ID', l_order_line_rec.ship_to_org_id);
1667: fnd_msg_pub.add;
1668: RAISE fnd_api.g_exc_error;
1669: WHEN too_many_rows THEN
1670: fnd_message.set_name('CSI','CSI_INT_MANY_PTY_SITE_FOUND');
1671: fnd_message.set_token('LOCATION_ID', l_order_line_rec.ship_to_org_id);
1672: fnd_msg_pub.add;
1669: WHEN too_many_rows THEN
1670: fnd_message.set_name('CSI','CSI_INT_MANY_PTY_SITE_FOUND');
1671: fnd_message.set_token('LOCATION_ID', l_order_line_rec.ship_to_org_id);
1672: fnd_msg_pub.add;
1673: RAISE fnd_api.g_exc_error;
1674: END;
1675:
1676: debug(' order_number : '||l_order_line_rec.order_number);
1677: debug(' header_id : '||l_order_line_rec.header_id);
1695: l_order_line_rec.ib_owner := 'END_CUSTOMER';
1696: IF l_partner_rec.END_CUSTOMER_ID is null Then
1697: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1698: fnd_msg_pub.add;
1699: raise fnd_api.g_exc_error;
1700: ELSE
1701: l_order_line_rec.end_customer_id := l_partner_rec.end_customer_id;
1702: END IF;
1703: ELSIF l_partner_rec.IB_OWNER = 'INSTALL_BASE'
1702: END IF;
1703: ELSIF l_partner_rec.IB_OWNER = 'INSTALL_BASE'
1704: THEN
1705: l_order_line_rec.ib_owner := l_partner_rec.IB_OWNER;
1706: l_order_line_rec.end_customer_id := fnd_api.g_miss_num;
1707: ELSE
1708: l_order_line_rec.end_customer_id := l_order_line_rec.sold_to_org_id;
1709: END IF;
1710:
1716: IF l_partner_rec.end_customer_site_use_id is null
1717: THEN
1718: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1719: fnd_msg_pub.add;
1720: raise fnd_api.g_exc_error;
1721: ELSE
1722: l_order_line_rec.ib_install_loc_id := l_partner_rec.end_customer_site_use_id;
1723: END IF;
1724: ELSIF l_order_line_rec.ib_install_loc = 'SHIP_TO'
1726: IF l_order_line_rec.ship_to_org_id is null
1727: THEN
1728: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1729: fnd_msg_pub.add;
1730: raise fnd_api.g_exc_error;
1731: ELSE
1732: l_order_line_rec.ib_install_loc_id := l_order_line_rec.ship_to_org_id;
1733: END IF;
1734: ELSIF l_order_line_rec.ib_install_loc = 'SOLD_TO'
1736: IF l_partner_rec.SOLD_TO_SITE_USE_ID is null -- 3412544 l_order_line_rec.sold_to_org_id is null
1737: THEN
1738: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1739: fnd_msg_pub.add;
1740: raise fnd_api.g_exc_error;
1741: ELSE
1742: l_order_line_rec.ib_install_loc_id := l_partner_rec.SOLD_TO_SITE_USE_ID; -- 3412544 l_order_line_rec.sold_to_org_id;
1743: END IF;
1744: ELSIF l_order_line_rec.ib_install_loc = 'DELIVER_TO'
1746: IF l_order_line_rec.deliver_to_org_id is null
1747: THEN
1748: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1749: fnd_msg_pub.add;
1750: raise fnd_api.g_exc_error;
1751: ELSE
1752: l_order_line_rec.ib_install_loc_id := l_order_line_rec.deliver_to_org_id;
1753: END IF;
1754: ELSIF l_order_line_rec.ib_install_loc = 'BILL_TO'
1756: IF l_order_line_rec.invoice_to_org_id is null
1757: THEN
1758: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1759: fnd_msg_pub.add;
1760: raise fnd_api.g_exc_error;
1761: ELSE
1762: l_order_line_rec.ib_install_loc_id := l_order_line_rec.invoice_to_org_id;
1763: END IF;
1764: ELSIF l_order_line_rec.ib_install_loc = 'INSTALL_BASE'
1762: l_order_line_rec.ib_install_loc_id := l_order_line_rec.invoice_to_org_id;
1763: END IF;
1764: ELSIF l_order_line_rec.ib_install_loc = 'INSTALL_BASE'
1765: THEN
1766: l_order_line_rec.ib_install_loc_id := fnd_api.g_miss_num;
1767: END IF;
1768: ELSE
1769: l_order_line_rec.ib_install_loc_id := l_order_line_rec.ship_to_org_id;
1770: END IF;
1777: IF l_partner_rec.end_customer_site_use_id is null
1778: THEN
1779: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1780: fnd_msg_pub.add;
1781: raise fnd_api.g_exc_error;
1782: ELSE
1783: l_order_line_rec.ib_current_loc_id := l_partner_rec.end_customer_site_use_id;
1784: END IF;
1785: ELSIF l_order_line_rec.ib_current_loc = 'SHIP_TO'
1787: IF l_order_line_rec.ship_to_org_id is null
1788: THEN
1789: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1790: fnd_msg_pub.add;
1791: raise fnd_api.g_exc_error;
1792: ELSE
1793: l_order_line_rec.ib_current_loc_id := l_order_line_rec.ship_to_org_id;
1794: END IF;
1795: ELSIF l_order_line_rec.ib_current_loc = 'SOLD_TO'
1797: IF l_partner_rec.SOLD_TO_SITE_USE_ID is null -- 3412544 l_order_line_rec.sold_to_org_id is null
1798: THEN
1799: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1800: fnd_msg_pub.add;
1801: raise fnd_api.g_exc_error;
1802: ELSE
1803: l_order_line_rec.ib_current_loc_id := l_partner_rec.SOLD_TO_SITE_USE_ID; -- 3412544 l_order_line_rec.sold_to_org_id;
1804: END IF;
1805: ELSIF l_order_line_rec.ib_current_loc = 'DELIVER_TO'
1807: IF l_order_line_rec.deliver_to_org_id is null
1808: THEN
1809: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1810: fnd_msg_pub.add;
1811: raise fnd_api.g_exc_error;
1812: ELSE
1813: l_order_line_rec.ib_current_loc_id := l_order_line_rec.deliver_to_org_id;
1814: END IF;
1815: ELSIF l_order_line_rec.ib_current_loc = 'BILL_TO'
1817: IF l_order_line_rec.invoice_to_org_id is null
1818: THEN
1819: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
1820: fnd_msg_pub.add;
1821: raise fnd_api.g_exc_error;
1822: ELSE
1823: l_order_line_rec.ib_current_loc_id := l_order_line_rec.invoice_to_org_id;
1824: END IF;
1825: ELSIF l_order_line_rec.ib_current_loc = 'INSTALL_BASE'
1823: l_order_line_rec.ib_current_loc_id := l_order_line_rec.invoice_to_org_id;
1824: END IF;
1825: ELSIF l_order_line_rec.ib_current_loc = 'INSTALL_BASE'
1826: THEN
1827: l_order_line_rec.ib_current_loc_id := fnd_api.g_miss_num;
1828: END IF;
1829: ELSE
1830: l_order_line_rec.ib_current_loc_id := l_order_line_rec.ship_to_org_id;
1831: END IF;
1829: ELSE
1830: l_order_line_rec.ib_current_loc_id := l_order_line_rec.ship_to_org_id;
1831: END IF;
1832:
1833: IF NVL(l_order_line_rec.config_header_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num
1834: AND NVL(l_order_line_rec.config_rev_nbr,fnd_api.g_miss_num) <> fnd_api.g_miss_num
1835: AND NVL(l_order_line_rec.configuration_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num
1836: THEN
1837:
1830: l_order_line_rec.ib_current_loc_id := l_order_line_rec.ship_to_org_id;
1831: END IF;
1832:
1833: IF NVL(l_order_line_rec.config_header_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num
1834: AND NVL(l_order_line_rec.config_rev_nbr,fnd_api.g_miss_num) <> fnd_api.g_miss_num
1835: AND NVL(l_order_line_rec.configuration_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num
1836: THEN
1837:
1838: l_om_session_key.session_hdr_id := l_order_line_rec.config_header_id;
1831: END IF;
1832:
1833: IF NVL(l_order_line_rec.config_header_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num
1834: AND NVL(l_order_line_rec.config_rev_nbr,fnd_api.g_miss_num) <> fnd_api.g_miss_num
1835: AND NVL(l_order_line_rec.configuration_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num
1836: THEN
1837:
1838: l_om_session_key.session_hdr_id := l_order_line_rec.config_header_id;
1839: l_om_session_key.session_rev_num := l_order_line_rec.config_rev_nbr;
1843: ( p_config_session_key => l_om_session_key,
1844: x_return_status => x_return_status
1845: );
1846: --
1847: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1848: RAISE fnd_api.g_exc_error;
1849: END IF;
1850:
1851: IF NOT l_macd_processing THEN
1844: x_return_status => x_return_status
1845: );
1846: --
1847: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1848: RAISE fnd_api.g_exc_error;
1849: END IF;
1850:
1851: IF NOT l_macd_processing THEN
1852: l_order_line_rec.macd_order_line := fnd_api.g_false ;
1848: RAISE fnd_api.g_exc_error;
1849: END IF;
1850:
1851: IF NOT l_macd_processing THEN
1852: l_order_line_rec.macd_order_line := fnd_api.g_false ;
1853: ELSE
1854: l_order_line_rec.macd_order_line := fnd_api.g_true ;
1855: END IF;
1856:
1850:
1851: IF NOT l_macd_processing THEN
1852: l_order_line_rec.macd_order_line := fnd_api.g_false ;
1853: ELSE
1854: l_order_line_rec.macd_order_line := fnd_api.g_true ;
1855: END IF;
1856:
1857: END IF;
1858: x_order_line_rec := l_order_line_rec;
1857: END IF;
1858: x_order_line_rec := l_order_line_rec;
1859:
1860: EXCEPTION
1861: WHEN fnd_api.g_exc_error THEN
1862: x_return_status := fnd_api.g_ret_sts_error;
1863: WHEN others THEN
1864: fnd_message.set_name('CSI','CSI_INT_ORD_LINE_MISSING');
1865: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_transaction_id);
1858: x_order_line_rec := l_order_line_rec;
1859:
1860: EXCEPTION
1861: WHEN fnd_api.g_exc_error THEN
1862: x_return_status := fnd_api.g_ret_sts_error;
1863: WHEN others THEN
1864: fnd_message.set_name('CSI','CSI_INT_ORD_LINE_MISSING');
1865: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_transaction_id);
1866: fnd_msg_pub.add;
1863: WHEN others THEN
1864: fnd_message.set_name('CSI','CSI_INT_ORD_LINE_MISSING');
1865: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_transaction_id);
1866: fnd_msg_pub.add;
1867: x_return_status := fnd_api.g_ret_sts_error;
1868:
1869: END get_order_line_dtls;
1870:
1871: /* Added p_order_header_id as part of fix for Bug : 2897324 */
1877: x_return_status OUT NOCOPY VARCHAR2)
1878: IS
1879: BEGIN
1880: api_log('get_split_order_line');
1881: x_return_status := fnd_api.g_ret_sts_success;
1882:
1883: /* Added p_order_header_id as part of fix for Bug : 2897324 */
1884:
1885: SELECT line_id
1889: AND header_id = p_order_header_id;
1890:
1891: EXCEPTION
1892: WHEN no_data_found THEN
1893: x_return_status := fnd_api.g_ret_sts_success;
1894: WHEN too_many_rows THEN
1895: x_return_status := fnd_api.g_ret_sts_success;
1896: WHEN others THEN
1897: fnd_message.set_name('CSI','CSI_INT_SPL_ORD_LINE_MISSING');
1891: EXCEPTION
1892: WHEN no_data_found THEN
1893: x_return_status := fnd_api.g_ret_sts_success;
1894: WHEN too_many_rows THEN
1895: x_return_status := fnd_api.g_ret_sts_success;
1896: WHEN others THEN
1897: fnd_message.set_name('CSI','CSI_INT_SPL_ORD_LINE_MISSING');
1898: fnd_message.set_token('ORDER_LINE_ID', p_order_line_id);
1899: fnd_msg_pub.add;
1896: WHEN others THEN
1897: fnd_message.set_name('CSI','CSI_INT_SPL_ORD_LINE_MISSING');
1898: fnd_message.set_token('ORDER_LINE_ID', p_order_line_id);
1899: fnd_msg_pub.add;
1900: x_return_status := fnd_api.g_ret_sts_error;
1901: END get_split_order_line;
1902:
1903: PROCEDURE get_sub_type_rec(
1904: p_sub_type_id IN NUMBER,
1907: x_return_status OUT NOCOPY VARCHAR2)
1908: IS
1909: BEGIN
1910: api_log('get_sub_type_rec');
1911: x_return_status := fnd_api.g_ret_sts_success;
1912: SELECT sub_type_id ,
1913: src_change_owner_to_code,
1914: src_status_id,
1915: nvl(src_change_owner,'N'),
1942: fnd_message.set_name('CSI','CSI_INT_SUB_TYPE_REC_MISSING');
1943: fnd_message.set_token('SUB_TYPE_ID', p_sub_type_id);
1944: fnd_message.set_token('TRANSACTION_TYPE_ID', p_trx_type_id);
1945: fnd_msg_pub.add;
1946: x_return_status := fnd_api.g_ret_sts_error;
1947: END get_sub_type_rec;
1948:
1949: PROCEDURE get_inst_relation
1950: ( p_ii_relationship_id IN NUMBER,
1956: BEGIN
1957:
1958: api_log('get_inst_relation');
1959:
1960: x_return_status := fnd_api.g_ret_sts_success;
1961:
1962: SELECT
1963: object_id,
1964: subject_id
1973: when others then
1974: fnd_message.set_name('CSI','CSI_INT_INV_II_REL_ID');
1975: fnd_message.set_token('RELATIONSHIP_ID', p_ii_relationship_id);
1976: fnd_msg_pub.add;
1977: x_return_status := fnd_api.g_ret_sts_error;
1978: END get_inst_relation;
1979:
1980: PROCEDURE get_model_inst_lst(
1981: p_parent_line_id IN number,
2028: api_log('get_qty_ratio');
2029:
2030:
2031: /* Initialize API return status to success */
2032: x_return_status := fnd_api.g_ret_sts_success;
2033:
2034: IF nvl(p_model_remnant_flag,'N') = 'Y' THEN
2035: BEGIN
2036: select sum(ordered_quantity)
2130:
2131: api_log('get_link_to_line_id');
2132:
2133: /* Initialize API return status to success */
2134: x_return_status := fnd_api.g_ret_sts_success;
2135:
2136: WHILE NOT(l_found) LOOP
2137:
2138: BEGIN
2168: debug('Passed link_to_line_id '||x_link_to_line_id||' does not exists in oe order lines');
2169: fnd_message.set_name('CSI','CSI_OE_LINK_TO_LINE_ID_INVALID');
2170: fnd_message.set_token('OE_LINK_TO_LINE_ID', x_link_to_line_id);
2171: fnd_msg_pub.add;
2172: x_return_status := fnd_api.g_ret_sts_error;
2173: l_found := TRUE;
2174: --end of fix--
2175: end;
2176: WHEN others THEN
2198: BEGIN
2199:
2200: api_log('build_inst_ii_tbl');
2201:
2202: x_return_status := fnd_api.g_ret_sts_success;
2203:
2204: IF p_txn_ii_rltns_tbl.count > 0 THEN
2205: FOR i in p_txn_ii_rltns_tbl.first..p_txn_ii_rltns_tbl.last LOOP
2206: IF p_txn_ii_rltns_tbl(i).subject_id = p_orig_inst_id THEN
2297: IS
2298:
2299: l_bom_item_type mtl_system_items.bom_item_type%TYPE;
2300: l_bom_found varchar2(1);
2301: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
2302: l_explosion_level number;
2303: l_explode_flag varchar2(3);
2304: l_leaf_node varchar2(100);
2305: l_item_type_code varchar2(30);
2392: EXCEPTION
2393: WHEN no_explosion THEN
2394: debug(' check_standard_bom : FALSE');
2395: RETURN FALSE;
2396: WHEN fnd_api.g_exc_error THEN
2397: RETURN FALSE;
2398: END check_standard_bom;
2399:
2400: PROCEDURE get_parties_and_accounts(
2433:
2434: l_pa_rec csi_datastructures_pub.party_account_rec;
2435: l_pa_tbl csi_datastructures_pub.party_account_tbl;
2436:
2437: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
2438: l_msg_count number;
2439: l_msg_data varchar2(2000);
2440:
2441: PROCEDURE convert_tpty_to_ipty(
2451: x_i_party_rec.party_id := p_t_party_rec.party_source_id;
2452: x_i_party_rec.party_source_table := p_t_party_rec.party_source_table;
2453: x_i_party_rec.relationship_type_code := p_t_party_rec.relationship_type_code;
2454: x_i_party_rec.contact_flag := p_t_party_rec.contact_flag;
2455: x_i_party_rec.active_start_date := fnd_api.g_miss_date;
2456: x_i_party_rec.active_end_date := p_t_party_rec.active_end_date;
2457: x_i_party_rec.context := p_t_party_rec.context;
2458: x_i_party_rec.attribute1 := p_t_party_rec.attribute1;
2459: x_i_party_rec.attribute2 := p_t_party_rec.attribute2;
2470: x_i_party_rec.attribute13 := p_t_party_rec.attribute13;
2471: x_i_party_rec.attribute14 := p_t_party_rec.attribute14;
2472: x_i_party_rec.attribute15 := p_t_party_rec.attribute15;
2473:
2474: IF nvl(p_t_party_rec.instance_party_id, fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
2475: BEGIN
2476: SELECT instance_party_id,
2477: object_version_number
2478: INTO x_i_party_rec.instance_party_id,
2483: AND relationship_type_code = x_i_party_rec.relationship_type_code
2484: AND contact_flag = x_i_party_rec.contact_flag;
2485: EXCEPTION
2486: WHEN no_data_found THEN
2487: x_i_party_rec.object_version_number := fnd_api.g_miss_num;
2488: END;
2489: /*null check added-bug 6455823*/
2490: ELSIF Nvl(p_t_party_rec.instance_party_id, fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
2491: SELECT object_version_number
2486: WHEN no_data_found THEN
2487: x_i_party_rec.object_version_number := fnd_api.g_miss_num;
2488: END;
2489: /*null check added-bug 6455823*/
2490: ELSIF Nvl(p_t_party_rec.instance_party_id, fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
2491: SELECT object_version_number
2492: INTO x_i_party_rec.object_version_number
2493: FROM csi_i_parties
2494: WHERE instance_party_id = p_t_party_rec.instance_party_id;
2528: x_i_pa_rec.attribute13 := p_t_pa_rec.attribute13;
2529: x_i_pa_rec.attribute14 := p_t_pa_rec.attribute14;
2530: x_i_pa_rec.attribute15 := p_t_pa_rec.attribute15;
2531:
2532: IF nvl(p_t_pa_rec.ip_account_id, fnd_api.g_miss_num) = fnd_api.g_miss_num
2533: AND
2534: nvl(p_instance_party_id, fnd_api.g_miss_num) <> fnd_api.g_miss_num
2535: THEN
2536: BEGIN
2530: x_i_pa_rec.attribute15 := p_t_pa_rec.attribute15;
2531:
2532: IF nvl(p_t_pa_rec.ip_account_id, fnd_api.g_miss_num) = fnd_api.g_miss_num
2533: AND
2534: nvl(p_instance_party_id, fnd_api.g_miss_num) <> fnd_api.g_miss_num
2535: THEN
2536: BEGIN
2537: SELECT ip_account_id,
2538: object_version_number
2547: x_i_pa_rec.object_version_number := 1;
2548: END;
2549: END IF;
2550:
2551: IF nvl(x_i_pa_rec.bill_to_address, fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
2552: x_i_pa_rec.bill_to_address := p_order_line_rec.invoice_to_org_id;
2553: END IF;
2554:
2555: IF nvl(x_i_pa_rec.ship_to_address, fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
2551: IF nvl(x_i_pa_rec.bill_to_address, fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
2552: x_i_pa_rec.bill_to_address := p_order_line_rec.invoice_to_org_id;
2553: END IF;
2554:
2555: IF nvl(x_i_pa_rec.ship_to_address, fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
2556: x_i_pa_rec.ship_to_address := p_order_line_rec.ship_to_org_id;
2557: END IF;
2558:
2559: END convert_tpa_to_ipa;
2583: END get_contact_parties;
2584:
2585: BEGIN
2586:
2587: x_return_status := fnd_api.g_ret_sts_success;
2588:
2589: api_log('get_parties_and_accounts');
2590:
2591: BEGIN
2607: END IF;
2608: END LOOP;
2609: END IF;
2610:
2611: IF nvl(p_owner_pty_rec.party_id, fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
2612: l_pty_ind := l_pty_ind + 1;
2613: l_pty_tbl(l_pty_ind) := p_owner_pty_rec;
2614:
2615: IF nvl(p_owner_acct_rec.party_account_id, fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
2611: IF nvl(p_owner_pty_rec.party_id, fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
2612: l_pty_ind := l_pty_ind + 1;
2613: l_pty_tbl(l_pty_ind) := p_owner_pty_rec;
2614:
2615: IF nvl(p_owner_acct_rec.party_account_id, fnd_api.g_miss_num) <> fnd_api.g_miss_num THEN
2616: l_pa_ind := l_pa_ind + 1;
2617: l_pa_tbl(l_pa_ind) := p_owner_acct_rec;
2618: l_pa_tbl(l_pa_ind).parent_tbl_index := l_pty_ind;
2619: END IF;
2743: -- Bug 14507913
2744: /*
2745: IF NOT(l_ship_to_con_entered)
2746: AND
2747: nvl(p_order_line_rec.ship_to_contact_id, fnd_api.g_miss_num ) <> fnd_api.g_miss_num
2748: THEN
2749:
2750: csi_utl_pkg.derive_party_id(
2751: p_cust_acct_role_id => p_order_line_rec.ship_to_contact_id,
2751: p_cust_acct_role_id => p_order_line_rec.ship_to_contact_id,
2752: x_party_id => l_contact_party_id,
2753: x_return_status => x_return_status );
2754:
2755: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2756: RAISE fnd_api.g_exc_error;
2757: END IF;
2758:
2759: debug(' ship_to_contact_id :'||p_order_line_rec.ship_to_contact_id);
2752: x_party_id => l_contact_party_id,
2753: x_return_status => x_return_status );
2754:
2755: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2756: RAISE fnd_api.g_exc_error;
2757: END IF;
2758:
2759: debug(' ship_to_contact_id :'||p_order_line_rec.ship_to_contact_id);
2760: debug(' ship_to_contact_party_id :'||l_contact_party_id);
2759: debug(' ship_to_contact_id :'||p_order_line_rec.ship_to_contact_id);
2760: debug(' ship_to_contact_party_id :'||l_contact_party_id);
2761:
2762: l_pty_rec := l_init_pty_rec;
2763: l_pty_rec.instance_party_id := fnd_api.g_miss_num;
2764: l_pty_rec.instance_id := p_instance_id;
2765: l_pty_rec.party_id := l_contact_party_id;
2766: l_pty_rec.party_source_table := 'HZ_PARTIES';
2767: l_pty_rec.relationship_type_code := 'SHIP_TO';
2766: l_pty_rec.party_source_table := 'HZ_PARTIES';
2767: l_pty_rec.relationship_type_code := 'SHIP_TO';
2768: l_pty_rec.contact_flag := 'Y';
2769: l_pty_rec.contact_ip_id := l_owner_inst_pty_id;
2770: l_pty_rec.active_start_date := fnd_api.g_miss_date;
2771: l_pty_rec.object_version_number := fnd_api.g_miss_num;
2772:
2773: BEGIN
2774: SELECT instance_party_id,
2767: l_pty_rec.relationship_type_code := 'SHIP_TO';
2768: l_pty_rec.contact_flag := 'Y';
2769: l_pty_rec.contact_ip_id := l_owner_inst_pty_id;
2770: l_pty_rec.active_start_date := fnd_api.g_miss_date;
2771: l_pty_rec.object_version_number := fnd_api.g_miss_num;
2772:
2773: BEGIN
2774: SELECT instance_party_id,
2775: object_version_number
2794: END IF;
2795:
2796: IF NOT(l_bill_to_con_entered)
2797: AND
2798: nvl(p_order_line_rec.invoice_to_contact_id, fnd_api.g_miss_num ) <> fnd_api.g_miss_num
2799: THEN
2800:
2801: csi_utl_pkg.derive_party_id(
2802: p_cust_acct_role_id => p_order_line_rec.invoice_to_contact_id,
2802: p_cust_acct_role_id => p_order_line_rec.invoice_to_contact_id,
2803: x_party_id => l_contact_party_id,
2804: x_return_status => x_return_status );
2805:
2806: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2807: RAISE fnd_api.g_exc_error;
2808: END IF;
2809:
2810: debug(' bill_to_contact_id :'||p_order_line_rec.invoice_to_contact_id);
2803: x_party_id => l_contact_party_id,
2804: x_return_status => x_return_status );
2805:
2806: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2807: RAISE fnd_api.g_exc_error;
2808: END IF;
2809:
2810: debug(' bill_to_contact_id :'||p_order_line_rec.invoice_to_contact_id);
2811: debug(' bill_to_contact_party_id :'||l_contact_party_id);
2811: debug(' bill_to_contact_party_id :'||l_contact_party_id);
2812:
2813: l_pty_rec := l_init_pty_rec;
2814:
2815: l_pty_rec.instance_party_id := fnd_api.g_miss_num;
2816: l_pty_rec.instance_id := p_instance_id;
2817: l_pty_rec.party_id := l_contact_party_id;
2818: l_pty_rec.party_source_table := 'HZ_PARTIES';
2819: l_pty_rec.relationship_type_code := 'BILL_TO';
2818: l_pty_rec.party_source_table := 'HZ_PARTIES';
2819: l_pty_rec.relationship_type_code := 'BILL_TO';
2820: l_pty_rec.contact_flag := 'Y';
2821: l_pty_rec.contact_ip_id := l_owner_inst_pty_id;
2822: l_pty_rec.active_start_date := fnd_api.g_miss_date;
2823: l_pty_rec.object_version_number := fnd_api.g_miss_num;
2824:
2825: BEGIN
2826: SELECT instance_party_id,
2819: l_pty_rec.relationship_type_code := 'BILL_TO';
2820: l_pty_rec.contact_flag := 'Y';
2821: l_pty_rec.contact_ip_id := l_owner_inst_pty_id;
2822: l_pty_rec.active_start_date := fnd_api.g_miss_date;
2823: l_pty_rec.object_version_number := fnd_api.g_miss_num;
2824:
2825: BEGIN
2826: SELECT instance_party_id,
2827: object_version_number
2848: x_i_pty_tbl := l_pty_tbl;
2849: x_i_pty_acct_tbl := l_pa_tbl;
2850:
2851: EXCEPTION
2852: WHEN fnd_api.g_exc_error THEN
2853: x_return_status := fnd_api.g_ret_sts_error ;
2854: WHEN fnd_api.g_exc_unexpected_error THEN
2855: x_return_status := fnd_api.g_ret_sts_unexp_error ;
2856: END get_parties_and_accounts;
2849: x_i_pty_acct_tbl := l_pa_tbl;
2850:
2851: EXCEPTION
2852: WHEN fnd_api.g_exc_error THEN
2853: x_return_status := fnd_api.g_ret_sts_error ;
2854: WHEN fnd_api.g_exc_unexpected_error THEN
2855: x_return_status := fnd_api.g_ret_sts_unexp_error ;
2856: END get_parties_and_accounts;
2857:
2850:
2851: EXCEPTION
2852: WHEN fnd_api.g_exc_error THEN
2853: x_return_status := fnd_api.g_ret_sts_error ;
2854: WHEN fnd_api.g_exc_unexpected_error THEN
2855: x_return_status := fnd_api.g_ret_sts_unexp_error ;
2856: END get_parties_and_accounts;
2857:
2858: PROCEDURE create_txn_dtls(
2851: EXCEPTION
2852: WHEN fnd_api.g_exc_error THEN
2853: x_return_status := fnd_api.g_ret_sts_error ;
2854: WHEN fnd_api.g_exc_unexpected_error THEN
2855: x_return_status := fnd_api.g_ret_sts_unexp_error ;
2856: END get_parties_and_accounts;
2857:
2858: PROCEDURE create_txn_dtls(
2859: p_source_trx_id IN number,
2885: l_csi_ea_tbl csi_t_datastructures_grp.csi_ext_attribs_tbl;
2886: l_csi_eav_tbl csi_t_datastructures_grp.csi_ext_attrib_vals_tbl;
2887: l_txn_systems_tbl csi_t_datastructures_grp.txn_systems_tbl;
2888:
2889: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
2890: l_msg_count number;
2891: l_msg_data varchar2(2000);
2892:
2893: CURSOR tld_cur(
2907: AND ctld.quantity > 1;
2908:
2909: BEGIN
2910:
2911: x_return_status := fnd_api.g_ret_sts_success;
2912:
2913: api_log('create_txn_dtls');
2914:
2915: FOR tld_rec IN tld_cur( p_source_trx_id, p_source_trx_table )
2918: l_txn_line_detail_query_rec.txn_line_detail_id := tld_rec.txn_line_detail_id;
2919:
2920: csi_t_txn_details_grp.get_transaction_details(
2921: p_api_version => 1.0,
2922: p_commit => fnd_api.g_false,
2923: p_init_msg_list => fnd_api.g_true,
2924: p_validation_level => fnd_api.g_valid_level_full,
2925: p_txn_line_query_rec => l_txn_line_query_rec,
2926: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
2919:
2920: csi_t_txn_details_grp.get_transaction_details(
2921: p_api_version => 1.0,
2922: p_commit => fnd_api.g_false,
2923: p_init_msg_list => fnd_api.g_true,
2924: p_validation_level => fnd_api.g_valid_level_full,
2925: p_txn_line_query_rec => l_txn_line_query_rec,
2926: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
2927: x_txn_line_detail_tbl => o_line_dtl_tbl,
2920: csi_t_txn_details_grp.get_transaction_details(
2921: p_api_version => 1.0,
2922: p_commit => fnd_api.g_false,
2923: p_init_msg_list => fnd_api.g_true,
2924: p_validation_level => fnd_api.g_valid_level_full,
2925: p_txn_line_query_rec => l_txn_line_query_rec,
2926: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
2927: x_txn_line_detail_tbl => o_line_dtl_tbl,
2928: p_get_parties_flag => fnd_api.g_true,
2924: p_validation_level => fnd_api.g_valid_level_full,
2925: p_txn_line_query_rec => l_txn_line_query_rec,
2926: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
2927: x_txn_line_detail_tbl => o_line_dtl_tbl,
2928: p_get_parties_flag => fnd_api.g_true,
2929: x_txn_party_detail_tbl => o_pty_dtl_tbl,
2930: p_get_pty_accts_flag => fnd_api.g_true,
2931: x_txn_pty_acct_detail_tbl => o_pty_acct_tbl,
2932: p_get_ii_rltns_flag => fnd_api.g_true,
2926: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
2927: x_txn_line_detail_tbl => o_line_dtl_tbl,
2928: p_get_parties_flag => fnd_api.g_true,
2929: x_txn_party_detail_tbl => o_pty_dtl_tbl,
2930: p_get_pty_accts_flag => fnd_api.g_true,
2931: x_txn_pty_acct_detail_tbl => o_pty_acct_tbl,
2932: p_get_ii_rltns_flag => fnd_api.g_true,
2933: x_txn_ii_rltns_tbl => o_ii_rltns_tbl,
2934: p_get_org_assgns_flag => fnd_api.g_true,
2928: p_get_parties_flag => fnd_api.g_true,
2929: x_txn_party_detail_tbl => o_pty_dtl_tbl,
2930: p_get_pty_accts_flag => fnd_api.g_true,
2931: x_txn_pty_acct_detail_tbl => o_pty_acct_tbl,
2932: p_get_ii_rltns_flag => fnd_api.g_true,
2933: x_txn_ii_rltns_tbl => o_ii_rltns_tbl,
2934: p_get_org_assgns_flag => fnd_api.g_true,
2935: x_txn_org_assgn_tbl => o_org_assgn_tbl,
2936: p_get_ext_attrib_vals_flag => fnd_api.g_true,
2930: p_get_pty_accts_flag => fnd_api.g_true,
2931: x_txn_pty_acct_detail_tbl => o_pty_acct_tbl,
2932: p_get_ii_rltns_flag => fnd_api.g_true,
2933: x_txn_ii_rltns_tbl => o_ii_rltns_tbl,
2934: p_get_org_assgns_flag => fnd_api.g_true,
2935: x_txn_org_assgn_tbl => o_org_assgn_tbl,
2936: p_get_ext_attrib_vals_flag => fnd_api.g_true,
2937: x_txn_ext_attrib_vals_tbl => o_ext_attrib_tbl,
2938: p_get_csi_attribs_flag => fnd_api.g_false,
2932: p_get_ii_rltns_flag => fnd_api.g_true,
2933: x_txn_ii_rltns_tbl => o_ii_rltns_tbl,
2934: p_get_org_assgns_flag => fnd_api.g_true,
2935: x_txn_org_assgn_tbl => o_org_assgn_tbl,
2936: p_get_ext_attrib_vals_flag => fnd_api.g_true,
2937: x_txn_ext_attrib_vals_tbl => o_ext_attrib_tbl,
2938: p_get_csi_attribs_flag => fnd_api.g_false,
2939: x_csi_ext_attribs_tbl => o_csi_ea_tbl,
2940: p_get_csi_iea_values_flag => fnd_api.g_false,
2934: p_get_org_assgns_flag => fnd_api.g_true,
2935: x_txn_org_assgn_tbl => o_org_assgn_tbl,
2936: p_get_ext_attrib_vals_flag => fnd_api.g_true,
2937: x_txn_ext_attrib_vals_tbl => o_ext_attrib_tbl,
2938: p_get_csi_attribs_flag => fnd_api.g_false,
2939: x_csi_ext_attribs_tbl => o_csi_ea_tbl,
2940: p_get_csi_iea_values_flag => fnd_api.g_false,
2941: x_csi_iea_values_tbl => o_csi_eav_tbl,
2942: p_get_txn_systems_flag => fnd_api.g_false,
2936: p_get_ext_attrib_vals_flag => fnd_api.g_true,
2937: x_txn_ext_attrib_vals_tbl => o_ext_attrib_tbl,
2938: p_get_csi_attribs_flag => fnd_api.g_false,
2939: x_csi_ext_attribs_tbl => o_csi_ea_tbl,
2940: p_get_csi_iea_values_flag => fnd_api.g_false,
2941: x_csi_iea_values_tbl => o_csi_eav_tbl,
2942: p_get_txn_systems_flag => fnd_api.g_false,
2943: x_txn_systems_tbl => o_txn_systems_tbl,
2944: x_return_status => l_return_status,
2938: p_get_csi_attribs_flag => fnd_api.g_false,
2939: x_csi_ext_attribs_tbl => o_csi_ea_tbl,
2940: p_get_csi_iea_values_flag => fnd_api.g_false,
2941: x_csi_iea_values_tbl => o_csi_eav_tbl,
2942: p_get_txn_systems_flag => fnd_api.g_false,
2943: x_txn_systems_tbl => o_txn_systems_tbl,
2944: x_return_status => l_return_status,
2945: x_msg_count => l_msg_count,
2946: x_msg_data => l_msg_data);
2944: x_return_status => l_return_status,
2945: x_msg_count => l_msg_count,
2946: x_msg_data => l_msg_data);
2947:
2948: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2949: RAISE fnd_api.g_exc_error;
2950: END IF;
2951:
2952:
2945: x_msg_count => l_msg_count,
2946: x_msg_data => l_msg_data);
2947:
2948: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2949: RAISE fnd_api.g_exc_error;
2950: END IF;
2951:
2952:
2953: debug('after csi_t_txn_details_grp.get_transaction_details for splitting ');
2987:
2988: l_line_dtl_rec := l_line_dtl_tbl(1);
2989:
2990: --l_line_dtl_rec.source_txn_line_detail_id := tld_rec.source_txn_line_detail_id;
2991: l_line_dtl_rec.txn_line_detail_id := fnd_api.g_miss_num;
2992: l_line_dtl_rec.transaction_system_id := tld_rec.transaction_system_id;
2993: l_line_dtl_rec.csi_system_id := tld_rec.csi_system_id;
2994: l_line_dtl_rec.quantity := 1 ;
2995: l_line_dtl_rec.transaction_line_id := tld_rec.transaction_line_id ;
2995: l_line_dtl_rec.transaction_line_id := tld_rec.transaction_line_id ;
2996:
2997: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
2998: p_api_version => 1.0,
2999: p_commit => fnd_api.g_false,
3000: p_init_msg_list => fnd_api.g_true,
3001: p_validation_level => fnd_api.g_valid_level_full,
3002: p_txn_line_dtl_index => 1,
3003: p_txn_line_dtl_rec => l_line_dtl_rec,
2996:
2997: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
2998: p_api_version => 1.0,
2999: p_commit => fnd_api.g_false,
3000: p_init_msg_list => fnd_api.g_true,
3001: p_validation_level => fnd_api.g_valid_level_full,
3002: p_txn_line_dtl_index => 1,
3003: p_txn_line_dtl_rec => l_line_dtl_rec,
3004: px_txn_party_dtl_tbl => l_pty_dtl_tbl,
2997: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
2998: p_api_version => 1.0,
2999: p_commit => fnd_api.g_false,
3000: p_init_msg_list => fnd_api.g_true,
3001: p_validation_level => fnd_api.g_valid_level_full,
3002: p_txn_line_dtl_index => 1,
3003: p_txn_line_dtl_rec => l_line_dtl_rec,
3004: px_txn_party_dtl_tbl => l_pty_dtl_tbl,
3005: px_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3009: x_return_status => l_return_status,
3010: x_msg_count => l_msg_count,
3011: x_msg_data => l_msg_data);
3012:
3013: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3014: RAISE fnd_api.g_exc_error;
3015: END IF;
3016:
3017: END LOOP;
3010: x_msg_count => l_msg_count,
3011: x_msg_data => l_msg_data);
3012:
3013: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3014: RAISE fnd_api.g_exc_error;
3015: END IF;
3016:
3017: END LOOP;
3018: END IF; -- count chk
3018: END IF; -- count chk
3019: END LOOP;
3020:
3021: EXCEPTION
3022: WHEN fnd_api.g_exc_error THEN
3023: x_return_status := fnd_api.g_ret_sts_error ;
3024: WHEN fnd_api.g_exc_unexpected_error THEN
3025: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3026: END create_txn_dtls;
3019: END LOOP;
3020:
3021: EXCEPTION
3022: WHEN fnd_api.g_exc_error THEN
3023: x_return_status := fnd_api.g_ret_sts_error ;
3024: WHEN fnd_api.g_exc_unexpected_error THEN
3025: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3026: END create_txn_dtls;
3027:
3020:
3021: EXCEPTION
3022: WHEN fnd_api.g_exc_error THEN
3023: x_return_status := fnd_api.g_ret_sts_error ;
3024: WHEN fnd_api.g_exc_unexpected_error THEN
3025: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3026: END create_txn_dtls;
3027:
3028: PROCEDURE conv_to_prim_uom(
3021: EXCEPTION
3022: WHEN fnd_api.g_exc_error THEN
3023: x_return_status := fnd_api.g_ret_sts_error ;
3024: WHEN fnd_api.g_exc_unexpected_error THEN
3025: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3026: END create_txn_dtls;
3027:
3028: PROCEDURE conv_to_prim_uom(
3029: p_inv_organization_id IN NUMBER,
3038:
3039: api_log('conv_to_prim_uom');
3040:
3041: /* Initialize API return status to success */
3042: x_return_status := fnd_api.g_ret_sts_success;
3043:
3044: l_primary_uom := csi_utl_pkg.get_primay_uom(
3045: p_inv_item_id => p_inventory_item_id,
3046: p_inv_org_id => p_inv_organization_id);
3057: debug('UOM Rate :'||l_uom_rate);
3058:
3059: IF l_uom_rate = -99999 THEN
3060: debug('inv_convert.inv_um_conversion failed ');
3061: RAISE fnd_api.g_exc_error;
3062: END IF;
3063:
3064: IF x_txn_line_dtl_tbl.count > 0 THEN
3065: FOR i in x_txn_line_dtl_tbl.first..x_txn_line_dtl_tbl.last
3068: END LOOP;
3069: END IF;
3070:
3071: EXCEPTION
3072: WHEN fnd_api.g_exc_error THEN
3073: x_return_status := fnd_api.g_ret_sts_error ;
3074: WHEN fnd_api.g_exc_unexpected_error THEN
3075: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3076: END conv_to_prim_uom;
3069: END IF;
3070:
3071: EXCEPTION
3072: WHEN fnd_api.g_exc_error THEN
3073: x_return_status := fnd_api.g_ret_sts_error ;
3074: WHEN fnd_api.g_exc_unexpected_error THEN
3075: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3076: END conv_to_prim_uom;
3077:
3070:
3071: EXCEPTION
3072: WHEN fnd_api.g_exc_error THEN
3073: x_return_status := fnd_api.g_ret_sts_error ;
3074: WHEN fnd_api.g_exc_unexpected_error THEN
3075: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3076: END conv_to_prim_uom;
3077:
3078: PROCEDURE build_non_source_rec(
3071: EXCEPTION
3072: WHEN fnd_api.g_exc_error THEN
3073: x_return_status := fnd_api.g_ret_sts_error ;
3074: WHEN fnd_api.g_exc_unexpected_error THEN
3075: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3076: END conv_to_prim_uom;
3077:
3078: PROCEDURE build_non_source_rec(
3079: p_transaction_line_id IN number,
3101: l_n_org_assgn_tbl csi_t_datastructures_grp.txn_org_assgn_tbl;
3102: l_n_ext_attrib_tbl csi_t_datastructures_grp.txn_ext_attrib_vals_tbl;
3103: l_n_ii_rltns_tbl csi_t_datastructures_grp.txn_ii_rltns_tbl;
3104:
3105: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
3106: l_msg_count number;
3107: l_msg_data varchar2(4000);
3108:
3109: BEGIN
3107: l_msg_data varchar2(4000);
3108:
3109: BEGIN
3110:
3111: x_return_status := fnd_api.g_ret_sts_success;
3112:
3113: api_log('build_non_source_rec');
3114:
3115: l_g_instance_rec.instance_id := p_instance_id;
3120:
3121: -- get the instance party and party account info
3122: csi_item_instance_pub.get_item_instance_details(
3123: p_api_version => 1.0,
3124: p_commit => fnd_api.g_false,
3125: p_init_msg_list => fnd_api.g_true,
3126: p_validation_level => fnd_api.g_valid_level_full,
3127: p_instance_rec => l_g_instance_rec,
3128: p_get_parties => fnd_api.g_false,
3121: -- get the instance party and party account info
3122: csi_item_instance_pub.get_item_instance_details(
3123: p_api_version => 1.0,
3124: p_commit => fnd_api.g_false,
3125: p_init_msg_list => fnd_api.g_true,
3126: p_validation_level => fnd_api.g_valid_level_full,
3127: p_instance_rec => l_g_instance_rec,
3128: p_get_parties => fnd_api.g_false,
3129: p_party_header_tbl => l_g_ph_tbl,
3122: csi_item_instance_pub.get_item_instance_details(
3123: p_api_version => 1.0,
3124: p_commit => fnd_api.g_false,
3125: p_init_msg_list => fnd_api.g_true,
3126: p_validation_level => fnd_api.g_valid_level_full,
3127: p_instance_rec => l_g_instance_rec,
3128: p_get_parties => fnd_api.g_false,
3129: p_party_header_tbl => l_g_ph_tbl,
3130: p_get_accounts => fnd_api.g_false,
3124: p_commit => fnd_api.g_false,
3125: p_init_msg_list => fnd_api.g_true,
3126: p_validation_level => fnd_api.g_valid_level_full,
3127: p_instance_rec => l_g_instance_rec,
3128: p_get_parties => fnd_api.g_false,
3129: p_party_header_tbl => l_g_ph_tbl,
3130: p_get_accounts => fnd_api.g_false,
3131: p_account_header_tbl => l_g_pah_tbl,
3132: p_get_org_assignments => fnd_api.g_false,
3126: p_validation_level => fnd_api.g_valid_level_full,
3127: p_instance_rec => l_g_instance_rec,
3128: p_get_parties => fnd_api.g_false,
3129: p_party_header_tbl => l_g_ph_tbl,
3130: p_get_accounts => fnd_api.g_false,
3131: p_account_header_tbl => l_g_pah_tbl,
3132: p_get_org_assignments => fnd_api.g_false,
3133: p_org_header_tbl => l_g_ouh_tbl,
3134: p_get_pricing_attribs => fnd_api.g_false,
3128: p_get_parties => fnd_api.g_false,
3129: p_party_header_tbl => l_g_ph_tbl,
3130: p_get_accounts => fnd_api.g_false,
3131: p_account_header_tbl => l_g_pah_tbl,
3132: p_get_org_assignments => fnd_api.g_false,
3133: p_org_header_tbl => l_g_ouh_tbl,
3134: p_get_pricing_attribs => fnd_api.g_false,
3135: p_pricing_attrib_tbl => l_g_pa_tbl,
3136: p_get_ext_attribs => fnd_api.g_false,
3130: p_get_accounts => fnd_api.g_false,
3131: p_account_header_tbl => l_g_pah_tbl,
3132: p_get_org_assignments => fnd_api.g_false,
3133: p_org_header_tbl => l_g_ouh_tbl,
3134: p_get_pricing_attribs => fnd_api.g_false,
3135: p_pricing_attrib_tbl => l_g_pa_tbl,
3136: p_get_ext_attribs => fnd_api.g_false,
3137: p_ext_attrib_tbl => l_g_eav_tbl,
3138: p_ext_attrib_def_tbl => l_g_ea_tbl,
3132: p_get_org_assignments => fnd_api.g_false,
3133: p_org_header_tbl => l_g_ouh_tbl,
3134: p_get_pricing_attribs => fnd_api.g_false,
3135: p_pricing_attrib_tbl => l_g_pa_tbl,
3136: p_get_ext_attribs => fnd_api.g_false,
3137: p_ext_attrib_tbl => l_g_eav_tbl,
3138: p_ext_attrib_def_tbl => l_g_ea_tbl,
3139: p_get_asset_assignments => fnd_api.g_false,
3140: p_asset_header_tbl => l_g_iah_tbl,
3135: p_pricing_attrib_tbl => l_g_pa_tbl,
3136: p_get_ext_attribs => fnd_api.g_false,
3137: p_ext_attrib_tbl => l_g_eav_tbl,
3138: p_ext_attrib_def_tbl => l_g_ea_tbl,
3139: p_get_asset_assignments => fnd_api.g_false,
3140: p_asset_header_tbl => l_g_iah_tbl,
3141: p_time_stamp => l_g_time_stamp,
3142: x_return_status => l_return_status,
3143: x_msg_count => l_msg_count,
3142: x_return_status => l_return_status,
3143: x_msg_count => l_msg_count,
3144: x_msg_data => l_msg_data);
3145:
3146: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3147: RAISE fnd_api.g_exc_error;
3148: END IF;
3149:
3150: l_n_line_dtl_rec.txn_line_detail_id := fnd_api.g_miss_num;
3143: x_msg_count => l_msg_count,
3144: x_msg_data => l_msg_data);
3145:
3146: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3147: RAISE fnd_api.g_exc_error;
3148: END IF;
3149:
3150: l_n_line_dtl_rec.txn_line_detail_id := fnd_api.g_miss_num;
3151: l_n_line_dtl_rec.transaction_line_id := p_transaction_line_id;
3146: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3147: RAISE fnd_api.g_exc_error;
3148: END IF;
3149:
3150: l_n_line_dtl_rec.txn_line_detail_id := fnd_api.g_miss_num;
3151: l_n_line_dtl_rec.transaction_line_id := p_transaction_line_id;
3152: l_n_line_dtl_rec.sub_type_id := csi_order_ship_pub.g_dflt_sub_type_id;
3153: l_n_line_dtl_rec.processing_status := 'IN_PROCESS';
3154: l_n_line_dtl_rec.source_transaction_flag := 'N';
3172: l_n_line_dtl_rec.object_version_number := 1.0;
3173:
3174: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
3175: p_api_version => 1.0,
3176: p_commit => fnd_api.g_false,
3177: p_init_msg_list => fnd_api.g_true,
3178: p_validation_level => fnd_api.g_valid_level_full,
3179: p_txn_line_dtl_index => 1,
3180: p_txn_line_dtl_rec => l_n_line_dtl_rec,
3173:
3174: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
3175: p_api_version => 1.0,
3176: p_commit => fnd_api.g_false,
3177: p_init_msg_list => fnd_api.g_true,
3178: p_validation_level => fnd_api.g_valid_level_full,
3179: p_txn_line_dtl_index => 1,
3180: p_txn_line_dtl_rec => l_n_line_dtl_rec,
3181: px_txn_party_dtl_tbl => l_n_pty_dtl_tbl,
3174: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
3175: p_api_version => 1.0,
3176: p_commit => fnd_api.g_false,
3177: p_init_msg_list => fnd_api.g_true,
3178: p_validation_level => fnd_api.g_valid_level_full,
3179: p_txn_line_dtl_index => 1,
3180: p_txn_line_dtl_rec => l_n_line_dtl_rec,
3181: px_txn_party_dtl_tbl => l_n_pty_dtl_tbl,
3182: px_txn_pty_acct_detail_tbl => l_n_pty_acct_tbl,
3186: x_return_status => l_return_status,
3187: x_msg_count => l_msg_count,
3188: x_msg_data => l_msg_data);
3189:
3190: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3191: RAISE fnd_api.g_exc_error;
3192: END IF;
3193:
3194: debug('Non Source Txn Line Detail ID :'||l_n_line_dtl_rec.txn_line_detail_id);
3187: x_msg_count => l_msg_count,
3188: x_msg_data => l_msg_data);
3189:
3190: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3191: RAISE fnd_api.g_exc_error;
3192: END IF;
3193:
3194: debug('Non Source Txn Line Detail ID :'||l_n_line_dtl_rec.txn_line_detail_id);
3195: x_txn_line_dtl_id := l_n_line_dtl_rec.txn_line_detail_id;
3194: debug('Non Source Txn Line Detail ID :'||l_n_line_dtl_rec.txn_line_detail_id);
3195: x_txn_line_dtl_id := l_n_line_dtl_rec.txn_line_detail_id;
3196:
3197: EXCEPTION
3198: WHEN fnd_api.g_exc_error THEN
3199: x_return_status := fnd_api.g_ret_sts_error;
3200: END build_non_source_rec;
3201:
3202: PROCEDURE build_parent_relation(
3195: x_txn_line_dtl_id := l_n_line_dtl_rec.txn_line_detail_id;
3196:
3197: EXCEPTION
3198: WHEN fnd_api.g_exc_error THEN
3199: x_return_status := fnd_api.g_ret_sts_error;
3200: END build_non_source_rec;
3201:
3202: PROCEDURE build_parent_relation(
3203: p_order_line_rec IN csi_order_ship_pub.order_line_rec,
3209: l_txn_ii number := 0;
3210: l_nsrc_line_dtl_id number;
3211: x_txn_line_dtls_lst txn_line_dtl_tbl;
3212: l_txn_processed varchar2(1);
3213: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
3214:
3215: PROCEDURE filter_model_instances( --modified for bug5096435
3216: p_child_item_id IN number,
3217: px_model_inst_tbl IN OUT NOCOPY csi_order_ship_pub.model_inst_tbl)
3244:
3245: api_log('build_parent_relation');
3246:
3247: /* Initialize API return status to success */
3248: x_return_status := fnd_api.g_ret_sts_success;
3249:
3250: x_txn_ii_rltns_tbl.delete;
3251:
3252: filter_model_instances(
3264: p_instance_id => x_model_inst_tbl(l_mod).instance_id,
3265: x_txn_line_dtl_id => l_nsrc_line_dtl_id,
3266: x_return_status => l_return_status);
3267:
3268: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3269: RAISE fnd_api.g_exc_error;
3270: END IF;
3271:
3272: x_model_inst_tbl(l_mod).txn_line_detail_id := l_nsrc_line_dtl_id;
3265: x_txn_line_dtl_id => l_nsrc_line_dtl_id,
3266: x_return_status => l_return_status);
3267:
3268: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3269: RAISE fnd_api.g_exc_error;
3270: END IF;
3271:
3272: x_model_inst_tbl(l_mod).txn_line_detail_id := l_nsrc_line_dtl_id;
3273: END LOOP;
3286: p_instance_id => x_model_inst_tbl(1).instance_id,
3287: x_txn_line_dtl_id => l_nsrc_line_dtl_id,
3288: x_return_status => l_return_status);
3289:
3290: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3291: RAISE fnd_api.g_exc_error;
3292: END IF;
3293:
3294: x_model_inst_tbl(1).txn_line_detail_id := l_nsrc_line_dtl_id;
3287: x_txn_line_dtl_id => l_nsrc_line_dtl_id,
3288: x_return_status => l_return_status);
3289:
3290: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3291: RAISE fnd_api.g_exc_error;
3292: END IF;
3293:
3294: x_model_inst_tbl(1).txn_line_detail_id := l_nsrc_line_dtl_id;
3295:
3300: x_txn_ii_rltns_tbl(l_txn_ii).transaction_line_id := x_txn_line_dtl_tbl(l_ind).transaction_line_id;
3301: x_txn_ii_rltns_tbl(l_txn_ii).relationship_type_code := 'COMPONENT-OF';
3302: x_txn_ii_rltns_tbl(l_txn_ii).object_id := x_model_inst_tbl(1).txn_line_detail_id;
3303: x_txn_ii_rltns_tbl(l_txn_ii).subject_id := x_txn_line_dtl_tbl(l_ind).txn_line_detail_id ;
3304: x_txn_ii_rltns_tbl(l_txn_ii).active_start_date := sysdate;--FND_API.G_MISS_DATE;
3305:
3306: -- mark the model instance that it is processed
3307: x_model_inst_tbl(1).process_flag := 'Y';
3308:
3332: p_instance_id => x_model_inst_tbl(k).instance_id,
3333: x_txn_line_dtl_id => l_nsrc_line_dtl_id,
3334: x_return_status => l_return_status);
3335:
3336: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3337: RAISE fnd_api.g_exc_error;
3338: END IF;
3339:
3340: x_model_inst_tbl(k).txn_line_detail_id := l_nsrc_line_dtl_id;
3333: x_txn_line_dtl_id => l_nsrc_line_dtl_id,
3334: x_return_status => l_return_status);
3335:
3336: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3337: RAISE fnd_api.g_exc_error;
3338: END IF;
3339:
3340: x_model_inst_tbl(k).txn_line_detail_id := l_nsrc_line_dtl_id;
3341:
3345: x_txn_ii_rltns_tbl(l_txn_ii).transaction_line_id := x_txn_line_dtl_tbl(l_ind).transaction_line_id;
3346: x_txn_ii_rltns_tbl(l_txn_ii).relationship_type_code := 'COMPONENT-OF';
3347: x_txn_ii_rltns_tbl(l_txn_ii).object_id := x_model_inst_tbl(k).txn_line_detail_id;
3348: x_txn_ii_rltns_tbl(l_txn_ii).subject_id := x_txn_line_dtl_tbl(l_ind).txn_line_detail_id ;
3349: x_txn_ii_rltns_tbl(l_txn_ii).active_start_date := sysdate;--FND_API.G_MISS_DATE;
3350:
3351: -- mark the model instance that it is processed
3352: x_model_inst_tbl(k).process_flag := 'Y';
3353:
3383: p_instance_id => x_model_inst_tbl(j).instance_id,
3384: x_txn_line_dtl_id => l_nsrc_line_dtl_id,
3385: x_return_status => l_return_status);
3386:
3387: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3388: RAISE fnd_api.g_exc_error;
3389: END IF;
3390:
3391: x_model_inst_tbl(j).txn_line_detail_id := l_nsrc_line_dtl_id;
3384: x_txn_line_dtl_id => l_nsrc_line_dtl_id,
3385: x_return_status => l_return_status);
3386:
3387: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3388: RAISE fnd_api.g_exc_error;
3389: END IF;
3390:
3391: x_model_inst_tbl(j).txn_line_detail_id := l_nsrc_line_dtl_id;
3392:
3397: x_txn_ii_rltns_tbl(l_txn_ii).transaction_line_id := x_txn_line_dtl_tbl(l_ind).transaction_line_id;
3398: x_txn_ii_rltns_tbl(l_txn_ii).relationship_type_code := 'COMPONENT-OF';
3399: x_txn_ii_rltns_tbl(l_txn_ii).subject_id := x_txn_line_dtl_tbl(l_ind).txn_line_detail_id;
3400: x_txn_ii_rltns_tbl(l_txn_ii).object_id := x_model_inst_tbl(j).txn_line_detail_id;
3401: x_txn_ii_rltns_tbl(l_txn_ii).active_start_date := sysdate;--FND_API.G_MISS_DATE;
3402:
3403: x_model_inst_tbl(j).rem_qty := x_model_inst_tbl(j).rem_qty - x_txn_line_dtl_tbl(l_ind).quantity;
3404:
3405: l_txn_processed := 'Y';
3430: split_txn_dtl_id => x_txn_line_dtl_tbl(l_ind).txn_line_detail_id,
3431: x_txn_line_dtls_lst => x_txn_line_dtls_lst,
3432: x_return_status => l_return_status );
3433:
3434: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3435: debug('split_txn_dtls failed ');
3436: RAISE fnd_api.g_exc_error;
3437: END IF;
3438: END IF;
3432: x_return_status => l_return_status );
3433:
3434: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3435: debug('split_txn_dtls failed ');
3436: RAISE fnd_api.g_exc_error;
3437: END IF;
3438: END IF;
3439:
3440: debug('x_txn_line_dtls_lst.count ='||x_txn_line_dtls_lst.count);
3455: p_instance_id => x_model_inst_tbl(j).instance_id,
3456: x_txn_line_dtl_id => l_nsrc_line_dtl_id,
3457: x_return_status => l_return_status);
3458:
3459: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3460: RAISE fnd_api.g_exc_error;
3461: END IF;
3462:
3463: x_model_inst_tbl(j).txn_line_detail_id := l_nsrc_line_dtl_id;
3456: x_txn_line_dtl_id => l_nsrc_line_dtl_id,
3457: x_return_status => l_return_status);
3458:
3459: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3460: RAISE fnd_api.g_exc_error;
3461: END IF;
3462:
3463: x_model_inst_tbl(j).txn_line_detail_id := l_nsrc_line_dtl_id;
3464:
3469: x_txn_ii_rltns_tbl(l_txn_ii).transaction_line_id := x_txn_line_dtl_tbl(l_ind).transaction_line_id;
3470: x_txn_ii_rltns_tbl(l_txn_ii).relationship_type_code := 'COMPONENT-OF';
3471: x_txn_ii_rltns_tbl(l_txn_ii).subject_id := x_txn_line_dtls_lst(x_txn).txn_line_detail_id;
3472: x_txn_ii_rltns_tbl(l_txn_ii).object_id := x_model_inst_tbl(j).txn_line_detail_id;
3473: x_txn_ii_rltns_tbl(l_txn_ii).active_start_date := sysdate;--FND_API.G_MISS_DATE;
3474:
3475: x_model_inst_tbl(j).rem_qty := x_model_inst_tbl(j).rem_qty - 1;
3476:
3477: ---Added (Start) for m-to-m enhancements
3506:
3507: debug('x_txn_ii_rltns_tbl.count ='||x_txn_ii_rltns_tbl.count );
3508:
3509: EXCEPTION
3510: WHEN fnd_api.g_exc_error THEN
3511: x_return_status := fnd_api.g_ret_sts_error ;
3512: WHEN fnd_api.g_exc_unexpected_error THEN
3513: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3514: END build_parent_relation;
3507: debug('x_txn_ii_rltns_tbl.count ='||x_txn_ii_rltns_tbl.count );
3508:
3509: EXCEPTION
3510: WHEN fnd_api.g_exc_error THEN
3511: x_return_status := fnd_api.g_ret_sts_error ;
3512: WHEN fnd_api.g_exc_unexpected_error THEN
3513: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3514: END build_parent_relation;
3515:
3508:
3509: EXCEPTION
3510: WHEN fnd_api.g_exc_error THEN
3511: x_return_status := fnd_api.g_ret_sts_error ;
3512: WHEN fnd_api.g_exc_unexpected_error THEN
3513: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3514: END build_parent_relation;
3515:
3516:
3509: EXCEPTION
3510: WHEN fnd_api.g_exc_error THEN
3511: x_return_status := fnd_api.g_ret_sts_error ;
3512: WHEN fnd_api.g_exc_unexpected_error THEN
3513: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3514: END build_parent_relation;
3515:
3516:
3517: PROCEDURE get_source_trx_dtls(
3549:
3550: debug(' Order Number :'||x_mtl_txn_rec.source_header_ref);
3551: debug(' Line Number :'||x_mtl_txn_rec.source_line_ref);
3552:
3553: x_return_status := fnd_api.g_ret_sts_success;
3554:
3555: EXCEPTION
3556: WHEN no_data_found THEN
3557: x_return_status := fnd_api.g_ret_sts_error;
3553: x_return_status := fnd_api.g_ret_sts_success;
3554:
3555: EXCEPTION
3556: WHEN no_data_found THEN
3557: x_return_status := fnd_api.g_ret_sts_error;
3558: fnd_message.set_name('CSI','CSI_INT_ORD_LINE_MISSING');
3559: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_transaction_id);
3560: fnd_msg_pub.add;
3561: END get_source_trx_dtls;
3579: l_csi_eav_tbl csi_t_datastructures_grp.csi_ext_attrib_vals_tbl;
3580: l_txn_systems_tbl csi_t_datastructures_grp.txn_systems_tbl;
3581: l_transaction_line_id number;
3582:
3583: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
3584: l_msg_count number;
3585: l_msg_data varchar2(2000);
3586:
3587: BEGIN
3587: BEGIN
3588:
3589: api_log('split_txn_dtls_with_qty');
3590:
3591: x_return_status := fnd_api.g_ret_sts_success;
3592:
3593:
3594: l_txn_line_detail_query_rec.txn_line_detail_id := split_txn_dtl_id;
3595:
3594: l_txn_line_detail_query_rec.txn_line_detail_id := split_txn_dtl_id;
3595:
3596: csi_t_txn_details_grp.get_transaction_details(
3597: p_api_version => 1.0,
3598: p_commit => fnd_api.g_false,
3599: p_init_msg_list => fnd_api.g_true,
3600: p_validation_level => fnd_api.g_valid_level_full,
3601: p_txn_line_query_rec => l_txn_line_query_rec,
3602: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
3595:
3596: csi_t_txn_details_grp.get_transaction_details(
3597: p_api_version => 1.0,
3598: p_commit => fnd_api.g_false,
3599: p_init_msg_list => fnd_api.g_true,
3600: p_validation_level => fnd_api.g_valid_level_full,
3601: p_txn_line_query_rec => l_txn_line_query_rec,
3602: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
3603: x_txn_line_detail_tbl => l_line_dtl_tbl,
3596: csi_t_txn_details_grp.get_transaction_details(
3597: p_api_version => 1.0,
3598: p_commit => fnd_api.g_false,
3599: p_init_msg_list => fnd_api.g_true,
3600: p_validation_level => fnd_api.g_valid_level_full,
3601: p_txn_line_query_rec => l_txn_line_query_rec,
3602: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
3603: x_txn_line_detail_tbl => l_line_dtl_tbl,
3604: p_get_parties_flag => fnd_api.g_true,
3600: p_validation_level => fnd_api.g_valid_level_full,
3601: p_txn_line_query_rec => l_txn_line_query_rec,
3602: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
3603: x_txn_line_detail_tbl => l_line_dtl_tbl,
3604: p_get_parties_flag => fnd_api.g_true,
3605: x_txn_party_detail_tbl => l_pty_dtl_tbl,
3606: p_get_pty_accts_flag => fnd_api.g_true,
3607: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3608: p_get_ii_rltns_flag => fnd_api.g_false,
3602: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
3603: x_txn_line_detail_tbl => l_line_dtl_tbl,
3604: p_get_parties_flag => fnd_api.g_true,
3605: x_txn_party_detail_tbl => l_pty_dtl_tbl,
3606: p_get_pty_accts_flag => fnd_api.g_true,
3607: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3608: p_get_ii_rltns_flag => fnd_api.g_false,
3609: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
3610: p_get_org_assgns_flag => fnd_api.g_true,
3604: p_get_parties_flag => fnd_api.g_true,
3605: x_txn_party_detail_tbl => l_pty_dtl_tbl,
3606: p_get_pty_accts_flag => fnd_api.g_true,
3607: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3608: p_get_ii_rltns_flag => fnd_api.g_false,
3609: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
3610: p_get_org_assgns_flag => fnd_api.g_true,
3611: x_txn_org_assgn_tbl => l_org_assgn_tbl,
3612: p_get_ext_attrib_vals_flag => fnd_api.g_true,
3606: p_get_pty_accts_flag => fnd_api.g_true,
3607: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3608: p_get_ii_rltns_flag => fnd_api.g_false,
3609: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
3610: p_get_org_assgns_flag => fnd_api.g_true,
3611: x_txn_org_assgn_tbl => l_org_assgn_tbl,
3612: p_get_ext_attrib_vals_flag => fnd_api.g_true,
3613: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
3614: p_get_csi_attribs_flag => fnd_api.g_false,
3608: p_get_ii_rltns_flag => fnd_api.g_false,
3609: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
3610: p_get_org_assgns_flag => fnd_api.g_true,
3611: x_txn_org_assgn_tbl => l_org_assgn_tbl,
3612: p_get_ext_attrib_vals_flag => fnd_api.g_true,
3613: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
3614: p_get_csi_attribs_flag => fnd_api.g_false,
3615: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
3616: p_get_csi_iea_values_flag => fnd_api.g_false,
3610: p_get_org_assgns_flag => fnd_api.g_true,
3611: x_txn_org_assgn_tbl => l_org_assgn_tbl,
3612: p_get_ext_attrib_vals_flag => fnd_api.g_true,
3613: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
3614: p_get_csi_attribs_flag => fnd_api.g_false,
3615: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
3616: p_get_csi_iea_values_flag => fnd_api.g_false,
3617: x_csi_iea_values_tbl => l_csi_eav_tbl,
3618: p_get_txn_systems_flag => fnd_api.g_false,
3612: p_get_ext_attrib_vals_flag => fnd_api.g_true,
3613: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
3614: p_get_csi_attribs_flag => fnd_api.g_false,
3615: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
3616: p_get_csi_iea_values_flag => fnd_api.g_false,
3617: x_csi_iea_values_tbl => l_csi_eav_tbl,
3618: p_get_txn_systems_flag => fnd_api.g_false,
3619: x_txn_systems_tbl => l_txn_systems_tbl,
3620: x_return_status => l_return_status,
3614: p_get_csi_attribs_flag => fnd_api.g_false,
3615: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
3616: p_get_csi_iea_values_flag => fnd_api.g_false,
3617: x_csi_iea_values_tbl => l_csi_eav_tbl,
3618: p_get_txn_systems_flag => fnd_api.g_false,
3619: x_txn_systems_tbl => l_txn_systems_tbl,
3620: x_return_status => l_return_status,
3621: x_msg_count => l_msg_count,
3622: x_msg_data => l_msg_data);
3620: x_return_status => l_return_status,
3621: x_msg_count => l_msg_count,
3622: x_msg_data => l_msg_data);
3623:
3624: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3625: debug('Get_transaction_details failed ');
3626: RAISE fnd_api.g_exc_error;
3627: END IF;
3628:
3622: x_msg_data => l_msg_data);
3623:
3624: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3625: debug('Get_transaction_details failed ');
3626: RAISE fnd_api.g_exc_error;
3627: END IF;
3628:
3629: l_transaction_line_id := l_line_dtl_tbl(1).transaction_line_id;
3630:
3637: px_ext_attrib_tbl => l_ext_attrib_tbl,
3638: px_txn_systems_tbl => l_txn_systems_tbl);
3639:
3640: l_line_dtl_rec := l_line_dtl_tbl(1);
3641: l_line_dtl_rec.txn_line_detail_id := FND_API.G_MISS_NUM;
3642: l_line_dtl_rec.transaction_line_id := l_transaction_line_id;
3643: l_line_dtl_rec.quantity := p_split_qty ;
3644: l_line_dtl_rec.processing_status := 'SUBMIT';
3645:
3648:
3649:
3650: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
3651: p_api_version => 1.0,
3652: p_commit => fnd_api.g_false,
3653: p_init_msg_list => fnd_api.g_true,
3654: p_validation_level => fnd_api.g_valid_level_full,
3655: p_txn_line_dtl_index => 1,
3656: p_txn_line_dtl_rec => l_line_dtl_rec,
3649:
3650: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
3651: p_api_version => 1.0,
3652: p_commit => fnd_api.g_false,
3653: p_init_msg_list => fnd_api.g_true,
3654: p_validation_level => fnd_api.g_valid_level_full,
3655: p_txn_line_dtl_index => 1,
3656: p_txn_line_dtl_rec => l_line_dtl_rec,
3657: px_txn_party_dtl_tbl => l_pty_dtl_tbl,
3650: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
3651: p_api_version => 1.0,
3652: p_commit => fnd_api.g_false,
3653: p_init_msg_list => fnd_api.g_true,
3654: p_validation_level => fnd_api.g_valid_level_full,
3655: p_txn_line_dtl_index => 1,
3656: p_txn_line_dtl_rec => l_line_dtl_rec,
3657: px_txn_party_dtl_tbl => l_pty_dtl_tbl,
3658: px_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3662: x_return_status => l_return_status,
3663: x_msg_count => l_msg_count,
3664: x_msg_data => l_msg_data);
3665:
3666: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3667: debug('Error Splitting txn line detail ');
3668: RAISE fnd_api.g_exc_error;
3669: END IF;
3670: EXCEPTION
3664: x_msg_data => l_msg_data);
3665:
3666: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3667: debug('Error Splitting txn line detail ');
3668: RAISE fnd_api.g_exc_error;
3669: END IF;
3670: EXCEPTION
3671: WHEN fnd_api.g_exc_error THEN
3672: x_return_status := fnd_api.g_ret_sts_error ;
3667: debug('Error Splitting txn line detail ');
3668: RAISE fnd_api.g_exc_error;
3669: END IF;
3670: EXCEPTION
3671: WHEN fnd_api.g_exc_error THEN
3672: x_return_status := fnd_api.g_ret_sts_error ;
3673: WHEN fnd_api.g_exc_unexpected_error THEN
3674: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3675: END split_txn_dtls_with_qty;
3668: RAISE fnd_api.g_exc_error;
3669: END IF;
3670: EXCEPTION
3671: WHEN fnd_api.g_exc_error THEN
3672: x_return_status := fnd_api.g_ret_sts_error ;
3673: WHEN fnd_api.g_exc_unexpected_error THEN
3674: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3675: END split_txn_dtls_with_qty;
3676:
3669: END IF;
3670: EXCEPTION
3671: WHEN fnd_api.g_exc_error THEN
3672: x_return_status := fnd_api.g_ret_sts_error ;
3673: WHEN fnd_api.g_exc_unexpected_error THEN
3674: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3675: END split_txn_dtls_with_qty;
3676:
3677:
3670: EXCEPTION
3671: WHEN fnd_api.g_exc_error THEN
3672: x_return_status := fnd_api.g_ret_sts_error ;
3673: WHEN fnd_api.g_exc_unexpected_error THEN
3674: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3675: END split_txn_dtls_with_qty;
3676:
3677:
3678: PROCEDURE split_txn_dtls(
3702: BEGIN
3703:
3704: api_log('split_txn_dtls');
3705:
3706: x_return_status := fnd_api.g_ret_sts_success;
3707:
3708: x_txn_line_dtls_lst.delete;
3709:
3710: l_txn_line_detail_query_rec.txn_line_detail_id := split_txn_dtl_id;
3710: l_txn_line_detail_query_rec.txn_line_detail_id := split_txn_dtl_id;
3711:
3712: csi_t_txn_details_grp.get_transaction_details(
3713: p_api_version => 1.0,
3714: p_commit => fnd_api.g_false,
3715: p_init_msg_list => fnd_api.g_true,
3716: p_validation_level => fnd_api.g_valid_level_full,
3717: p_txn_line_query_rec => l_txn_line_query_rec,
3718: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
3711:
3712: csi_t_txn_details_grp.get_transaction_details(
3713: p_api_version => 1.0,
3714: p_commit => fnd_api.g_false,
3715: p_init_msg_list => fnd_api.g_true,
3716: p_validation_level => fnd_api.g_valid_level_full,
3717: p_txn_line_query_rec => l_txn_line_query_rec,
3718: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
3719: x_txn_line_detail_tbl => l_line_dtl_tbl,
3712: csi_t_txn_details_grp.get_transaction_details(
3713: p_api_version => 1.0,
3714: p_commit => fnd_api.g_false,
3715: p_init_msg_list => fnd_api.g_true,
3716: p_validation_level => fnd_api.g_valid_level_full,
3717: p_txn_line_query_rec => l_txn_line_query_rec,
3718: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
3719: x_txn_line_detail_tbl => l_line_dtl_tbl,
3720: p_get_parties_flag => fnd_api.g_true,
3716: p_validation_level => fnd_api.g_valid_level_full,
3717: p_txn_line_query_rec => l_txn_line_query_rec,
3718: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
3719: x_txn_line_detail_tbl => l_line_dtl_tbl,
3720: p_get_parties_flag => fnd_api.g_true,
3721: x_txn_party_detail_tbl => l_pty_dtl_tbl,
3722: p_get_pty_accts_flag => fnd_api.g_true,
3723: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3724: p_get_ii_rltns_flag => fnd_api.g_false,
3718: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
3719: x_txn_line_detail_tbl => l_line_dtl_tbl,
3720: p_get_parties_flag => fnd_api.g_true,
3721: x_txn_party_detail_tbl => l_pty_dtl_tbl,
3722: p_get_pty_accts_flag => fnd_api.g_true,
3723: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3724: p_get_ii_rltns_flag => fnd_api.g_false,
3725: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
3726: p_get_org_assgns_flag => fnd_api.g_true,
3720: p_get_parties_flag => fnd_api.g_true,
3721: x_txn_party_detail_tbl => l_pty_dtl_tbl,
3722: p_get_pty_accts_flag => fnd_api.g_true,
3723: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3724: p_get_ii_rltns_flag => fnd_api.g_false,
3725: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
3726: p_get_org_assgns_flag => fnd_api.g_true,
3727: x_txn_org_assgn_tbl => l_org_assgn_tbl,
3728: p_get_ext_attrib_vals_flag => fnd_api.g_true,
3722: p_get_pty_accts_flag => fnd_api.g_true,
3723: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3724: p_get_ii_rltns_flag => fnd_api.g_false,
3725: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
3726: p_get_org_assgns_flag => fnd_api.g_true,
3727: x_txn_org_assgn_tbl => l_org_assgn_tbl,
3728: p_get_ext_attrib_vals_flag => fnd_api.g_true,
3729: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
3730: p_get_csi_attribs_flag => fnd_api.g_false,
3724: p_get_ii_rltns_flag => fnd_api.g_false,
3725: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
3726: p_get_org_assgns_flag => fnd_api.g_true,
3727: x_txn_org_assgn_tbl => l_org_assgn_tbl,
3728: p_get_ext_attrib_vals_flag => fnd_api.g_true,
3729: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
3730: p_get_csi_attribs_flag => fnd_api.g_false,
3731: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
3732: p_get_csi_iea_values_flag => fnd_api.g_false,
3726: p_get_org_assgns_flag => fnd_api.g_true,
3727: x_txn_org_assgn_tbl => l_org_assgn_tbl,
3728: p_get_ext_attrib_vals_flag => fnd_api.g_true,
3729: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
3730: p_get_csi_attribs_flag => fnd_api.g_false,
3731: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
3732: p_get_csi_iea_values_flag => fnd_api.g_false,
3733: x_csi_iea_values_tbl => l_csi_eav_tbl,
3734: p_get_txn_systems_flag => fnd_api.g_false,
3728: p_get_ext_attrib_vals_flag => fnd_api.g_true,
3729: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
3730: p_get_csi_attribs_flag => fnd_api.g_false,
3731: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
3732: p_get_csi_iea_values_flag => fnd_api.g_false,
3733: x_csi_iea_values_tbl => l_csi_eav_tbl,
3734: p_get_txn_systems_flag => fnd_api.g_false,
3735: x_txn_systems_tbl => l_txn_systems_tbl,
3736: x_return_status => x_return_status,
3730: p_get_csi_attribs_flag => fnd_api.g_false,
3731: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
3732: p_get_csi_iea_values_flag => fnd_api.g_false,
3733: x_csi_iea_values_tbl => l_csi_eav_tbl,
3734: p_get_txn_systems_flag => fnd_api.g_false,
3735: x_txn_systems_tbl => l_txn_systems_tbl,
3736: x_return_status => x_return_status,
3737: x_msg_count => x_msg_count,
3738: x_msg_data => x_msg_data);
3736: x_return_status => x_return_status,
3737: x_msg_count => x_msg_count,
3738: x_msg_data => x_msg_data);
3739:
3740: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3741: debug('Get_transaction_details failed ');
3742: RAISE fnd_api.g_exc_error;
3743: END IF;
3744:
3738: x_msg_data => x_msg_data);
3739:
3740: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3741: debug('Get_transaction_details failed ');
3742: RAISE fnd_api.g_exc_error;
3743: END IF;
3744:
3745: l_transaction_line_id := l_line_dtl_tbl(1).transaction_line_id;
3746:
3753: px_ext_attrib_tbl => l_ext_attrib_tbl,
3754: px_txn_systems_tbl => l_txn_systems_tbl);
3755:
3756: l_line_dtl_rec := l_line_dtl_tbl(1);
3757: l_line_dtl_rec.txn_line_detail_id := FND_API.G_MISS_NUM;
3758: l_line_dtl_rec.transaction_line_id := l_transaction_line_id;
3759: l_line_dtl_rec.quantity := 1 ;
3760: l_line_dtl_rec.processing_status := 'IN_PROCESS';
3761:
3771: LOOP
3772:
3773: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
3774: p_api_version => 1.0,
3775: p_commit => fnd_api.g_false,
3776: p_init_msg_list => fnd_api.g_true,
3777: p_validation_level => fnd_api.g_valid_level_full,
3778: p_txn_line_dtl_index => 1,
3779: p_txn_line_dtl_rec => l_line_dtl_rec,
3772:
3773: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
3774: p_api_version => 1.0,
3775: p_commit => fnd_api.g_false,
3776: p_init_msg_list => fnd_api.g_true,
3777: p_validation_level => fnd_api.g_valid_level_full,
3778: p_txn_line_dtl_index => 1,
3779: p_txn_line_dtl_rec => l_line_dtl_rec,
3780: px_txn_party_dtl_tbl => l_pty_dtl_tbl,
3773: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
3774: p_api_version => 1.0,
3775: p_commit => fnd_api.g_false,
3776: p_init_msg_list => fnd_api.g_true,
3777: p_validation_level => fnd_api.g_valid_level_full,
3778: p_txn_line_dtl_index => 1,
3779: p_txn_line_dtl_rec => l_line_dtl_rec,
3780: px_txn_party_dtl_tbl => l_pty_dtl_tbl,
3781: px_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
3785: x_return_status => x_return_status,
3786: x_msg_count => x_msg_count,
3787: x_msg_data => x_msg_data);
3788:
3789: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3790: debug('Error Splitting txn line detail ');
3791: RAISE fnd_api.g_exc_error;
3792: END IF;
3793:
3787: x_msg_data => x_msg_data);
3788:
3789: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3790: debug('Error Splitting txn line detail ');
3791: RAISE fnd_api.g_exc_error;
3792: END IF;
3793:
3794: x_txn_line_dtls_lst(x_txn_line_dtls_lst.count+1).txn_line_detail_id :=
3795: l_line_dtl_rec.txn_line_detail_id;
3805: px_ext_attrib_tbl => l_ext_attrib_tbl,
3806: px_txn_systems_tbl => l_txn_systems_tbl);
3807:
3808: l_line_dtl_rec := l_line_dtl_tbl(1);
3809: l_line_dtl_rec.txn_line_detail_id := FND_API.G_MISS_NUM;
3810: l_line_dtl_rec.transaction_line_id := l_transaction_line_id;
3811: l_line_dtl_rec.quantity := 1 ;
3812: l_line_dtl_rec.processing_status := 'IN_PROCESS';
3813:
3817: debug('No of txn line detail ='||x_txn_line_dtls_lst.count);
3818: debug('Txn line detail for Non Source created Successfully');
3819:
3820: EXCEPTION
3821: WHEN fnd_api.g_exc_error THEN
3822: x_return_status := fnd_api.g_ret_sts_error ;
3823: WHEN fnd_api.g_exc_unexpected_error THEN
3824: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3825: END split_txn_dtls;
3818: debug('Txn line detail for Non Source created Successfully');
3819:
3820: EXCEPTION
3821: WHEN fnd_api.g_exc_error THEN
3822: x_return_status := fnd_api.g_ret_sts_error ;
3823: WHEN fnd_api.g_exc_unexpected_error THEN
3824: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3825: END split_txn_dtls;
3826:
3819:
3820: EXCEPTION
3821: WHEN fnd_api.g_exc_error THEN
3822: x_return_status := fnd_api.g_ret_sts_error ;
3823: WHEN fnd_api.g_exc_unexpected_error THEN
3824: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3825: END split_txn_dtls;
3826:
3827: PROCEDURE get_system_tbl(
3820: EXCEPTION
3821: WHEN fnd_api.g_exc_error THEN
3822: x_return_status := fnd_api.g_ret_sts_error ;
3823: WHEN fnd_api.g_exc_unexpected_error THEN
3824: x_return_status := fnd_api.g_ret_sts_unexp_error ;
3825: END split_txn_dtls;
3826:
3827: PROCEDURE get_system_tbl(
3828: p_txn_systems_rec IN csi_t_datastructures_grp.txn_system_rec,
3863: x_cre_systems_rec.attribute12 := p_txn_systems_rec.attribute12;
3864: x_cre_systems_rec.attribute13 := p_txn_systems_rec.attribute13;
3865: x_cre_systems_rec.attribute14 := p_txn_systems_rec.attribute14;
3866: x_cre_systems_rec.attribute15 := p_txn_systems_rec.attribute15;
3867: x_cre_systems_rec.object_version_numbeR := fnd_api.g_miss_num;
3868:
3869: END get_system_tbl;
3870:
3871:
3886: BEGIN
3887:
3888: api_log('get_org_assignment_tbl');
3889:
3890: x_return_status := fnd_api.g_ret_sts_success;
3891:
3892: /* Build org_assignment table for create/update */
3893: IF p_txn_org_assgn_tbl.count > 0 THEN
3894: FOR j in p_txn_org_assgn_tbl.FIRST..p_txn_org_assgn_tbl.LAST LOOP
3894: FOR j in p_txn_org_assgn_tbl.FIRST..p_txn_org_assgn_tbl.LAST LOOP
3895:
3896: IF (p_txn_org_assgn_tbl(j).txn_line_detail_id = p_txn_line_detail_rec.txn_line_detail_id) AND
3897: (( NVL(p_txn_org_assgn_tbl(j).active_end_date,l_date) > sysdate ) OR
3898: (p_txn_org_assgn_tbl(j).active_end_date = FND_API.G_MISS_DATE )) THEN
3899:
3900:
3901: l_instance_ou_id := p_txn_org_assgn_tbl(j).instance_ou_id;
3902:
3899:
3900:
3901: l_instance_ou_id := p_txn_org_assgn_tbl(j).instance_ou_id;
3902:
3903: IF NVL(p_txn_org_assgn_tbl(j).instance_ou_id ,FND_API.G_MISS_NUM) = FND_API.G_MISS_NUM then
3904:
3905: /* there should be only one org assign rec for the alternate primary key
3906: this is a rectriction from the api
3907: */
3934: END;
3935: END;
3936: END IF;
3937:
3938: IF NVL(l_instance_ou_id,FND_API.G_MISS_NUM) <> FND_API.G_MISS_NUM then
3939:
3940: /* if the instance_ou_id does not exist then update for org_units */
3941: l_obj_ver_num := csi_utl_pkg.get_org_obj_ver_num(
3942: l_instance_ou_id);
3942: l_instance_ou_id);
3943:
3944: IF l_obj_ver_num = -1 THEN
3945: debug('csi_utl_pkg.get_org_obj_ver_num failed ');
3946: RAISE fnd_api.g_exc_error;
3947: END IF;
3948:
3949: x_upd_org_units_tbl(l_upd_org).instance_ou_id := l_instance_ou_id;
3950: x_upd_org_units_tbl(l_upd_org).instance_id := p_txn_line_detail_rec.instance_id;
3973: ELSE
3974:
3975: /* if instance_ou_id does exist then create for org assignment */
3976:
3977: x_cre_org_units_tbl(l_cre_org).instance_ou_id := FND_API.G_MISS_NUM;
3978: x_cre_org_units_tbl(l_cre_org).operating_unit_id := p_txn_org_assgn_tbl(j).operating_unit_id;
3979: x_cre_org_units_tbl(l_cre_org).instance_id := p_txn_line_detail_rec.instance_id;
3980: x_cre_org_units_tbl(l_cre_org).relationship_type_code := p_txn_org_assgn_tbl(j).relationship_type_code;
3981: x_cre_org_units_tbl(l_cre_org).active_start_date := FND_API.G_MISS_DATE ;
3977: x_cre_org_units_tbl(l_cre_org).instance_ou_id := FND_API.G_MISS_NUM;
3978: x_cre_org_units_tbl(l_cre_org).operating_unit_id := p_txn_org_assgn_tbl(j).operating_unit_id;
3979: x_cre_org_units_tbl(l_cre_org).instance_id := p_txn_line_detail_rec.instance_id;
3980: x_cre_org_units_tbl(l_cre_org).relationship_type_code := p_txn_org_assgn_tbl(j).relationship_type_code;
3981: x_cre_org_units_tbl(l_cre_org).active_start_date := FND_API.G_MISS_DATE ;
3982: x_cre_org_units_tbl(l_cre_org).active_end_date := p_txn_org_assgn_tbl(j).active_end_date;
3983: x_cre_org_units_tbl(l_cre_org).context := p_txn_org_assgn_tbl(j).context ;
3984: x_cre_org_units_tbl(l_cre_org).attribute1 := p_txn_org_assgn_tbl(j).attribute1 ;
3985: x_cre_org_units_tbl(l_cre_org).attribute2 := p_txn_org_assgn_tbl(j).attribute2 ;
3995: x_cre_org_units_tbl(l_cre_org).attribute12 := p_txn_org_assgn_tbl(j).attribute12;
3996: x_cre_org_units_tbl(l_cre_org).attribute13 := p_txn_org_assgn_tbl(j).attribute13;
3997: x_cre_org_units_tbl(l_cre_org).attribute14 := p_txn_org_assgn_tbl(j).attribute14;
3998: x_cre_org_units_tbl(l_cre_org).attribute15 := p_txn_org_assgn_tbl(j).attribute15 ;
3999: x_cre_org_units_tbl(l_cre_org).object_version_number := FND_API.G_MISS_NUM;
4000:
4001: l_cre_org := l_cre_org + 1;
4002: END IF; -- end if for instance_ou_id is not null
4003:
4006: END LOOP; -- end of org assignment table loop
4007: END IF;-- end of org assignment table count > 0
4008:
4009: EXCEPTION
4010: WHEN fnd_api.g_exc_error THEN
4011: x_return_status := fnd_api.g_ret_sts_error ;
4012: WHEN fnd_api.g_exc_unexpected_error THEN
4013: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4014: END get_org_assignment_tbl;
4007: END IF;-- end of org assignment table count > 0
4008:
4009: EXCEPTION
4010: WHEN fnd_api.g_exc_error THEN
4011: x_return_status := fnd_api.g_ret_sts_error ;
4012: WHEN fnd_api.g_exc_unexpected_error THEN
4013: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4014: END get_org_assignment_tbl;
4015:
4008:
4009: EXCEPTION
4010: WHEN fnd_api.g_exc_error THEN
4011: x_return_status := fnd_api.g_ret_sts_error ;
4012: WHEN fnd_api.g_exc_unexpected_error THEN
4013: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4014: END get_org_assignment_tbl;
4015:
4016: PROCEDURE get_ext_attribs_tbl(
4009: EXCEPTION
4010: WHEN fnd_api.g_exc_error THEN
4011: x_return_status := fnd_api.g_ret_sts_error ;
4012: WHEN fnd_api.g_exc_unexpected_error THEN
4013: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4014: END get_org_assignment_tbl;
4015:
4016: PROCEDURE get_ext_attribs_tbl(
4017: p_txn_line_detail_rec IN csi_t_datastructures_grp.txn_line_detail_rec,
4029: BEGIN
4030:
4031: api_log('get_ext_attribs_tbl');
4032:
4033: x_return_status := fnd_api.g_ret_sts_success;
4034:
4035: /* Build ext attribs table for create/update */
4036: IF p_txn_ext_attrib_vals_tbl.count > 0 THEN
4037: FOR j in p_txn_ext_attrib_vals_tbl.FIRST..p_txn_ext_attrib_vals_tbl.LAST LOOP
4037: FOR j in p_txn_ext_attrib_vals_tbl.FIRST..p_txn_ext_attrib_vals_tbl.LAST LOOP
4038:
4039: IF (p_txn_ext_attrib_vals_tbl(j).txn_line_detail_id = p_txn_line_detail_rec.txn_line_detail_id ) AND
4040: ((NVL(p_txn_ext_attrib_vals_tbl(j).active_end_date,l_date) > sysdate ) OR
4041: (p_txn_ext_attrib_vals_tbl(j).active_end_date = FND_API.G_MISS_DATE )) AND
4042: (p_txn_ext_attrib_vals_tbl(j).PROCESS_FLAG = 'Y') THEN
4043:
4044: debug('attrib_source_table ='||p_txn_ext_attrib_vals_tbl(j).attrib_source_table);
4045:
4047:
4048: x_cre_ext_attrib_val_tbl(l_cre_ext).attribute_id := p_txn_ext_attrib_vals_tbl(j).attribute_source_id;
4049: x_cre_ext_attrib_val_tbl(l_cre_ext).instance_id := p_txn_line_detail_rec.instance_id;
4050: x_cre_ext_attrib_val_tbl(l_cre_ext).attribute_value := p_txn_ext_attrib_vals_tbl(j).attribute_value;
4051: x_cre_ext_attrib_val_tbl(l_cre_ext).active_start_date := FND_API.G_MISS_DATE ;
4052: x_cre_ext_attrib_val_tbl(l_cre_ext).active_end_date := p_txn_ext_attrib_vals_tbl(j).active_end_date;
4053: x_cre_ext_attrib_val_tbl(l_cre_ext).context := p_txn_ext_attrib_vals_tbl(j).context ;
4054: x_cre_ext_attrib_val_tbl(l_cre_ext).attribute1 := p_txn_ext_attrib_vals_tbl(j).attribute1 ;
4055: x_cre_ext_attrib_val_tbl(l_cre_ext).attribute2 := p_txn_ext_attrib_vals_tbl(j).attribute2 ;
4065: x_cre_ext_attrib_val_tbl(l_cre_ext).attribute12 := p_txn_ext_attrib_vals_tbl(j).attribute12;
4066: x_cre_ext_attrib_val_tbl(l_cre_ext).attribute13 := p_txn_ext_attrib_vals_tbl(j).attribute13;
4067: x_cre_ext_attrib_val_tbl(l_cre_ext).attribute14 := p_txn_ext_attrib_vals_tbl(j).attribute14;
4068: x_cre_ext_attrib_val_tbl(l_cre_ext).attribute15 := p_txn_ext_attrib_vals_tbl(j).attribute15 ;
4069: x_cre_ext_attrib_val_tbl(l_cre_ext).object_version_number := FND_API.G_MISS_NUM;
4070:
4071: l_cre_ext := l_cre_ext + 1;
4072: ELSIF (p_txn_ext_attrib_vals_tbl(j).attrib_source_table = 'CSI_IEA_VALUES') THEN
4073:
4075: p_txn_ext_attrib_vals_tbl(j).attribute_source_id);
4076:
4077: IF l_obj_ver_num = -1 THEN
4078: debug('csi_utl_pkg.get_ext_obj_ver_num failed ');
4079: RAISE fnd_api.g_exc_error;
4080: END IF;
4081:
4082: x_upd_ext_attrib_val_tbl(l_upd_ext).attribute_value_id := p_txn_ext_attrib_vals_tbl(j).attribute_source_id;
4083: x_upd_ext_attrib_val_tbl(l_upd_ext).attribute_value := p_txn_ext_attrib_vals_tbl(j).attribute_value;
4109: END LOOP; -- end of ext attributes table loop
4110: END IF;-- end of ext attributes count > 0
4111:
4112: EXCEPTION
4113: WHEN fnd_api.g_exc_error THEN
4114: x_return_status := fnd_api.g_ret_sts_error ;
4115: WHEN fnd_api.g_exc_unexpected_error THEN
4116: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4117: END get_ext_attribs_tbl;
4110: END IF;-- end of ext attributes count > 0
4111:
4112: EXCEPTION
4113: WHEN fnd_api.g_exc_error THEN
4114: x_return_status := fnd_api.g_ret_sts_error ;
4115: WHEN fnd_api.g_exc_unexpected_error THEN
4116: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4117: END get_ext_attribs_tbl;
4118:
4111:
4112: EXCEPTION
4113: WHEN fnd_api.g_exc_error THEN
4114: x_return_status := fnd_api.g_ret_sts_error ;
4115: WHEN fnd_api.g_exc_unexpected_error THEN
4116: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4117: END get_ext_attribs_tbl;
4118:
4119: /* Added p_trx_rec for ER 2581101 */
4112: EXCEPTION
4113: WHEN fnd_api.g_exc_error THEN
4114: x_return_status := fnd_api.g_ret_sts_error ;
4115: WHEN fnd_api.g_exc_unexpected_error THEN
4116: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4117: END get_ext_attribs_tbl;
4118:
4119: /* Added p_trx_rec for ER 2581101 */
4120:
4124: p_subject_instance_id in number,
4125: p_trx_rec in csi_datastructures_pub.transaction_rec,
4126: x_return_status OUT NOCOPY varchar2)
4127: IS
4128: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
4129: l_msg_count number;
4130: l_msg_data varchar2(2000);
4131:
4132: l_old_instance_id number := null;
4153: /* End of Fix for ER 2581101 */
4154:
4155: BEGIN
4156:
4157: x_return_status := fnd_api.g_ret_sts_success;
4158: l_upd_txn_rec := p_trx_rec;
4159:
4160: api_log('amend_contracts');
4161:
4223: x_return_status => l_return_status,
4224: x_msg_count => l_msg_count,
4225: x_msg_data => l_msg_data);
4226:
4227: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4228: raise fnd_api.g_exc_error;
4229: END IF;
4230: --
4231: IF px_oks_txn_inst_tbl.count > 0 THEN
4224: x_msg_count => l_msg_count,
4225: x_msg_data => l_msg_data);
4226:
4227: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4228: raise fnd_api.g_exc_error;
4229: END IF;
4230: --
4231: IF px_oks_txn_inst_tbl.count > 0 THEN
4232: csi_gen_utility_pvt.dump_oks_txn_inst_tbl(px_oks_txn_inst_tbl);
4238: --
4239: OKS_IBINT_PUB.IB_interface
4240: (
4241: P_Api_Version => 1.0,
4242: P_init_msg_list => fnd_api.g_true,
4243: P_single_txn_date_flag => 'Y',
4244: P_Batch_type => NULL,
4245: P_Batch_ID => NULL,
4246: P_OKS_Txn_Inst_tbl => px_oks_txn_inst_tbl,
4248: x_msg_count => l_msg_count,
4249: x_msg_data => l_msg_data
4250: );
4251: --
4252: IF NOT(l_return_status = FND_API.G_RET_STS_SUCCESS) THEN
4253: RAISE FND_API.G_EXC_ERROR;
4254: END IF;
4255: END IF;
4256:
4249: x_msg_data => l_msg_data
4250: );
4251: --
4252: IF NOT(l_return_status = FND_API.G_RET_STS_SUCCESS) THEN
4253: RAISE FND_API.G_EXC_ERROR;
4254: END IF;
4255: END IF;
4256:
4257: /* Code fix for ER 2581101 */
4339: p_api_name => 'update_item_instance');
4340:
4341: csi_item_instance_pub.update_item_instance(
4342: p_api_version => 1.0,
4343: p_commit => fnd_api.g_false,
4344: p_init_msg_list => fnd_api.g_true,
4345: p_validation_level => fnd_api.g_valid_level_full,
4346: p_instance_rec => l_upd_instance_rec,
4347: p_ext_attrib_values_tbl => l_upd_ext_attrib_val_tbl,
4340:
4341: csi_item_instance_pub.update_item_instance(
4342: p_api_version => 1.0,
4343: p_commit => fnd_api.g_false,
4344: p_init_msg_list => fnd_api.g_true,
4345: p_validation_level => fnd_api.g_valid_level_full,
4346: p_instance_rec => l_upd_instance_rec,
4347: p_ext_attrib_values_tbl => l_upd_ext_attrib_val_tbl,
4348: p_party_tbl => l_upd_party_tbl,
4341: csi_item_instance_pub.update_item_instance(
4342: p_api_version => 1.0,
4343: p_commit => fnd_api.g_false,
4344: p_init_msg_list => fnd_api.g_true,
4345: p_validation_level => fnd_api.g_valid_level_full,
4346: p_instance_rec => l_upd_instance_rec,
4347: p_ext_attrib_values_tbl => l_upd_ext_attrib_val_tbl,
4348: p_party_tbl => l_upd_party_tbl,
4349: p_account_tbl => l_upd_party_acct_tbl,
4356: x_msg_count => l_msg_count,
4357: x_msg_data => l_msg_data );
4358:
4359: -- For Bug 4057183
4360: -- IF l_return_status <> fnd_api.g_ret_sts_success THEN
4361: IF l_return_status not in (fnd_api.g_ret_sts_success,'W') THEN
4362: RAISE fnd_api.g_exc_error;
4363: END IF;
4364:
4357: x_msg_data => l_msg_data );
4358:
4359: -- For Bug 4057183
4360: -- IF l_return_status <> fnd_api.g_ret_sts_success THEN
4361: IF l_return_status not in (fnd_api.g_ret_sts_success,'W') THEN
4362: RAISE fnd_api.g_exc_error;
4363: END IF;
4364:
4365: END IF;
4358:
4359: -- For Bug 4057183
4360: -- IF l_return_status <> fnd_api.g_ret_sts_success THEN
4361: IF l_return_status not in (fnd_api.g_ret_sts_success,'W') THEN
4362: RAISE fnd_api.g_exc_error;
4363: END IF;
4364:
4365: END IF;
4366:
4368:
4369: END IF;
4370:
4371: EXCEPTION
4372: WHEN fnd_api.g_exc_error THEN
4373: x_return_status := fnd_api.g_ret_sts_error;
4374: END amend_contracts;
4375:
4376: /* Added p_trx_rec for ER 2581101 */
4369: END IF;
4370:
4371: EXCEPTION
4372: WHEN fnd_api.g_exc_error THEN
4373: x_return_status := fnd_api.g_ret_sts_error;
4374: END amend_contracts;
4375:
4376: /* Added p_trx_rec for ER 2581101 */
4377: PROCEDURE get_ii_relation_tbl(
4389: l_object_inst_id NUMBER;
4390: l_trx_type_id NUMBER;
4391: l_subject_inst_id NUMBER;
4392: l_obj_ver_num NUMBER;
4393: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
4394:
4395: /* Added p_trx_rec for ER 2581101 */
4396: l_nsrc_sub_type_id NUMBER;
4397: l_trx_rec csi_datastructures_pub.transaction_rec;
4499: BEGIN
4500:
4501: api_log('get_ii_relation_tbl');
4502:
4503: x_return_status := fnd_api.g_ret_sts_success;
4504:
4505: l_trx_rec := p_trx_rec;
4506:
4507: ---Get the relations(partners only) associated with the p_txn_line_detail_tbl
4514: x_txn_ii_rltns_tbl => x_tmp_txn_ii_rltns_tbl ,
4515: x_txn_line_detail_tbl => l_tmp_txn_line_detail_tbl,
4516: x_return_status => x_return_status );
4517:
4518: IF x_return_status <> fnd_api.g_ret_sts_success
4519: THEN
4520: raise fnd_api.g_exc_error;
4521: END IF;
4522:
4516: x_return_status => x_return_status );
4517:
4518: IF x_return_status <> fnd_api.g_ret_sts_success
4519: THEN
4520: raise fnd_api.g_exc_error;
4521: END IF;
4522:
4523: ---APpend the relations to main tbl
4524:
4614:
4615: rltns_xfaced_to_IB(x_txn_ii_rltns_tbl(j),
4616: x_xface_to_IB_flag,x_return_status) ;
4617:
4618: IF x_return_status <> fnd_api.g_ret_sts_success
4619: THEN
4620: raise fnd_api.g_exc_error;
4621: END IF;
4622:
4616: x_xface_to_IB_flag,x_return_status) ;
4617:
4618: IF x_return_status <> fnd_api.g_ret_sts_success
4619: THEN
4620: raise fnd_api.g_exc_error;
4621: END IF;
4622:
4623:
4624: ---Added (End) for m-to-m enhancements
4707: IF x_txn_ii_rltns_tbl(j).relationship_type_code IN ('COMPONENT-OF',
4708: 'CONNECTED-TO')
4709: THEN
4710:
4711: IF NVL(x_txn_ii_rltns_tbl(j).csi_inst_relationship_id,fnd_api.g_miss_num ) <>
4712: fnd_api.g_miss_num
4713: AND
4714: (NVL(x_txn_ii_rltns_tbl(j).active_end_date,l_date ) > sysdate)
4715: THEN
4708: 'CONNECTED-TO')
4709: THEN
4710:
4711: IF NVL(x_txn_ii_rltns_tbl(j).csi_inst_relationship_id,fnd_api.g_miss_num ) <>
4712: fnd_api.g_miss_num
4713: AND
4714: (NVL(x_txn_ii_rltns_tbl(j).active_end_date,l_date ) > sysdate)
4715: THEN
4716:
4719: l_obj_ver_num := csi_utl_pkg.get_ii_obj_ver_num(
4720: x_txn_ii_rltns_tbl(j).csi_inst_relationship_id);
4721:
4722: IF l_obj_ver_num = -1 THEN
4723: RAISE fnd_api.g_exc_error;
4724: END IF;
4725:
4726: x_upd_ii_rltns_tbl(l_upd_ii).relationship_id := x_txn_ii_rltns_tbl(j).csi_inst_relationship_id;
4727: x_upd_ii_rltns_tbl(l_upd_ii).relationship_type_code := x_txn_ii_rltns_tbl(j).relationship_type_code;
4786: -- Begin fix for Bug 2972082
4787: x_cre_ii_rltns_tbl(l_cre_ii).cascade_ownership_flag := l_cascade_owner_flag;
4788: -- End fix for Bug 2972082
4789:
4790: x_cre_ii_rltns_tbl(l_cre_ii).object_version_number := fnd_api.g_miss_num;
4791:
4792: l_cre_ii := l_cre_ii + 1;
4793: END IF;
4794:
4805: p_subject_instance_id => l_subject_inst_id,
4806: p_trx_rec => l_trx_rec,
4807: x_return_status => l_return_status);
4808:
4809: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4810: raise fnd_api.g_exc_error;
4811: END IF;
4812:
4813: IF x_txn_ii_rltns_tbl(j).relationship_type_code = 'REPLACED-BY' THEN
4806: p_trx_rec => l_trx_rec,
4807: x_return_status => l_return_status);
4808:
4809: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4810: raise fnd_api.g_exc_error;
4811: END IF;
4812:
4813: IF x_txn_ii_rltns_tbl(j).relationship_type_code = 'REPLACED-BY' THEN
4814: -- SUBJECT replaced by OBJECT
4866: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
4867: fnd_message.set_token('INSTANCE_ID',l_subject_inst_id);
4868: fnd_msg_pub.add;
4869: debug('Item being replaced belongs to a different configuration.');
4870: RAISE fnd_api.g_exc_error;
4871: WHEN OTHERS THEN
4872: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
4873: fnd_message.set_token('INSTANCE_ID',l_subject_inst_id);
4874: fnd_msg_pub.add;
4872: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
4873: fnd_message.set_token('INSTANCE_ID',l_subject_inst_id);
4874: fnd_msg_pub.add;
4875: debug('Item being replaced belongs to a different configuration.');
4876: RAISE fnd_api.g_exc_error;
4877: END;
4878:
4879: /* Check item location */
4880: BEGIN
4887: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
4888: fnd_message.set_token('INSTANCE_ID',l_subject_inst_id);
4889: fnd_msg_pub.add;
4890: debug('Item being replaced belongs to a different configuration.');
4891: RAISE fnd_api.g_exc_error;
4892: END;
4893: debug('Item location_type_code = '||l_location_type_code);
4894:
4895: IF l_location_type_code NOT IN ('HZ_PARTY_SITES','HZ_LOCATIONS') THEN
4913: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
4914: fnd_message.set_token('INSTANCE_ID',l_subject_inst_id);
4915: fnd_msg_pub.add;
4916: debug('Item is in INVENTORY and relationship is Active');
4917: RAISE fnd_api.g_exc_error;
4918: ELSE
4919: /* Check if it is a repair */
4920: IF l_old_instance_id = l_new_instance_id THEN
4921: l_item_status := 'REPAIR';
4985: p_order_line_rec => p_order_line_rec,
4986: x_trackable_line_tbl => l_line_tbl,
4987: x_return_status => l_return_status);
4988:
4989: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4990: RAISE fnd_api.g_exc_error;
4991: END IF;
4992:
4993: debug('IB Trackable Children Count :'||l_line_tbl.COUNT);
4986: x_trackable_line_tbl => l_line_tbl,
4987: x_return_status => l_return_status);
4988:
4989: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4990: RAISE fnd_api.g_exc_error;
4991: END IF;
4992:
4993: debug('IB Trackable Children Count :'||l_line_tbl.COUNT);
4994:
5010: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
5011: fnd_message.set_token('INSTANCE_ID',l_old_instance_id);
5012: fnd_msg_pub.add;
5013: debug('Check instance status - The item being replaced is no longer valid.');
5014: RAISE fnd_api.g_exc_error;
5015: ELSE
5016: close check_instance_status;
5017: END IF;
5018:
5041: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
5042: fnd_message.set_token('INSTANCE_ID',l_old_instance_id);
5043: fnd_msg_pub.add;
5044: debug('No data found - Item being replaced is no longer valid.');
5045: RAISE fnd_api.g_exc_error;
5046: WHEN OTHERS THEN
5047: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
5048: fnd_message.set_token('INSTANCE_ID',l_old_instance_id);
5049: fnd_msg_pub.add;
5047: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
5048: fnd_message.set_token('INSTANCE_ID',l_old_instance_id);
5049: fnd_msg_pub.add;
5050: debug('Others - Item being replaced is no longer valid');
5051: RAISE fnd_api.g_exc_error;
5052: END;
5053:
5054: /* Transfer the child components */
5055: IF nvl(l_transfer_components_flag,'N') = 'Y' THEN
5130: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
5131: fnd_message.set_token('INSTANCE_ID',l_old_instance_id);
5132: fnd_msg_pub.add;
5133: debug('No data found - Item being replaced is no longer valid.');
5134: RAISE fnd_api.g_exc_error;
5135: WHEN OTHERS THEN
5136: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
5137: fnd_message.set_token('INSTANCE_ID',l_old_instance_id);
5138: fnd_msg_pub.add;
5136: fnd_message.set_name('CSI','CSI_REPLACEMENT_TXN_INVALID');
5137: fnd_message.set_token('INSTANCE_ID',l_old_instance_id);
5138: fnd_msg_pub.add;
5139: debug('Others - Item being replaced is no longer valid');
5140: RAISE fnd_api.g_exc_error;
5141: END;
5142: END IF;
5143: END IF;
5144: debug('End of transfer components check');
5149: END LOOP; -- end of inst relationship table loop
5150: END IF;-- end of inst relationship table count > 0
5151:
5152: EXCEPTION
5153: WHEN fnd_api.g_exc_error THEN
5154: x_return_status := fnd_api.g_ret_sts_error ;
5155: WHEN fnd_api.g_exc_unexpected_error THEN
5156: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5157: END get_ii_relation_tbl;
5150: END IF;-- end of inst relationship table count > 0
5151:
5152: EXCEPTION
5153: WHEN fnd_api.g_exc_error THEN
5154: x_return_status := fnd_api.g_ret_sts_error ;
5155: WHEN fnd_api.g_exc_unexpected_error THEN
5156: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5157: END get_ii_relation_tbl;
5158:
5151:
5152: EXCEPTION
5153: WHEN fnd_api.g_exc_error THEN
5154: x_return_status := fnd_api.g_ret_sts_error ;
5155: WHEN fnd_api.g_exc_unexpected_error THEN
5156: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5157: END get_ii_relation_tbl;
5158:
5159:
5152: EXCEPTION
5153: WHEN fnd_api.g_exc_error THEN
5154: x_return_status := fnd_api.g_ret_sts_error ;
5155: WHEN fnd_api.g_exc_unexpected_error THEN
5156: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5157: END get_ii_relation_tbl;
5158:
5159:
5160: PROCEDURE rebuild_tbls(
5188: l_uou_ind binary_integer := 0;
5189: l_upd_ou_tbl csi_datastructures_pub.organization_units_tbl;
5190: l_cre_ou_tbl csi_datastructures_pub.organization_units_tbl;
5191:
5192: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
5193:
5194: BEGIN
5195:
5196: api_log('rebuild_tbls');
5194: BEGIN
5195:
5196: api_log('rebuild_tbls');
5197:
5198: x_return_status := fnd_api.g_ret_sts_success;
5199:
5200: l_instance_id := p_new_instance_id;
5201:
5202: IF x_upd_party_tbl.count > 0 THEN
5223: WHEN no_data_found THEN
5224: fnd_message.set_name('CSI','CSI_INT_INST_OWNER_MISSING');
5225: fnd_message.set_token('INSTANCE_ID',l_instance_id);
5226: fnd_msg_pub.add;
5227: raise fnd_api.g_exc_error;
5228: END;
5229:
5230: IF x_upd_party_acct_tbl.count > 0 THEN
5231: FOR j IN x_upd_party_acct_tbl.first..x_upd_party_acct_tbl.last
5281: x_instance_ou_id => l_instance_ou_id,
5282: x_obj_version_number => l_ou_obj_ver_num,
5283: x_return_status => x_return_status);
5284:
5285: IF NOT(x_return_status = fnd_api.g_ret_sts_success) THEN
5286: RAISE fnd_api.g_exc_error;
5287: END IF;
5288:
5289: l_upd_ou_tbl(l_uou_ind).instance_ou_id := l_instance_ou_id; -- Modified for the bug 8309196
5282: x_obj_version_number => l_ou_obj_ver_num,
5283: x_return_status => x_return_status);
5284:
5285: IF NOT(x_return_status = fnd_api.g_ret_sts_success) THEN
5286: RAISE fnd_api.g_exc_error;
5287: END IF;
5288:
5289: l_upd_ou_tbl(l_uou_ind).instance_ou_id := l_instance_ou_id; -- Modified for the bug 8309196
5290: l_upd_ou_tbl(l_uou_ind).instance_id := l_instance_id; -- Modified for the bug 8309196
5292:
5293: -- Code Addition for the bug 8309196
5294: ELSE
5295: -- If the instance_ou_id is not found, assign the update record to create
5296: x_upd_org_units_tbl(l_upd_org).instance_ou_id := FND_API.G_MISS_NUM;
5297: x_cre_org_units_tbl(x_cre_org_units_tbl.count + 1) := x_upd_org_units_tbl(l_upd_org);
5298: END IF;
5299: -- End of Code Addition for the bug 8309196
5300:
5312: x_attribute_value_id => l_attrib_value_id,
5313: x_obj_version_number => l_av_obj_ver_num,
5314: x_return_status => x_return_status);
5315:
5316: IF NOT(x_return_status = fnd_api.g_ret_sts_success) THEN
5317: RAISE fnd_api.g_exc_error;
5318: END IF;
5319:
5320: x_upd_ext_attrib_val_tbl(l_upd_ext).attribute_value_id := l_attrib_value_id;
5313: x_obj_version_number => l_av_obj_ver_num,
5314: x_return_status => x_return_status);
5315:
5316: IF NOT(x_return_status = fnd_api.g_ret_sts_success) THEN
5317: RAISE fnd_api.g_exc_error;
5318: END IF;
5319:
5320: x_upd_ext_attrib_val_tbl(l_upd_ext).attribute_value_id := l_attrib_value_id;
5321: x_upd_ext_attrib_val_tbl(l_upd_ext).instance_id := l_instance_id;
5389: x_cre_org_units_tbl := l_cre_ou_tbl;
5390: x_upd_org_units_tbl := l_upd_ou_tbl;
5391:
5392: EXCEPTION
5393: WHEN fnd_api.g_exc_error THEN
5394: x_return_status := fnd_api.g_ret_sts_error ;
5395: WHEN fnd_api.g_exc_unexpected_error THEN
5396: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5397: END rebuild_tbls ;
5390: x_upd_org_units_tbl := l_upd_ou_tbl;
5391:
5392: EXCEPTION
5393: WHEN fnd_api.g_exc_error THEN
5394: x_return_status := fnd_api.g_ret_sts_error ;
5395: WHEN fnd_api.g_exc_unexpected_error THEN
5396: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5397: END rebuild_tbls ;
5398:
5391:
5392: EXCEPTION
5393: WHEN fnd_api.g_exc_error THEN
5394: x_return_status := fnd_api.g_ret_sts_error ;
5395: WHEN fnd_api.g_exc_unexpected_error THEN
5396: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5397: END rebuild_tbls ;
5398:
5399: PROCEDURE cascade_txn_dtls
5392: EXCEPTION
5393: WHEN fnd_api.g_exc_error THEN
5394: x_return_status := fnd_api.g_ret_sts_error ;
5395: WHEN fnd_api.g_exc_unexpected_error THEN
5396: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5397: END rebuild_tbls ;
5398:
5399: PROCEDURE cascade_txn_dtls
5400: (p_source_trx_id IN NUMBER,
5440: BEGIN
5441:
5442: api_log('cascade_txn_dtls');
5443:
5444: x_return_status := fnd_api.g_ret_sts_success;
5445:
5446: FOR C1 IN get_txn_dtls( p_source_trx_id,p_source_trx_table )LOOP
5447:
5448: l_txn_line_detail_query_rec.txn_line_detail_id := C1.txn_line_detail_id;
5448: l_txn_line_detail_query_rec.txn_line_detail_id := C1.txn_line_detail_id;
5449:
5450: csi_t_txn_details_grp.get_transaction_details(
5451: p_api_version => 1.0,
5452: p_commit => fnd_api.g_false,
5453: p_init_msg_list => fnd_api.g_true,
5454: p_validation_level => fnd_api.g_valid_level_full,
5455: p_txn_line_query_rec => l_txn_line_query_rec,
5456: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
5449:
5450: csi_t_txn_details_grp.get_transaction_details(
5451: p_api_version => 1.0,
5452: p_commit => fnd_api.g_false,
5453: p_init_msg_list => fnd_api.g_true,
5454: p_validation_level => fnd_api.g_valid_level_full,
5455: p_txn_line_query_rec => l_txn_line_query_rec,
5456: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
5457: x_txn_line_detail_tbl => l_line_dtl_tbl,
5450: csi_t_txn_details_grp.get_transaction_details(
5451: p_api_version => 1.0,
5452: p_commit => fnd_api.g_false,
5453: p_init_msg_list => fnd_api.g_true,
5454: p_validation_level => fnd_api.g_valid_level_full,
5455: p_txn_line_query_rec => l_txn_line_query_rec,
5456: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
5457: x_txn_line_detail_tbl => l_line_dtl_tbl,
5458: p_get_parties_flag => fnd_api.g_true,
5454: p_validation_level => fnd_api.g_valid_level_full,
5455: p_txn_line_query_rec => l_txn_line_query_rec,
5456: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
5457: x_txn_line_detail_tbl => l_line_dtl_tbl,
5458: p_get_parties_flag => fnd_api.g_true,
5459: x_txn_party_detail_tbl => l_pty_dtl_tbl,
5460: p_get_pty_accts_flag => fnd_api.g_true,
5461: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
5462: p_get_ii_rltns_flag => fnd_api.g_false,
5456: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
5457: x_txn_line_detail_tbl => l_line_dtl_tbl,
5458: p_get_parties_flag => fnd_api.g_true,
5459: x_txn_party_detail_tbl => l_pty_dtl_tbl,
5460: p_get_pty_accts_flag => fnd_api.g_true,
5461: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
5462: p_get_ii_rltns_flag => fnd_api.g_false,
5463: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
5464: p_get_org_assgns_flag => fnd_api.g_true,
5458: p_get_parties_flag => fnd_api.g_true,
5459: x_txn_party_detail_tbl => l_pty_dtl_tbl,
5460: p_get_pty_accts_flag => fnd_api.g_true,
5461: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
5462: p_get_ii_rltns_flag => fnd_api.g_false,
5463: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
5464: p_get_org_assgns_flag => fnd_api.g_true,
5465: x_txn_org_assgn_tbl => l_org_assgn_tbl,
5466: p_get_ext_attrib_vals_flag => fnd_api.g_true,
5460: p_get_pty_accts_flag => fnd_api.g_true,
5461: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
5462: p_get_ii_rltns_flag => fnd_api.g_false,
5463: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
5464: p_get_org_assgns_flag => fnd_api.g_true,
5465: x_txn_org_assgn_tbl => l_org_assgn_tbl,
5466: p_get_ext_attrib_vals_flag => fnd_api.g_true,
5467: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
5468: p_get_csi_attribs_flag => fnd_api.g_false,
5462: p_get_ii_rltns_flag => fnd_api.g_false,
5463: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
5464: p_get_org_assgns_flag => fnd_api.g_true,
5465: x_txn_org_assgn_tbl => l_org_assgn_tbl,
5466: p_get_ext_attrib_vals_flag => fnd_api.g_true,
5467: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
5468: p_get_csi_attribs_flag => fnd_api.g_false,
5469: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
5470: p_get_csi_iea_values_flag => fnd_api.g_false,
5464: p_get_org_assgns_flag => fnd_api.g_true,
5465: x_txn_org_assgn_tbl => l_org_assgn_tbl,
5466: p_get_ext_attrib_vals_flag => fnd_api.g_true,
5467: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
5468: p_get_csi_attribs_flag => fnd_api.g_false,
5469: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
5470: p_get_csi_iea_values_flag => fnd_api.g_false,
5471: x_csi_iea_values_tbl => l_csi_eav_tbl,
5472: p_get_txn_systems_flag => fnd_api.g_false,
5466: p_get_ext_attrib_vals_flag => fnd_api.g_true,
5467: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
5468: p_get_csi_attribs_flag => fnd_api.g_false,
5469: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
5470: p_get_csi_iea_values_flag => fnd_api.g_false,
5471: x_csi_iea_values_tbl => l_csi_eav_tbl,
5472: p_get_txn_systems_flag => fnd_api.g_false,
5473: x_txn_systems_tbl => l_txn_systems_tbl,
5474: x_return_status => x_return_status,
5468: p_get_csi_attribs_flag => fnd_api.g_false,
5469: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
5470: p_get_csi_iea_values_flag => fnd_api.g_false,
5471: x_csi_iea_values_tbl => l_csi_eav_tbl,
5472: p_get_txn_systems_flag => fnd_api.g_false,
5473: x_txn_systems_tbl => l_txn_systems_tbl,
5474: x_return_status => x_return_status,
5475: x_msg_count => x_msg_count,
5476: x_msg_data => x_msg_data);
5474: x_return_status => x_return_status,
5475: x_msg_count => x_msg_count,
5476: x_msg_data => x_msg_data);
5477:
5478: IF x_return_status <> fnd_api.g_ret_sts_success THEN
5479: debug('Get_transaction_details failed ');
5480: RAISE fnd_api.g_exc_error;
5481: END IF;
5482:
5476: x_msg_data => x_msg_data);
5477:
5478: IF x_return_status <> fnd_api.g_ret_sts_success THEN
5479: debug('Get_transaction_details failed ');
5480: RAISE fnd_api.g_exc_error;
5481: END IF;
5482:
5483: debug('After getting txn details ');
5484: debug('l_line_dtl_tbl.count = '||l_line_dtl_tbl.count);
5518:
5519: debug('l_line_dtl_rec.quantity ='||l_line_dtl_rec.quantity);
5520:
5521: l_line_dtl_rec := l_line_dtl_tbl(1);
5522: l_line_dtl_rec.txn_line_detail_id := FND_API.G_MISS_NUM;
5523: l_line_dtl_rec.transaction_system_id := C1.transaction_system_id;
5524: l_line_dtl_rec.csi_system_id := C1.csi_system_id;
5525: l_line_dtl_rec.quantity := p_ratio ;
5526: l_line_dtl_rec.transaction_line_id := C1.transaction_line_id ;
5539: debug(' ext_attrib_tbl.count = '||l_ext_attrib_tbl.count);
5540:
5541: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
5542: p_api_version => 1.0,
5543: p_commit => fnd_api.g_false,
5544: p_init_msg_list => fnd_api.g_true,
5545: p_validation_level => fnd_api.g_valid_level_full,
5546: p_txn_line_dtl_index => 1,
5547: p_txn_line_dtl_rec => l_line_dtl_rec,
5540:
5541: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
5542: p_api_version => 1.0,
5543: p_commit => fnd_api.g_false,
5544: p_init_msg_list => fnd_api.g_true,
5545: p_validation_level => fnd_api.g_valid_level_full,
5546: p_txn_line_dtl_index => 1,
5547: p_txn_line_dtl_rec => l_line_dtl_rec,
5548: px_txn_party_dtl_tbl => l_pty_dtl_tbl,
5541: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
5542: p_api_version => 1.0,
5543: p_commit => fnd_api.g_false,
5544: p_init_msg_list => fnd_api.g_true,
5545: p_validation_level => fnd_api.g_valid_level_full,
5546: p_txn_line_dtl_index => 1,
5547: p_txn_line_dtl_rec => l_line_dtl_rec,
5548: px_txn_party_dtl_tbl => l_pty_dtl_tbl,
5549: px_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
5553: x_return_status => x_return_status,
5554: x_msg_count => x_msg_count,
5555: x_msg_data => x_msg_data);
5556:
5557: IF x_return_status <> fnd_api.g_ret_sts_success THEN
5558: debug('Error Splitting txn line detail ');
5559: RAISE fnd_api.g_exc_error;
5560: END IF;
5561:
5555: x_msg_data => x_msg_data);
5556:
5557: IF x_return_status <> fnd_api.g_ret_sts_success THEN
5558: debug('Error Splitting txn line detail ');
5559: RAISE fnd_api.g_exc_error;
5560: END IF;
5561:
5562: debug('Converting the ids to index ');
5563:
5572: px_ext_attrib_tbl => l_ext_attrib_tbl,
5573: px_txn_systems_tbl => l_txn_systems_tbl);
5574:
5575: l_line_dtl_rec := l_line_dtl_tbl(1);
5576: l_line_dtl_rec.txn_line_detail_id := FND_API.G_MISS_NUM;
5577: l_line_dtl_rec.quantity := p_ratio;
5578: l_line_dtl_rec.transaction_system_id := C1.transaction_system_id;
5579: l_line_dtl_rec.csi_system_id := C1.csi_system_id;
5580: l_line_dtl_rec.transaction_line_id := C1.transaction_line_id ;
5585:
5586: END LOOP;
5587:
5588: EXCEPTION
5589: WHEN fnd_api.g_exc_error THEN
5590: x_return_status := fnd_api.g_ret_sts_error ;
5591: WHEN fnd_api.g_exc_unexpected_error THEN
5592: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5593:
5586: END LOOP;
5587:
5588: EXCEPTION
5589: WHEN fnd_api.g_exc_error THEN
5590: x_return_status := fnd_api.g_ret_sts_error ;
5591: WHEN fnd_api.g_exc_unexpected_error THEN
5592: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5593:
5594: END cascade_txn_dtls;
5587:
5588: EXCEPTION
5589: WHEN fnd_api.g_exc_error THEN
5590: x_return_status := fnd_api.g_ret_sts_error ;
5591: WHEN fnd_api.g_exc_unexpected_error THEN
5592: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5593:
5594: END cascade_txn_dtls;
5595:
5588: EXCEPTION
5589: WHEN fnd_api.g_exc_error THEN
5590: x_return_status := fnd_api.g_ret_sts_error ;
5591: WHEN fnd_api.g_exc_unexpected_error THEN
5592: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5593:
5594: END cascade_txn_dtls;
5595:
5596: PROCEDURE derive_party_id(
5601: BEGIN
5602:
5603: api_log('derive_party_id');
5604:
5605: x_return_status := fnd_api.g_ret_sts_success;
5606:
5607: SELECT ship_rel.subject_id
5608: INTO x_party_id
5609: FROM hz_relationships ship_rel,
5618: WHEN no_data_found THEN
5619: fnd_message.set_name('CSI','CSI_INT_CUST_ROLEID_MISSING');
5620: fnd_message.set_token('CUST_ACCOUNT_ROLE_ID',p_cust_acct_role_id);
5621: fnd_msg_pub.add;
5622: x_return_status := fnd_api.g_ret_sts_error ;
5623: END derive_party_id;
5624:
5625: PROCEDURE get_party_owner(
5626: p_txn_line_detail_rec IN csi_t_datastructures_grp.txn_line_detail_rec,
5648: BEGIN
5649:
5650: api_log('get_party_owner');
5651:
5652: x_return_status := fnd_api.g_ret_sts_success;
5653:
5654: /* get the debug level FROM the profile */
5655: l_debug_level := csi_t_gen_utility_pvt.g_debug_level;
5656:
5659:
5660: IF (p_txn_line_detail_rec.txn_line_detail_id = p_txn_party_detail_tbl(j).txn_line_detail_id) AND
5661: (p_txn_party_detail_tbl(j).relationship_type_code = 'OWNER' ) AND
5662: ((NVL(p_txn_party_detail_tbl(j).active_end_date,l_date ) > sysdate) OR
5663: (p_txn_party_detail_tbl(j).active_end_date = FND_API.G_MISS_DATE ))
5664: THEN
5665:
5666: x_cre_party_tbl.delete;
5667: x_upd_party_tbl.delete;
5667: x_upd_party_tbl.delete;
5668: x_cre_party_acct_tbl.delete;
5669: x_upd_party_acct_tbl.delete;
5670:
5671: IF (NVL(p_txn_party_detail_tbl(j).instance_party_id, FND_API.G_MISS_NUM) = FND_API.G_MISS_NUM) THEN
5672:
5673: x_cre_party_tbl(l_cre_pty).instance_party_id := FND_API.G_MISS_NUM;
5674: x_cre_party_tbl(l_cre_pty).instance_id := FND_API.G_MISS_NUM;
5675: x_cre_party_tbl(l_cre_pty).party_id := p_txn_party_detail_tbl(j).party_source_id;
5669: x_upd_party_acct_tbl.delete;
5670:
5671: IF (NVL(p_txn_party_detail_tbl(j).instance_party_id, FND_API.G_MISS_NUM) = FND_API.G_MISS_NUM) THEN
5672:
5673: x_cre_party_tbl(l_cre_pty).instance_party_id := FND_API.G_MISS_NUM;
5674: x_cre_party_tbl(l_cre_pty).instance_id := FND_API.G_MISS_NUM;
5675: x_cre_party_tbl(l_cre_pty).party_id := p_txn_party_detail_tbl(j).party_source_id;
5676: x_cre_party_tbl(l_cre_pty).party_source_table := p_txn_party_detail_tbl(j).party_source_table;
5677: x_cre_party_tbl(l_cre_pty).relationship_type_code := p_txn_party_detail_tbl(j).relationship_type_code;
5670:
5671: IF (NVL(p_txn_party_detail_tbl(j).instance_party_id, FND_API.G_MISS_NUM) = FND_API.G_MISS_NUM) THEN
5672:
5673: x_cre_party_tbl(l_cre_pty).instance_party_id := FND_API.G_MISS_NUM;
5674: x_cre_party_tbl(l_cre_pty).instance_id := FND_API.G_MISS_NUM;
5675: x_cre_party_tbl(l_cre_pty).party_id := p_txn_party_detail_tbl(j).party_source_id;
5676: x_cre_party_tbl(l_cre_pty).party_source_table := p_txn_party_detail_tbl(j).party_source_table;
5677: x_cre_party_tbl(l_cre_pty).relationship_type_code := p_txn_party_detail_tbl(j).relationship_type_code;
5678: x_cre_party_tbl(l_cre_pty).contact_flag := p_txn_party_detail_tbl(j).contact_flag;
5693: x_cre_party_tbl(l_cre_pty).attribute12 := p_txn_party_detail_tbl(j).attribute12;
5694: x_cre_party_tbl(l_cre_pty).attribute13 := p_txn_party_detail_tbl(j).attribute13;
5695: x_cre_party_tbl(l_cre_pty).attribute14 := p_txn_party_detail_tbl(j).attribute14;
5696: x_cre_party_tbl(l_cre_pty).attribute15 := p_txn_party_detail_tbl(j).attribute15;
5697: x_cre_party_tbl(l_cre_pty).object_version_number := FND_API.G_MISS_NUM;
5698:
5699: l_cre_pty := l_cre_pty + 1;
5700:
5701: ELSE
5703: l_obj_ver_num := csi_utl_pkg.get_pty_obj_ver_num(
5704: p_txn_party_detail_tbl(j).instance_party_id);
5705:
5706: IF l_obj_ver_num = -1 THEN
5707: RAISE fnd_api.g_exc_error;
5708: END IF;
5709:
5710: x_upd_party_tbl(l_upd_pty).instance_party_id := p_txn_party_detail_tbl(j).instance_party_id;
5711: x_upd_party_tbl(l_upd_pty).instance_id := p_txn_line_detail_rec.instance_id ;
5743: IF (p_txn_pty_acct_dtl_tbl(k).txn_party_detail_id = p_txn_party_detail_tbl(j).txn_party_detail_id) AND
5744: -- Commenting this condition (Porting fix for Bug 3625218)
5745: -- (p_txn_pty_acct_dtl_tbl(k).relationship_type_code = 'OWNER') AND
5746: ((NVL(p_txn_pty_acct_dtl_tbl(k).active_end_date, l_date ) > sysdate ) OR
5747: (p_txn_pty_acct_dtl_tbl(k).active_end_date = FND_API.G_MISS_DATE))
5748: THEN
5749: IF NVL(p_txn_pty_acct_dtl_tbl(k).ip_account_id,FND_API.G_MISS_NUM)= FND_API.G_MISS_NUM THEN
5750: x_cre_party_acct_tbl(l_cre_pty_acct).ip_account_id := FND_API.G_MISS_NUM;
5751: x_cre_party_acct_tbl(l_cre_pty_acct).party_account_id := p_txn_pty_acct_dtl_tbl(k).account_id;
5745: -- (p_txn_pty_acct_dtl_tbl(k).relationship_type_code = 'OWNER') AND
5746: ((NVL(p_txn_pty_acct_dtl_tbl(k).active_end_date, l_date ) > sysdate ) OR
5747: (p_txn_pty_acct_dtl_tbl(k).active_end_date = FND_API.G_MISS_DATE))
5748: THEN
5749: IF NVL(p_txn_pty_acct_dtl_tbl(k).ip_account_id,FND_API.G_MISS_NUM)= FND_API.G_MISS_NUM THEN
5750: x_cre_party_acct_tbl(l_cre_pty_acct).ip_account_id := FND_API.G_MISS_NUM;
5751: x_cre_party_acct_tbl(l_cre_pty_acct).party_account_id := p_txn_pty_acct_dtl_tbl(k).account_id;
5752: x_cre_party_acct_tbl(l_cre_pty_acct).relationship_type_code := p_txn_pty_acct_dtl_tbl(k).relationship_type_code;
5753: x_cre_party_acct_tbl(l_cre_pty_acct).bill_to_address := p_txn_pty_acct_dtl_tbl(k).bill_to_address_id ;
5746: ((NVL(p_txn_pty_acct_dtl_tbl(k).active_end_date, l_date ) > sysdate ) OR
5747: (p_txn_pty_acct_dtl_tbl(k).active_end_date = FND_API.G_MISS_DATE))
5748: THEN
5749: IF NVL(p_txn_pty_acct_dtl_tbl(k).ip_account_id,FND_API.G_MISS_NUM)= FND_API.G_MISS_NUM THEN
5750: x_cre_party_acct_tbl(l_cre_pty_acct).ip_account_id := FND_API.G_MISS_NUM;
5751: x_cre_party_acct_tbl(l_cre_pty_acct).party_account_id := p_txn_pty_acct_dtl_tbl(k).account_id;
5752: x_cre_party_acct_tbl(l_cre_pty_acct).relationship_type_code := p_txn_pty_acct_dtl_tbl(k).relationship_type_code;
5753: x_cre_party_acct_tbl(l_cre_pty_acct).bill_to_address := p_txn_pty_acct_dtl_tbl(k).bill_to_address_id ;
5754: x_cre_party_acct_tbl(l_cre_pty_acct).ship_to_address := p_txn_pty_acct_dtl_tbl(k).ship_to_address_id;
5752: x_cre_party_acct_tbl(l_cre_pty_acct).relationship_type_code := p_txn_pty_acct_dtl_tbl(k).relationship_type_code;
5753: x_cre_party_acct_tbl(l_cre_pty_acct).bill_to_address := p_txn_pty_acct_dtl_tbl(k).bill_to_address_id ;
5754: x_cre_party_acct_tbl(l_cre_pty_acct).ship_to_address := p_txn_pty_acct_dtl_tbl(k).ship_to_address_id;
5755: x_cre_party_acct_tbl(l_cre_pty_acct).instance_party_id := p_txn_party_detail_tbl(j).instance_party_id;
5756: x_cre_party_acct_tbl(l_cre_pty_acct).active_start_date := FND_API.G_MISS_DATE ;
5757: x_cre_party_acct_tbl(l_cre_pty_acct).active_end_date := p_txn_pty_acct_dtl_tbl(k).active_end_date;
5758: x_cre_party_acct_tbl(l_cre_pty_acct).context := p_txn_pty_acct_dtl_tbl(k).context ;
5759: x_cre_party_acct_tbl(l_cre_pty_acct).attribute1 := p_txn_pty_acct_dtl_tbl(k).attribute1 ;
5760: x_cre_party_acct_tbl(l_cre_pty_acct).attribute2 := p_txn_pty_acct_dtl_tbl(k).attribute2 ;
5774: x_cre_party_acct_tbl(l_cre_pty_acct).object_version_number := l_obj_ver_num;
5775: x_cre_party_acct_tbl(l_cre_pty_acct).parent_tbl_index := 1;
5776: l_cre_pty_acct := l_cre_pty_acct + 1;
5777: ELSE
5778: x_upd_party_acct_tbl(l_upd_pty_acct).ip_account_id := FND_API.G_MISS_NUM;
5779: x_upd_party_acct_tbl(l_upd_pty_acct).party_account_id := p_txn_pty_acct_dtl_tbl(k).account_id;
5780: x_upd_party_acct_tbl(l_upd_pty_acct).relationship_type_code := p_txn_pty_acct_dtl_tbl(k).relationship_type_code;
5781: x_upd_party_acct_tbl(l_upd_pty_acct).bill_to_address := p_txn_pty_acct_dtl_tbl(k).bill_to_address_id ;
5782: x_upd_party_acct_tbl(l_upd_pty_acct).ship_to_address := p_txn_pty_acct_dtl_tbl(k).ship_to_address_id;
5780: x_upd_party_acct_tbl(l_upd_pty_acct).relationship_type_code := p_txn_pty_acct_dtl_tbl(k).relationship_type_code;
5781: x_upd_party_acct_tbl(l_upd_pty_acct).bill_to_address := p_txn_pty_acct_dtl_tbl(k).bill_to_address_id ;
5782: x_upd_party_acct_tbl(l_upd_pty_acct).ship_to_address := p_txn_pty_acct_dtl_tbl(k).ship_to_address_id;
5783: x_upd_party_acct_tbl(l_upd_pty_acct).instance_party_id := p_txn_party_detail_tbl(j).instance_party_id;
5784: x_upd_party_acct_tbl(l_upd_pty_acct).active_start_date := FND_API.G_MISS_DATE ;
5785: x_upd_party_acct_tbl(l_upd_pty_acct).active_end_date := p_txn_pty_acct_dtl_tbl(k).active_end_date;
5786: x_upd_party_acct_tbl(l_upd_pty_acct).context := p_txn_pty_acct_dtl_tbl(k).context ;
5787: x_upd_party_acct_tbl(l_upd_pty_acct).attribute1 := p_txn_pty_acct_dtl_tbl(k).attribute1 ;
5788: x_upd_party_acct_tbl(l_upd_pty_acct).attribute2 := p_txn_pty_acct_dtl_tbl(k).attribute2 ;
5810: END LOOP;
5811: END IF;
5812:
5813: EXCEPTION
5814: WHEN fnd_api.g_exc_error THEN
5815: x_return_status := fnd_api.g_ret_sts_error ;
5816: WHEN fnd_api.g_exc_unexpected_error THEN
5817: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5818: END get_party_owner;
5811: END IF;
5812:
5813: EXCEPTION
5814: WHEN fnd_api.g_exc_error THEN
5815: x_return_status := fnd_api.g_ret_sts_error ;
5816: WHEN fnd_api.g_exc_unexpected_error THEN
5817: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5818: END get_party_owner;
5819:
5812:
5813: EXCEPTION
5814: WHEN fnd_api.g_exc_error THEN
5815: x_return_status := fnd_api.g_ret_sts_error ;
5816: WHEN fnd_api.g_exc_unexpected_error THEN
5817: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5818: END get_party_owner;
5819:
5820:
5813: EXCEPTION
5814: WHEN fnd_api.g_exc_error THEN
5815: x_return_status := fnd_api.g_ret_sts_error ;
5816: WHEN fnd_api.g_exc_unexpected_error THEN
5817: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5818: END get_party_owner;
5819:
5820:
5821: /* -------------------------------------------------------------------- */
5832: l_inst_tbl csi_datastructures_pub.instance_tbl;
5833: l_inst_hdr_tbl csi_datastructures_pub.instance_header_tbl;
5834: BEGIN
5835:
5836: x_return_status := fnd_api.g_ret_sts_success;
5837:
5838: api_log('make_non_header_tbl');
5839:
5840: l_inst_hdr_tbl := p_instance_header_tbl;
5924: x_return_status OUT NOCOPY varchar2)
5925: IS
5926: BEGIN
5927:
5928: x_return_status := fnd_api.g_ret_sts_success;
5929: x_call_contracts := fnd_api.g_true;
5930:
5931: api_log('call_contracts_chk');
5932:
5925: IS
5926: BEGIN
5927:
5928: x_return_status := fnd_api.g_ret_sts_success;
5929: x_call_contracts := fnd_api.g_true;
5930:
5931: api_log('call_contracts_chk');
5932:
5933: IF p_txn_ii_rltns_tbl.count > 0 THEN
5940: AND p_txn_ii_rltns_tbl(l_ind).object_id = p_txn_line_detail_id ))
5941: THEN
5942: IF p_txn_ii_rltns_tbl(l_ind).relationship_type_code IN
5943: ('REPLACED-BY','REPLACEMENT-FOR', 'UPGRADED-FROM') THEN
5944: x_call_contracts := fnd_api.g_false;
5945: END IF;
5946: END IF;
5947: END LOOP;
5948: END IF;
5949:
5950: debug(' l_contracts_flag :'||x_call_contracts);
5951:
5952: EXCEPTION
5953: WHEN fnd_api.g_exc_error THEN
5954: x_return_status := fnd_api.g_ret_sts_error;
5955: END call_contracts_chk;
5956:
5957:
5950: debug(' l_contracts_flag :'||x_call_contracts);
5951:
5952: EXCEPTION
5953: WHEN fnd_api.g_exc_error THEN
5954: x_return_status := fnd_api.g_ret_sts_error;
5955: END call_contracts_chk;
5956:
5957:
5958: /* local debug dump routines */
5989: BEGIN
5990:
5991: api_log('get_item_control_rec');
5992:
5993: x_return_status := fnd_api.g_ret_sts_success;
5994:
5995: BEGIN
5996:
5997: SELECT inventory_item_id,
6005: WHEN no_data_found THEN
6006: fnd_message.set_name('CSI','CSI_NO_INVENTORY_RECORDS');
6007: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_txn_id);
6008: fnd_msg_pub.add;
6009: RAISE fnd_api.g_exc_error;
6010:
6011: END;
6012:
6013: BEGIN
6045: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
6046: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
6047: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
6048: fnd_msg_pub.add;
6049: RAISE fnd_api.g_exc_error;
6050: END;
6051:
6052: BEGIN
6053: SELECT nvl(negative_inv_receipt_code,1)
6061:
6062: x_item_control_rec := l_item_control_rec;
6063:
6064: EXCEPTION
6065: WHEN fnd_api.g_exc_error THEN
6066: x_return_status := fnd_api.g_ret_sts_error;
6067:
6068: END get_item_control_rec;
6069:
6062: x_item_control_rec := l_item_control_rec;
6063:
6064: EXCEPTION
6065: WHEN fnd_api.g_exc_error THEN
6066: x_return_status := fnd_api.g_ret_sts_error;
6067:
6068: END get_item_control_rec;
6069:
6070:
6123: debug('l_relationship_query_rec.relationship_type_code :'|| l_relationship_query_rec.relationship_type_code);
6124:
6125: csi_ii_relationships_pub.get_relationships (
6126: p_api_version => 1.0 ,
6127: p_commit => fnd_api.g_false,
6128: p_init_msg_list => fnd_api.g_false,
6129: p_validation_level => fnd_api.g_valid_level_full,
6130: p_relationship_query_rec => l_relationship_query_rec,
6131: p_depth => NULL,
6124:
6125: csi_ii_relationships_pub.get_relationships (
6126: p_api_version => 1.0 ,
6127: p_commit => fnd_api.g_false,
6128: p_init_msg_list => fnd_api.g_false,
6129: p_validation_level => fnd_api.g_valid_level_full,
6130: p_relationship_query_rec => l_relationship_query_rec,
6131: p_depth => NULL,
6132: p_time_stamp => NULL ,
6125: csi_ii_relationships_pub.get_relationships (
6126: p_api_version => 1.0 ,
6127: p_commit => fnd_api.g_false,
6128: p_init_msg_list => fnd_api.g_false,
6129: p_validation_level => fnd_api.g_valid_level_full,
6130: p_relationship_query_rec => l_relationship_query_rec,
6131: p_depth => NULL,
6132: p_time_stamp => NULL ,
6133: p_active_relationship_only => fnd_api.g_true,
6129: p_validation_level => fnd_api.g_valid_level_full,
6130: p_relationship_query_rec => l_relationship_query_rec,
6131: p_depth => NULL,
6132: p_time_stamp => NULL ,
6133: p_active_relationship_only => fnd_api.g_true,
6134: x_relationship_tbl => l_ii_relationship_tbl,
6135: x_return_status => x_return_status,
6136: x_msg_count => x_msg_count ,
6137: x_msg_data => x_msg_data) ;
6135: x_return_status => x_return_status,
6136: x_msg_count => x_msg_count ,
6137: x_msg_data => x_msg_data) ;
6138:
6139: IF NOT(x_return_status = fnd_api.g_ret_sts_success)
6140: THEN
6141: debug('csi_ii_relationships_pub.get_relationships call failed :'||
6142: x_msg_data);
6143: RAISE fnd_api.g_exc_error;
6139: IF NOT(x_return_status = fnd_api.g_ret_sts_success)
6140: THEN
6141: debug('csi_ii_relationships_pub.get_relationships call failed :'||
6142: x_msg_data);
6143: RAISE fnd_api.g_exc_error;
6144: END IF;
6145: IF l_ii_relationship_tbl.count > 0
6146: THEN
6147: debug('Relations are already interfaced to IB');
6154: x_xface_to_IB_flag := 'N' ;
6155: END IF ;
6156:
6157: EXCEPTION
6158: WHEN FND_API.G_EXC_ERROR THEN
6159: x_return_status := FND_API.G_RET_STS_ERROR ;
6160: debug ('Unexpected error in rltns_xfaced_to_IB '||SQLERRM);
6161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6162: debug ('Unexpected error in rltns_xfaced_to_IB '||SQLERRM);
6155: END IF ;
6156:
6157: EXCEPTION
6158: WHEN FND_API.G_EXC_ERROR THEN
6159: x_return_status := FND_API.G_RET_STS_ERROR ;
6160: debug ('Unexpected error in rltns_xfaced_to_IB '||SQLERRM);
6161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6162: debug ('Unexpected error in rltns_xfaced_to_IB '||SQLERRM);
6163: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6157: EXCEPTION
6158: WHEN FND_API.G_EXC_ERROR THEN
6159: x_return_status := FND_API.G_RET_STS_ERROR ;
6160: debug ('Unexpected error in rltns_xfaced_to_IB '||SQLERRM);
6161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6162: debug ('Unexpected error in rltns_xfaced_to_IB '||SQLERRM);
6163: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6164: END rltns_xfaced_to_IB ;
6165:
6159: x_return_status := FND_API.G_RET_STS_ERROR ;
6160: debug ('Unexpected error in rltns_xfaced_to_IB '||SQLERRM);
6161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6162: debug ('Unexpected error in rltns_xfaced_to_IB '||SQLERRM);
6163: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6164: END rltns_xfaced_to_IB ;
6165:
6166: ---Added (End) for m-to-m enhancements
6167:
6243: ---In Case of Non-Shippable Items Txn Detail Line may NOT
6244: ---have source_txn_line_detail_id at all
6245: -- This IF is introduced for bug 2814779 . The source TLD ID was g_miss_num for Models 'cause it wasn't getting properly earlier ..
6246:
6247: IF p_txn_line_detail_tbl(i).source_txn_line_detail_id = fnd_api.g_miss_num THEN
6248: l_src_txn_line_dtl_id := NULL;
6249: ELSIF p_txn_line_detail_tbl(i).source_txn_line_detail_id <> NULL THEN
6250: l_src_txn_line_dtl_id := p_txn_line_detail_tbl(i).source_txn_line_detail_id;
6251: END IF;
6264: Exception when others Then
6265: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
6266: fnd_message.set_token('MESSAGE', substr(sqlerrm, 1, 240));
6267: fnd_msg_pub.add;
6268: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6269: raise FND_API.G_EXC_UNEXPECTED_ERROR ;
6270: End;
6271:
6272: IF l_src_txn_id <> l_orig_oe_src_txn_id THEN --added this for bug 2795136
6265: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
6266: fnd_message.set_token('MESSAGE', substr(sqlerrm, 1, 240));
6267: fnd_msg_pub.add;
6268: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6269: raise FND_API.G_EXC_UNEXPECTED_ERROR ;
6270: End;
6271:
6272: IF l_src_txn_id <> l_orig_oe_src_txn_id THEN --added this for bug 2795136
6273: FOR oe_tld_relns_rec IN oe_tld_relns_cur (l_orig_oe_tld)
6331: ELSE
6332: x_txn_ii_rltns_tbl(l_ii_indx).object_id := wsh_partner_tld_rec.txn_line_detail_id ;
6333: x_txn_ii_rltns_tbl(l_ii_indx).subject_id := p_txn_line_detail_tbl(i).txn_line_detail_id ;
6334: END IF ; ---l_partner_tld = SUBJECT
6335: x_txn_ii_rltns_tbl(l_ii_indx).txn_relationship_id := fnd_api.g_miss_num ;
6336: x_txn_ii_rltns_tbl(l_ii_indx).object_version_number := 1;
6337: END LOOP ; --wsh_partner_tld_cur
6338:
6339: debug ('x_txn_ii_rltns_tbl.count :'|| x_txn_ii_rltns_tbl.count);
6345:
6346: debug ('End : build_txn_relations');
6347:
6348: EXCEPTION
6349: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6350: debug (' Unexpected error in build_txn_relations '||SQLERRM);
6351: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6352: WHEN OTHERS
6353: THEN
6347:
6348: EXCEPTION
6349: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6350: debug (' Unexpected error in build_txn_relations '||SQLERRM);
6351: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6352: WHEN OTHERS
6353: THEN
6354: debug (' build_txn_relations failed '||SQLERRM);
6355: x_return_status := FND_API.G_RET_STS_ERROR ;
6351: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6352: WHEN OTHERS
6353: THEN
6354: debug (' build_txn_relations failed '||SQLERRM);
6355: x_return_status := FND_API.G_RET_STS_ERROR ;
6356: END build_txn_relations ;
6357: ---Added (End) for m-to-m enhancements
6358:
6359:
6396: BEGIN
6397: debug('Begin get_partner_rltns'|| p_txn_line_detail_rec.txn_line_detail_id );
6398: FOR txn_ii_relns_rec IN txn_ii_relns_cur(p_txn_line_detail_rec.txn_line_detail_id)
6399: LOOP
6400: l_txn_line_detail_query_rec.txn_line_detail_id := fnd_api.g_miss_num ;
6401: debug('Subject id : '|| txn_ii_relns_rec.subject_id);
6402: debug('object id : '|| txn_ii_relns_rec.object_id);
6403: l_index := l_index+1 ;
6404: debug('l_index :'|| l_index);
6452:
6453: ---get the txn line details
6454: csi_t_txn_details_grp.get_transaction_details(
6455: p_api_version => 1.0,
6456: p_commit => fnd_api.g_false,
6457: p_init_msg_list => fnd_api.g_false,
6458: p_validation_level => fnd_api.g_valid_level_full,
6459: p_txn_line_query_rec => l_txn_line_query_rec ,
6460: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
6453: ---get the txn line details
6454: csi_t_txn_details_grp.get_transaction_details(
6455: p_api_version => 1.0,
6456: p_commit => fnd_api.g_false,
6457: p_init_msg_list => fnd_api.g_false,
6458: p_validation_level => fnd_api.g_valid_level_full,
6459: p_txn_line_query_rec => l_txn_line_query_rec ,
6460: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
6461: x_txn_line_detail_tbl => l_txn_line_detail_tbl ,
6454: csi_t_txn_details_grp.get_transaction_details(
6455: p_api_version => 1.0,
6456: p_commit => fnd_api.g_false,
6457: p_init_msg_list => fnd_api.g_false,
6458: p_validation_level => fnd_api.g_valid_level_full,
6459: p_txn_line_query_rec => l_txn_line_query_rec ,
6460: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
6461: x_txn_line_detail_tbl => l_txn_line_detail_tbl ,
6462: p_get_parties_flag => fnd_api.g_false,
6458: p_validation_level => fnd_api.g_valid_level_full,
6459: p_txn_line_query_rec => l_txn_line_query_rec ,
6460: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
6461: x_txn_line_detail_tbl => l_txn_line_detail_tbl ,
6462: p_get_parties_flag => fnd_api.g_false,
6463: x_txn_party_detail_tbl => x_txn_party_detail_tbl ,
6464: p_get_pty_accts_flag => fnd_api.g_false,
6465: x_txn_pty_acct_detail_tbl => x_txn_pty_acct_detail_tbl,
6466: p_get_ii_rltns_flag => fnd_api.g_false,
6460: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
6461: x_txn_line_detail_tbl => l_txn_line_detail_tbl ,
6462: p_get_parties_flag => fnd_api.g_false,
6463: x_txn_party_detail_tbl => x_txn_party_detail_tbl ,
6464: p_get_pty_accts_flag => fnd_api.g_false,
6465: x_txn_pty_acct_detail_tbl => x_txn_pty_acct_detail_tbl,
6466: p_get_ii_rltns_flag => fnd_api.g_false,
6467: x_txn_ii_rltns_tbl => l_temp_txn_ii_rltns_tbl,
6468: p_get_org_assgns_flag => fnd_api.g_false,
6462: p_get_parties_flag => fnd_api.g_false,
6463: x_txn_party_detail_tbl => x_txn_party_detail_tbl ,
6464: p_get_pty_accts_flag => fnd_api.g_false,
6465: x_txn_pty_acct_detail_tbl => x_txn_pty_acct_detail_tbl,
6466: p_get_ii_rltns_flag => fnd_api.g_false,
6467: x_txn_ii_rltns_tbl => l_temp_txn_ii_rltns_tbl,
6468: p_get_org_assgns_flag => fnd_api.g_false,
6469: x_txn_org_assgn_tbl => x_txn_org_assgn_tbl,
6470: p_get_ext_attrib_vals_flag => fnd_api.g_false,
6464: p_get_pty_accts_flag => fnd_api.g_false,
6465: x_txn_pty_acct_detail_tbl => x_txn_pty_acct_detail_tbl,
6466: p_get_ii_rltns_flag => fnd_api.g_false,
6467: x_txn_ii_rltns_tbl => l_temp_txn_ii_rltns_tbl,
6468: p_get_org_assgns_flag => fnd_api.g_false,
6469: x_txn_org_assgn_tbl => x_txn_org_assgn_tbl,
6470: p_get_ext_attrib_vals_flag => fnd_api.g_false,
6471: x_txn_ext_attrib_vals_tbl => x_txn_ext_attrib_vals_tbl,
6472: p_get_csi_attribs_flag => fnd_api.g_false,
6466: p_get_ii_rltns_flag => fnd_api.g_false,
6467: x_txn_ii_rltns_tbl => l_temp_txn_ii_rltns_tbl,
6468: p_get_org_assgns_flag => fnd_api.g_false,
6469: x_txn_org_assgn_tbl => x_txn_org_assgn_tbl,
6470: p_get_ext_attrib_vals_flag => fnd_api.g_false,
6471: x_txn_ext_attrib_vals_tbl => x_txn_ext_attrib_vals_tbl,
6472: p_get_csi_attribs_flag => fnd_api.g_false,
6473: x_csi_ext_attribs_tbl => x_csi_ext_attribs_tbl,
6474: p_get_csi_iea_values_flag => fnd_api.g_false,
6468: p_get_org_assgns_flag => fnd_api.g_false,
6469: x_txn_org_assgn_tbl => x_txn_org_assgn_tbl,
6470: p_get_ext_attrib_vals_flag => fnd_api.g_false,
6471: x_txn_ext_attrib_vals_tbl => x_txn_ext_attrib_vals_tbl,
6472: p_get_csi_attribs_flag => fnd_api.g_false,
6473: x_csi_ext_attribs_tbl => x_csi_ext_attribs_tbl,
6474: p_get_csi_iea_values_flag => fnd_api.g_false,
6475: x_csi_iea_values_tbl => x_csi_iea_values_tbl ,
6476: p_get_txn_systems_flag => fnd_api.g_false ,
6470: p_get_ext_attrib_vals_flag => fnd_api.g_false,
6471: x_txn_ext_attrib_vals_tbl => x_txn_ext_attrib_vals_tbl,
6472: p_get_csi_attribs_flag => fnd_api.g_false,
6473: x_csi_ext_attribs_tbl => x_csi_ext_attribs_tbl,
6474: p_get_csi_iea_values_flag => fnd_api.g_false,
6475: x_csi_iea_values_tbl => x_csi_iea_values_tbl ,
6476: p_get_txn_systems_flag => fnd_api.g_false ,
6477: x_txn_systems_tbl => x_txn_systems_tbl ,
6478: x_return_status => x_return_status,
6472: p_get_csi_attribs_flag => fnd_api.g_false,
6473: x_csi_ext_attribs_tbl => x_csi_ext_attribs_tbl,
6474: p_get_csi_iea_values_flag => fnd_api.g_false,
6475: x_csi_iea_values_tbl => x_csi_iea_values_tbl ,
6476: p_get_txn_systems_flag => fnd_api.g_false ,
6477: x_txn_systems_tbl => x_txn_systems_tbl ,
6478: x_return_status => x_return_status,
6479: x_msg_count => x_msg_count,
6480: x_msg_data => x_msg_data);
6478: x_return_status => x_return_status,
6479: x_msg_count => x_msg_count,
6480: x_msg_data => x_msg_data);
6481:
6482: IF x_return_status <> fnd_api.g_ret_sts_success
6483: THEN
6484: RAISE fnd_api.g_exc_error;
6485: END IF;
6486:
6480: x_msg_data => x_msg_data);
6481:
6482: IF x_return_status <> fnd_api.g_ret_sts_success
6483: THEN
6484: RAISE fnd_api.g_exc_error;
6485: END IF;
6486:
6487: IF l_txn_line_detail_tbl.COUNT > 0 THEN
6488: FOR i IN l_txn_line_detail_tbl.FIRST .. l_txn_line_detail_tbl.LAST
6496: debug('End get_partner_relations');
6497: EXCEPTION
6498: WHEN OTHERS
6499: THEN
6500: x_return_status := FND_API.G_RET_STS_ERROR ;
6501: debug ('Error in get_partner_relations : '|| sqlerrm);
6502: END get_partner_rltns ;
6503: ---Added (End) for m-to-m enhancements
6504:
6519: l_instance_tbl csi_datastructures_pub.instance_tbl;
6520: l_o_instance_tbl csi_datastructures_pub.instance_tbl;
6521: l_o_ind binary_integer;
6522:
6523: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
6524: l_msg_data varchar2(512);
6525: l_msg_count number;
6526:
6527: BEGIN
6525: l_msg_count number;
6526:
6527: BEGIN
6528:
6529: x_return_status := fnd_api.g_ret_sts_success;
6530: api_log('split_instances');
6531:
6532: l_instance_tbl := px_instance_tbl;
6533: l_o_ind := 0;
6542: p_pkg_name => 'csi_item_instance_pvt');
6543:
6544: csi_item_instance_pvt.split_item_instance_lines(
6545: p_api_version => 1.0,
6546: p_commit => fnd_api.g_false,
6547: p_init_msg_list => fnd_api.g_true,
6548: p_validation_level => fnd_api.g_valid_level_full,
6549: p_source_instance_rec => l_instance_tbl(1),
6550: p_copy_ext_attribs => fnd_api.g_true,
6543:
6544: csi_item_instance_pvt.split_item_instance_lines(
6545: p_api_version => 1.0,
6546: p_commit => fnd_api.g_false,
6547: p_init_msg_list => fnd_api.g_true,
6548: p_validation_level => fnd_api.g_valid_level_full,
6549: p_source_instance_rec => l_instance_tbl(1),
6550: p_copy_ext_attribs => fnd_api.g_true,
6551: p_copy_org_assignments => fnd_api.g_true,
6544: csi_item_instance_pvt.split_item_instance_lines(
6545: p_api_version => 1.0,
6546: p_commit => fnd_api.g_false,
6547: p_init_msg_list => fnd_api.g_true,
6548: p_validation_level => fnd_api.g_valid_level_full,
6549: p_source_instance_rec => l_instance_tbl(1),
6550: p_copy_ext_attribs => fnd_api.g_true,
6551: p_copy_org_assignments => fnd_api.g_true,
6552: p_copy_parties => fnd_api.g_true,
6546: p_commit => fnd_api.g_false,
6547: p_init_msg_list => fnd_api.g_true,
6548: p_validation_level => fnd_api.g_valid_level_full,
6549: p_source_instance_rec => l_instance_tbl(1),
6550: p_copy_ext_attribs => fnd_api.g_true,
6551: p_copy_org_assignments => fnd_api.g_true,
6552: p_copy_parties => fnd_api.g_true,
6553: p_copy_accounts => fnd_api.g_true,
6554: p_copy_asset_assignments => fnd_api.g_true,
6547: p_init_msg_list => fnd_api.g_true,
6548: p_validation_level => fnd_api.g_valid_level_full,
6549: p_source_instance_rec => l_instance_tbl(1),
6550: p_copy_ext_attribs => fnd_api.g_true,
6551: p_copy_org_assignments => fnd_api.g_true,
6552: p_copy_parties => fnd_api.g_true,
6553: p_copy_accounts => fnd_api.g_true,
6554: p_copy_asset_assignments => fnd_api.g_true,
6555: p_copy_pricing_attribs => fnd_api.g_true,
6548: p_validation_level => fnd_api.g_valid_level_full,
6549: p_source_instance_rec => l_instance_tbl(1),
6550: p_copy_ext_attribs => fnd_api.g_true,
6551: p_copy_org_assignments => fnd_api.g_true,
6552: p_copy_parties => fnd_api.g_true,
6553: p_copy_accounts => fnd_api.g_true,
6554: p_copy_asset_assignments => fnd_api.g_true,
6555: p_copy_pricing_attribs => fnd_api.g_true,
6556: p_txn_rec => px_csi_txn_rec,
6549: p_source_instance_rec => l_instance_tbl(1),
6550: p_copy_ext_attribs => fnd_api.g_true,
6551: p_copy_org_assignments => fnd_api.g_true,
6552: p_copy_parties => fnd_api.g_true,
6553: p_copy_accounts => fnd_api.g_true,
6554: p_copy_asset_assignments => fnd_api.g_true,
6555: p_copy_pricing_attribs => fnd_api.g_true,
6556: p_txn_rec => px_csi_txn_rec,
6557: x_new_instance_tbl => l_n_instance_tbl,
6550: p_copy_ext_attribs => fnd_api.g_true,
6551: p_copy_org_assignments => fnd_api.g_true,
6552: p_copy_parties => fnd_api.g_true,
6553: p_copy_accounts => fnd_api.g_true,
6554: p_copy_asset_assignments => fnd_api.g_true,
6555: p_copy_pricing_attribs => fnd_api.g_true,
6556: p_txn_rec => px_csi_txn_rec,
6557: x_new_instance_tbl => l_n_instance_tbl,
6558: x_return_status => l_return_status,
6551: p_copy_org_assignments => fnd_api.g_true,
6552: p_copy_parties => fnd_api.g_true,
6553: p_copy_accounts => fnd_api.g_true,
6554: p_copy_asset_assignments => fnd_api.g_true,
6555: p_copy_pricing_attribs => fnd_api.g_true,
6556: p_txn_rec => px_csi_txn_rec,
6557: x_new_instance_tbl => l_n_instance_tbl,
6558: x_return_status => l_return_status,
6559: x_msg_count => l_msg_count,
6558: x_return_status => l_return_status,
6559: x_msg_count => l_msg_count,
6560: x_msg_data => l_msg_data);
6561:
6562: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6563: debug('Error splitting the item instances for distribution.');
6564: RAISE fnd_api.g_exc_error;
6565: END IF;
6566: ELSE
6560: x_msg_data => l_msg_data);
6561:
6562: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6563: debug('Error splitting the item instances for distribution.');
6564: RAISE fnd_api.g_exc_error;
6565: END IF;
6566: ELSE
6567: l_n_instance_tbl := l_instance_tbl;
6568: END IF;
6581:
6582: px_instance_tbl := l_o_instance_tbl;
6583:
6584: EXCEPTION
6585: WHEN fnd_api.g_exc_error THEN
6586: x_return_status := fnd_api.g_ret_sts_error;
6587:
6588: END split_instances;
6589:
6582: px_instance_tbl := l_o_instance_tbl;
6583:
6584: EXCEPTION
6585: WHEN fnd_api.g_exc_error THEN
6586: x_return_status := fnd_api.g_ret_sts_error;
6587:
6588: END split_instances;
6589:
6590:
6619: l_object_id number;
6620: l_inst_ind binary_integer;
6621:
6622: l_debug_level NUMBER;
6623: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
6624: l_msg_data varchar2(512);
6625: l_msg_count number;
6626: l_skip_instance varchar2(1) := 'N';
6627: BEGIN
6625: l_msg_count number;
6626: l_skip_instance varchar2(1) := 'N';
6627: BEGIN
6628:
6629: x_return_status := fnd_api.g_ret_sts_success;
6630:
6631: api_log('distribute_instances');
6632:
6633: l_instance_tbl := px_instance_tbl;
6648: debug ('The instance qty generated by the shipment interface '||
6649: l_instance_tbl(l_ind).quantity||' is greater than the MODEL/CHILD ratio '||
6650: p_quantity_ratio);
6651:
6652: RAISE fnd_api.g_exc_error;
6653: ELSE
6654: -- Bug 14471544 If the distribute instance is called for the first time,
6655: -- Skip processing as it would get called again after splitting the instance
6656: l_skip_instance := 'Y';
6686: END IF;
6687:
6688: IF l_object_id is not null THEN
6689:
6690: l_line_dtl_rec.txn_line_detail_id := fnd_api.g_miss_num;
6691: l_line_dtl_rec.transaction_line_id := p_model_txn_line_rec.transaction_line_id;
6692: l_line_dtl_rec.sub_type_id := csi_order_ship_pub.g_dflt_sub_type_id;
6693: l_line_dtl_rec.processing_status := 'IN_PROCESS';
6694: l_line_dtl_rec.source_transaction_flag := 'N';
6712: l_line_dtl_rec.object_version_number := 1.0;
6713:
6714: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
6715: p_api_version => 1.0,
6716: p_commit => fnd_api.g_false,
6717: p_init_msg_list => fnd_api.g_true,
6718: p_validation_level => fnd_api.g_valid_level_full,
6719: p_txn_line_dtl_index => 1,
6720: p_txn_line_dtl_rec => l_line_dtl_rec,
6713:
6714: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
6715: p_api_version => 1.0,
6716: p_commit => fnd_api.g_false,
6717: p_init_msg_list => fnd_api.g_true,
6718: p_validation_level => fnd_api.g_valid_level_full,
6719: p_txn_line_dtl_index => 1,
6720: p_txn_line_dtl_rec => l_line_dtl_rec,
6721: px_txn_party_dtl_tbl => l_pty_dtl_tbl,
6714: csi_t_txn_line_dtls_pvt.create_txn_line_dtls(
6715: p_api_version => 1.0,
6716: p_commit => fnd_api.g_false,
6717: p_init_msg_list => fnd_api.g_true,
6718: p_validation_level => fnd_api.g_valid_level_full,
6719: p_txn_line_dtl_index => 1,
6720: p_txn_line_dtl_rec => l_line_dtl_rec,
6721: px_txn_party_dtl_tbl => l_pty_dtl_tbl,
6722: px_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
6726: x_return_status => l_return_status,
6727: x_msg_count => l_msg_count,
6728: x_msg_data => l_msg_data);
6729:
6730: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6731: raise fnd_api.g_exc_error;
6732: END IF;
6733:
6734: -- build ii_rltns table
6727: x_msg_count => l_msg_count,
6728: x_msg_data => l_msg_data);
6729:
6730: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6731: raise fnd_api.g_exc_error;
6732: END IF;
6733:
6734: -- build ii_rltns table
6735: l_ii_rltns_tbl(1).txn_relationship_id := fnd_api.g_miss_num;
6731: raise fnd_api.g_exc_error;
6732: END IF;
6733:
6734: -- build ii_rltns table
6735: l_ii_rltns_tbl(1).txn_relationship_id := fnd_api.g_miss_num;
6736: l_ii_rltns_tbl(1).transaction_line_id := p_model_txn_line_rec.transaction_line_id;
6737: l_ii_rltns_tbl(1).subject_id := l_line_dtl_rec.txn_line_detail_id;
6738: l_ii_rltns_tbl(1).object_id := l_object_id;
6739: l_ii_rltns_tbl(1).relationship_type_code := 'COMPONENT-OF';
6740: l_ii_rltns_tbl(1).active_start_date := sysdate;
6741:
6742: csi_t_txn_rltnshps_grp.create_txn_ii_rltns_dtls(
6743: p_api_version => 1.0,
6744: p_commit => fnd_api.g_false,
6745: p_init_msg_list => fnd_api.g_true,
6746: p_validation_level => fnd_api.g_valid_level_full,
6747: px_txn_ii_rltns_tbl => l_ii_rltns_tbl,
6748: x_return_status => l_return_status,
6741:
6742: csi_t_txn_rltnshps_grp.create_txn_ii_rltns_dtls(
6743: p_api_version => 1.0,
6744: p_commit => fnd_api.g_false,
6745: p_init_msg_list => fnd_api.g_true,
6746: p_validation_level => fnd_api.g_valid_level_full,
6747: px_txn_ii_rltns_tbl => l_ii_rltns_tbl,
6748: x_return_status => l_return_status,
6749: x_msg_count => l_msg_count,
6742: csi_t_txn_rltnshps_grp.create_txn_ii_rltns_dtls(
6743: p_api_version => 1.0,
6744: p_commit => fnd_api.g_false,
6745: p_init_msg_list => fnd_api.g_true,
6746: p_validation_level => fnd_api.g_valid_level_full,
6747: px_txn_ii_rltns_tbl => l_ii_rltns_tbl,
6748: x_return_status => l_return_status,
6749: x_msg_count => l_msg_count,
6750: x_msg_data => l_msg_data);
6748: x_return_status => l_return_status,
6749: x_msg_count => l_msg_count,
6750: x_msg_data => l_msg_data);
6751:
6752: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6753: debug('Error creating txn ii relation for the ATO/PTO Child');
6754: raise fnd_api.g_exc_error;
6755: END IF;
6756:
6750: x_msg_data => l_msg_data);
6751:
6752: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6753: debug('Error creating txn ii relation for the ATO/PTO Child');
6754: raise fnd_api.g_exc_error;
6755: END IF;
6756:
6757: END IF;
6758:
6773:
6774: END IF;
6775:
6776: EXCEPTION
6777: WHEN fnd_api.g_exc_error THEN
6778: x_return_status := fnd_api.g_ret_sts_error;
6779: END distribute_instances;
6780:
6781: PROCEDURE query_immediate_children (
6774: END IF;
6775:
6776: EXCEPTION
6777: WHEN fnd_api.g_exc_error THEN
6778: x_return_status := fnd_api.g_ret_sts_error;
6779: END distribute_instances;
6780:
6781: PROCEDURE query_immediate_children (
6782: p_header_id IN number,
6851: l_ib_trackable_flag varchar2(1);
6852:
6853: BEGIN
6854:
6855: x_return_status := fnd_api.g_ret_sts_success;
6856: api_log('get_config_children');
6857:
6858: l_final_ind := 0;
6859:
6925: x_trackable_line_tbl OUT NOCOPY oe_order_pub.line_tbl_type,
6926: x_return_status OUT NOCOPY varchar2)
6927: IS
6928: l_line_tbl oe_order_pub.line_tbl_type;
6929: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
6930: BEGIN
6931: x_return_status := fnd_api.g_ret_sts_success;
6932: api_log('get_ib_trackable_children');
6933: IF p_order_line_rec.item_type_code = 'CONFIG' THEN
6927: IS
6928: l_line_tbl oe_order_pub.line_tbl_type;
6929: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
6930: BEGIN
6931: x_return_status := fnd_api.g_ret_sts_success;
6932: api_log('get_ib_trackable_children');
6933: IF p_order_line_rec.item_type_code = 'CONFIG' THEN
6934: get_config_children(
6935: p_header_id => p_order_line_rec.header_id,
6936: p_current_line_id => p_order_line_rec.ato_line_id,
6937: p_om_vld_org_id => p_order_line_rec.om_vld_org_id,
6938: x_trackable_line_tbl => l_line_tbl,
6939: x_return_status => l_return_status);
6940: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6941: RAISE fnd_api.g_exc_error;
6942: END IF;
6943: ELSE
6944: csi_order_fulfill_pub.get_ib_trackable_children(
6937: p_om_vld_org_id => p_order_line_rec.om_vld_org_id,
6938: x_trackable_line_tbl => l_line_tbl,
6939: x_return_status => l_return_status);
6940: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6941: RAISE fnd_api.g_exc_error;
6942: END IF;
6943: ELSE
6944: csi_order_fulfill_pub.get_ib_trackable_children(
6945: p_current_line_id => p_order_line_rec.order_line_id,
6946: p_om_vld_org_id => p_order_line_rec.om_vld_org_id,
6947: x_trackable_line_tbl => l_line_tbl,
6948: x_return_status => l_return_status);
6949:
6950: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6951: RAISE fnd_api.g_exc_error;
6952: END IF;
6953: END IF;
6954: x_trackable_line_tbl := l_line_tbl;
6947: x_trackable_line_tbl => l_line_tbl,
6948: x_return_status => l_return_status);
6949:
6950: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6951: RAISE fnd_api.g_exc_error;
6952: END IF;
6953: END IF;
6954: x_trackable_line_tbl := l_line_tbl;
6955: EXCEPTION
6952: END IF;
6953: END IF;
6954: x_trackable_line_tbl := l_line_tbl;
6955: EXCEPTION
6956: WHEN fnd_api.g_exc_error THEN
6957: x_return_status := fnd_api.g_ret_sts_error;
6958: END get_ib_trackable_children;
6959:
6960:
6953: END IF;
6954: x_trackable_line_tbl := l_line_tbl;
6955: EXCEPTION
6956: WHEN fnd_api.g_exc_error THEN
6957: x_return_status := fnd_api.g_ret_sts_error;
6958: END get_ib_trackable_children;
6959:
6960:
6961: PROCEDURE filter_processed_instances(
6988: --end of fix bug4607042
6989:
6990:
6991: BEGIN
6992: x_return_status := fnd_api.g_ret_sts_success;
6993: api_log('filter_processed_instances');
6994:
6995: debug(' instance_tbl count :'||px_instance_tbl.COUNT);
6996:
7061:
7062: l_object_id number;
7063: l_debug_level number;
7064:
7065: l_return_status varchar2(1) := fnd_api.g_ret_sts_success;
7066: l_msg_data varchar2(512);
7067: l_msg_count number;
7068:
7069: l_txn_ps_tbl csi_utl_pkg.txn_ps_tbl;
7078:
7079:
7080: BEGIN
7081:
7082: x_return_status := fnd_api.g_ret_sts_success;
7083: api_log('build_child_relation');
7084:
7085: get_ib_trackable_children(
7086: p_order_line_rec => p_order_line_rec,
7086: p_order_line_rec => p_order_line_rec,
7087: x_trackable_line_tbl => l_line_tbl,
7088: x_return_status => l_return_status);
7089:
7090: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7091: RAISE fnd_api.g_exc_error;
7092: END IF;
7093:
7094: debug('IB Trackable Children Count :'||l_line_tbl.COUNT);
7087: x_trackable_line_tbl => l_line_tbl,
7088: x_return_status => l_return_status);
7089:
7090: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7091: RAISE fnd_api.g_exc_error;
7092: END IF;
7093:
7094: debug('IB Trackable Children Count :'||l_line_tbl.COUNT);
7095:
7126: l_txn_line_detail_query_rec.processing_status := 'IN_PROCESS';
7127:
7128: csi_t_txn_details_grp.get_transaction_details(
7129: p_api_version => 1,
7130: p_commit => fnd_api.g_false,
7131: p_init_msg_list => fnd_api.g_true,
7132: p_validation_level => fnd_api.g_valid_level_full,
7133: p_txn_line_query_rec => l_txn_line_query_rec,
7134: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
7127:
7128: csi_t_txn_details_grp.get_transaction_details(
7129: p_api_version => 1,
7130: p_commit => fnd_api.g_false,
7131: p_init_msg_list => fnd_api.g_true,
7132: p_validation_level => fnd_api.g_valid_level_full,
7133: p_txn_line_query_rec => l_txn_line_query_rec,
7134: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
7135: x_txn_line_detail_tbl => l_line_dtl_tbl,
7128: csi_t_txn_details_grp.get_transaction_details(
7129: p_api_version => 1,
7130: p_commit => fnd_api.g_false,
7131: p_init_msg_list => fnd_api.g_true,
7132: p_validation_level => fnd_api.g_valid_level_full,
7133: p_txn_line_query_rec => l_txn_line_query_rec,
7134: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
7135: x_txn_line_detail_tbl => l_line_dtl_tbl,
7136: p_get_parties_flag => fnd_api.g_false,
7132: p_validation_level => fnd_api.g_valid_level_full,
7133: p_txn_line_query_rec => l_txn_line_query_rec,
7134: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
7135: x_txn_line_detail_tbl => l_line_dtl_tbl,
7136: p_get_parties_flag => fnd_api.g_false,
7137: x_txn_party_detail_tbl => l_pty_dtl_tbl,
7138: p_get_pty_accts_flag => fnd_api.g_false,
7139: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
7140: p_get_ii_rltns_flag => fnd_api.g_false,
7134: p_txn_line_detail_query_rec => l_txn_line_detail_query_rec,
7135: x_txn_line_detail_tbl => l_line_dtl_tbl,
7136: p_get_parties_flag => fnd_api.g_false,
7137: x_txn_party_detail_tbl => l_pty_dtl_tbl,
7138: p_get_pty_accts_flag => fnd_api.g_false,
7139: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
7140: p_get_ii_rltns_flag => fnd_api.g_false,
7141: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
7142: p_get_org_assgns_flag => fnd_api.g_false,
7136: p_get_parties_flag => fnd_api.g_false,
7137: x_txn_party_detail_tbl => l_pty_dtl_tbl,
7138: p_get_pty_accts_flag => fnd_api.g_false,
7139: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
7140: p_get_ii_rltns_flag => fnd_api.g_false,
7141: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
7142: p_get_org_assgns_flag => fnd_api.g_false,
7143: x_txn_org_assgn_tbl => l_org_assgn_tbl,
7144: p_get_ext_attrib_vals_flag => fnd_api.g_false,
7138: p_get_pty_accts_flag => fnd_api.g_false,
7139: x_txn_pty_acct_detail_tbl => l_pty_acct_tbl,
7140: p_get_ii_rltns_flag => fnd_api.g_false,
7141: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
7142: p_get_org_assgns_flag => fnd_api.g_false,
7143: x_txn_org_assgn_tbl => l_org_assgn_tbl,
7144: p_get_ext_attrib_vals_flag => fnd_api.g_false,
7145: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
7146: p_get_csi_attribs_flag => fnd_api.g_false,
7140: p_get_ii_rltns_flag => fnd_api.g_false,
7141: x_txn_ii_rltns_tbl => l_ii_rltns_tbl,
7142: p_get_org_assgns_flag => fnd_api.g_false,
7143: x_txn_org_assgn_tbl => l_org_assgn_tbl,
7144: p_get_ext_attrib_vals_flag => fnd_api.g_false,
7145: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
7146: p_get_csi_attribs_flag => fnd_api.g_false,
7147: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
7148: p_get_csi_iea_values_flag => fnd_api.g_false,
7142: p_get_org_assgns_flag => fnd_api.g_false,
7143: x_txn_org_assgn_tbl => l_org_assgn_tbl,
7144: p_get_ext_attrib_vals_flag => fnd_api.g_false,
7145: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
7146: p_get_csi_attribs_flag => fnd_api.g_false,
7147: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
7148: p_get_csi_iea_values_flag => fnd_api.g_false,
7149: x_csi_iea_values_tbl => l_csi_eav_tbl,
7150: p_get_txn_systems_flag => fnd_api.g_false,
7144: p_get_ext_attrib_vals_flag => fnd_api.g_false,
7145: x_txn_ext_attrib_vals_tbl => l_ext_attrib_tbl,
7146: p_get_csi_attribs_flag => fnd_api.g_false,
7147: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
7148: p_get_csi_iea_values_flag => fnd_api.g_false,
7149: x_csi_iea_values_tbl => l_csi_eav_tbl,
7150: p_get_txn_systems_flag => fnd_api.g_false,
7151: x_txn_systems_tbl => l_txn_systems_tbl,
7152: x_return_status => l_return_status,
7146: p_get_csi_attribs_flag => fnd_api.g_false,
7147: x_csi_ext_attribs_tbl => l_csi_ea_tbl,
7148: p_get_csi_iea_values_flag => fnd_api.g_false,
7149: x_csi_iea_values_tbl => l_csi_eav_tbl,
7150: p_get_txn_systems_flag => fnd_api.g_false,
7151: x_txn_systems_tbl => l_txn_systems_tbl,
7152: x_return_status => l_return_status,
7153: x_msg_count => l_msg_count,
7154: x_msg_data => l_msg_data);
7152: x_return_status => l_return_status,
7153: x_msg_count => l_msg_count,
7154: x_msg_data => l_msg_data);
7155:
7156: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7157: raise fnd_api.g_exc_error;
7158: END IF;
7159: debug(' Source Txn Line Detail COUNT :'||l_line_dtl_tbl.COUNT);
7160:
7153: x_msg_count => l_msg_count,
7154: x_msg_data => l_msg_data);
7155:
7156: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7157: raise fnd_api.g_exc_error;
7158: END IF;
7159: debug(' Source Txn Line Detail COUNT :'||l_line_dtl_tbl.COUNT);
7160:
7161: FOR l_ol_ind in l_line_tbl.FIRST..l_line_tbl.LAST
7207: p_pkg_name => 'csi_item_instance_pub');
7208:
7209: csi_item_instance_pub.get_item_instances(
7210: p_api_version => 1.0,
7211: p_commit => fnd_api.g_false,
7212: p_init_msg_list => fnd_api.g_true,
7213: p_validation_level => fnd_api.g_valid_level_full,
7214: p_instance_query_rec => l_inst_query_rec,
7215: p_party_query_rec => l_party_query_rec,
7208:
7209: csi_item_instance_pub.get_item_instances(
7210: p_api_version => 1.0,
7211: p_commit => fnd_api.g_false,
7212: p_init_msg_list => fnd_api.g_true,
7213: p_validation_level => fnd_api.g_valid_level_full,
7214: p_instance_query_rec => l_inst_query_rec,
7215: p_party_query_rec => l_party_query_rec,
7216: p_account_query_rec => l_pty_acct_query_rec,
7209: csi_item_instance_pub.get_item_instances(
7210: p_api_version => 1.0,
7211: p_commit => fnd_api.g_false,
7212: p_init_msg_list => fnd_api.g_true,
7213: p_validation_level => fnd_api.g_valid_level_full,
7214: p_instance_query_rec => l_inst_query_rec,
7215: p_party_query_rec => l_party_query_rec,
7216: p_account_query_rec => l_pty_acct_query_rec,
7217: p_transaction_id => null,
7214: p_instance_query_rec => l_inst_query_rec,
7215: p_party_query_rec => l_party_query_rec,
7216: p_account_query_rec => l_pty_acct_query_rec,
7217: p_transaction_id => null,
7218: p_resolve_id_columns => fnd_api.g_false,
7219: p_active_instance_only => fnd_api.g_true,
7220: x_instance_header_tbl => l_instance_hdr_tbl,
7221: x_return_status => l_return_status,
7222: x_msg_count => l_msg_count,
7215: p_party_query_rec => l_party_query_rec,
7216: p_account_query_rec => l_pty_acct_query_rec,
7217: p_transaction_id => null,
7218: p_resolve_id_columns => fnd_api.g_false,
7219: p_active_instance_only => fnd_api.g_true,
7220: x_instance_header_tbl => l_instance_hdr_tbl,
7221: x_return_status => l_return_status,
7222: x_msg_count => l_msg_count,
7223: x_msg_data => l_msg_data );
7221: x_return_status => l_return_status,
7222: x_msg_count => l_msg_count,
7223: x_msg_data => l_msg_data );
7224:
7225: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7226: raise fnd_api.g_exc_error;
7227: END IF;
7228: --fix for bug5096435
7229: IF l_instance_hdr_tbl.COUNT > 0 THEN
7222: x_msg_count => l_msg_count,
7223: x_msg_data => l_msg_data );
7224:
7225: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7226: raise fnd_api.g_exc_error;
7227: END IF;
7228: --fix for bug5096435
7229: IF l_instance_hdr_tbl.COUNT > 0 THEN
7230: debug('instances found for the child order line : '||l_instance_hdr_tbl.COUNT);
7258: p_instance_header_tbl => l_temp_instance_hdr_tbl, --fix for bug5096435
7259: x_instance_tbl => l_instance_tbl,
7260: x_return_status => l_return_status);
7261:
7262: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7263: RAISE fnd_api.g_exc_error;
7264: END IF;
7265:
7266: l_temp_instance_hdr_tbl.DELETE;
7259: x_instance_tbl => l_instance_tbl,
7260: x_return_status => l_return_status);
7261:
7262: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7263: RAISE fnd_api.g_exc_error;
7264: END IF;
7265:
7266: l_temp_instance_hdr_tbl.DELETE;
7267:
7269: p_order_line_id => p_order_line_rec.order_line_id,
7270: px_instance_tbl => l_instance_tbl,
7271: x_return_status => l_return_status);
7272:
7273: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7274: RAISE fnd_api.g_exc_error;
7275: END IF;
7276:
7277: IF l_instance_tbl.count > 0 THEN
7270: px_instance_tbl => l_instance_tbl,
7271: x_return_status => l_return_status);
7272:
7273: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7274: RAISE fnd_api.g_exc_error;
7275: END IF;
7276:
7277: IF l_instance_tbl.count > 0 THEN
7278:
7306: px_instance_tbl => l_instance_tbl,
7307: px_txn_ps_tbl => l_txn_ps_tbl,
7308: x_return_status => l_return_status);
7309:
7310: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7311: RAISE fnd_api.g_exc_error;
7312: END IF;
7313:
7314: IF l_instance_tbl.COUNT > 0 THEN
7307: px_txn_ps_tbl => l_txn_ps_tbl,
7308: x_return_status => l_return_status);
7309:
7310: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7311: RAISE fnd_api.g_exc_error;
7312: END IF;
7313:
7314: IF l_instance_tbl.COUNT > 0 THEN
7315: debug('There exist unresolved instances. So splitting instances.');
7318: px_csi_txn_rec => px_csi_txn_rec,
7319: px_instance_tbl => l_instance_tbl,
7320: x_return_status => l_return_status);
7321:
7322: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7323: RAISE fnd_api.g_exc_error;
7324: END IF;
7325:
7326: debug('Re-distributing after the split.');
7319: px_instance_tbl => l_instance_tbl,
7320: x_return_status => l_return_status);
7321:
7322: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7323: RAISE fnd_api.g_exc_error;
7324: END IF;
7325:
7326: debug('Re-distributing after the split.');
7327:
7332: px_instance_tbl => l_instance_tbl,
7333: px_txn_ps_tbl => l_txn_ps_tbl,
7334: x_return_status => l_return_status);
7335:
7336: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7337: RAISE fnd_api.g_exc_error;
7338: END IF;
7339: END IF; --<
7340: END IF; --<
7333: px_txn_ps_tbl => l_txn_ps_tbl,
7334: x_return_status => l_return_status);
7335:
7336: IF l_return_status <> fnd_api.g_ret_sts_success THEN
7337: RAISE fnd_api.g_exc_error;
7338: END IF;
7339: END IF; --<
7340: END IF; --<
7341: END IF; --<
7343: END LOOP; -- child order lines loop
7344: END IF; --<
7345:
7346: EXCEPTION
7347: WHEN fnd_api.g_exc_error THEN
7348: x_return_status := fnd_api.g_ret_sts_error;
7349: END build_child_relation;
7350:
7351: PROCEDURE get_unit_price_in_primary_uom(
7344: END IF; --<
7345:
7346: EXCEPTION
7347: WHEN fnd_api.g_exc_error THEN
7348: x_return_status := fnd_api.g_ret_sts_error;
7349: END build_child_relation;
7350:
7351: PROCEDURE get_unit_price_in_primary_uom(
7352: p_unit_price IN number,
7359: BEGIN
7360:
7361: api_log('get_unit_price_in_primary_uom');
7362:
7363: x_return_status := fnd_api.g_ret_sts_success;
7364:
7365: IF nvl(px_item_control_rec.primary_uom_code, fnd_api.g_miss_char) = fnd_api.g_miss_char THEN
7366:
7367: px_item_control_rec.primary_uom_code := csi_utl_pkg.get_primay_uom(
7361: api_log('get_unit_price_in_primary_uom');
7362:
7363: x_return_status := fnd_api.g_ret_sts_success;
7364:
7365: IF nvl(px_item_control_rec.primary_uom_code, fnd_api.g_miss_char) = fnd_api.g_miss_char THEN
7366:
7367: px_item_control_rec.primary_uom_code := csi_utl_pkg.get_primay_uom(
7368: p_inv_item_id => px_item_control_rec.inventory_item_id,
7369: p_inv_org_id => px_item_control_rec.organization_id);
7379: debug(' uom conv rate : '||l_uom_conv_rate);
7380:
7381: IF l_uom_conv_rate = -99999 THEN
7382: debug(' inv_convert.inv_um_conversion failed ');
7383: RAISE fnd_api.g_exc_error;
7384: END IF;
7385:
7386: x_unit_price_in_primary_uom := p_unit_price/l_uom_conv_rate;
7387:
7387:
7388: debug(' unit price in primary uom : '||x_unit_price_in_primary_uom);
7389:
7390: EXCEPTION
7391: WHEN fnd_api.g_exc_error THEN
7392: x_return_status := fnd_api.g_ret_sts_error;
7393: END get_unit_price_in_primary_uom;
7394:
7395: FUNCTION EntitledContracts (p_instance_id IN number)
7388: debug(' unit price in primary uom : '||x_unit_price_in_primary_uom);
7389:
7390: EXCEPTION
7391: WHEN fnd_api.g_exc_error THEN
7392: x_return_status := fnd_api.g_ret_sts_error;
7393: END get_unit_price_in_primary_uom;
7394:
7395: FUNCTION EntitledContracts (p_instance_id IN number)
7396: RETURN varchar2