172: px_inst_pa_rec.party_id <> px_inst_pa_rec.src_txn_party_id
173: AND
174: px_inst_pa_rec.ownership_ovr_flag = 'N' THEN
175:
176: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
177: fnd_message.set_token('INSTANCE_ID', px_inst_pa_rec.instance_id );
178: fnd_message.set_token('OLD_PARTY_ID', px_inst_pa_rec.party_id );
179: fnd_message.set_token('NEW_PARTY_ID', px_inst_pa_rec.src_txn_party_id );
180: fnd_msg_pub.add;
173: AND
174: px_inst_pa_rec.ownership_ovr_flag = 'N' THEN
175:
176: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
177: fnd_message.set_token('INSTANCE_ID', px_inst_pa_rec.instance_id );
178: fnd_message.set_token('OLD_PARTY_ID', px_inst_pa_rec.party_id );
179: fnd_message.set_token('NEW_PARTY_ID', px_inst_pa_rec.src_txn_party_id );
180: fnd_msg_pub.add;
181: l_return_status := fnd_api.g_ret_sts_error;
174: px_inst_pa_rec.ownership_ovr_flag = 'N' THEN
175:
176: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
177: fnd_message.set_token('INSTANCE_ID', px_inst_pa_rec.instance_id );
178: fnd_message.set_token('OLD_PARTY_ID', px_inst_pa_rec.party_id );
179: fnd_message.set_token('NEW_PARTY_ID', px_inst_pa_rec.src_txn_party_id );
180: fnd_msg_pub.add;
181: l_return_status := fnd_api.g_ret_sts_error;
182: RAISE fnd_api.g_exc_error;
175:
176: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
177: fnd_message.set_token('INSTANCE_ID', px_inst_pa_rec.instance_id );
178: fnd_message.set_token('OLD_PARTY_ID', px_inst_pa_rec.party_id );
179: fnd_message.set_token('NEW_PARTY_ID', px_inst_pa_rec.src_txn_party_id );
180: fnd_msg_pub.add;
181: l_return_status := fnd_api.g_ret_sts_error;
182: RAISE fnd_api.g_exc_error;
183: END IF;
207: debug(' Dflt Sub Type ID :'||x_sub_type_id);
208:
209: EXCEPTION
210: WHEN no_data_found THEN
211: fnd_message.set_name('CSI', 'CSI_DFLT_SUB_TYPE_MISSING');
212: fnd_message.set_token('TXN_TYPE_ID', p_transaction_type_id);
213: fnd_msg_pub.add;
214: x_return_status := fnd_api.g_ret_sts_error;
215: WHEN too_many_rows THEN
208:
209: EXCEPTION
210: WHEN no_data_found THEN
211: fnd_message.set_name('CSI', 'CSI_DFLT_SUB_TYPE_MISSING');
212: fnd_message.set_token('TXN_TYPE_ID', p_transaction_type_id);
213: fnd_msg_pub.add;
214: x_return_status := fnd_api.g_ret_sts_error;
215: WHEN too_many_rows THEN
216: fnd_message.set_name('CSI', 'CSI_MANY_DFLT_SUB_TYPES');
212: fnd_message.set_token('TXN_TYPE_ID', p_transaction_type_id);
213: fnd_msg_pub.add;
214: x_return_status := fnd_api.g_ret_sts_error;
215: WHEN too_many_rows THEN
216: fnd_message.set_name('CSI', 'CSI_MANY_DFLT_SUB_TYPES');
217: fnd_message.set_token('TXN_TYPE_ID', p_transaction_type_id);
218: fnd_msg_pub.add;
219: x_return_status := fnd_api.g_ret_sts_error;
220:
213: fnd_msg_pub.add;
214: x_return_status := fnd_api.g_ret_sts_error;
215: WHEN too_many_rows THEN
216: fnd_message.set_name('CSI', 'CSI_MANY_DFLT_SUB_TYPES');
217: fnd_message.set_token('TXN_TYPE_ID', p_transaction_type_id);
218: fnd_msg_pub.add;
219: x_return_status := fnd_api.g_ret_sts_error;
220:
221: END get_dflt_sub_type_id;
249: debug(' src_return_reqd :'||x_sub_type_rec.src_return_reqd);
250:
251: EXCEPTION
252: WHEN no_data_found THEN
253: fnd_message.set_name('CSI', 'CSI_INT_SUB_TYPE_REC_MISSING');
254: fnd_message.set_token('SUB_TYPE_ID', p_sub_type_id);
255: fnd_message.set_token('TRANSACTION_TYPE_ID', p_transaction_type_id);
256: fnd_msg_pub.add;
257: x_return_status := fnd_api.g_ret_sts_error;
250:
251: EXCEPTION
252: WHEN no_data_found THEN
253: fnd_message.set_name('CSI', 'CSI_INT_SUB_TYPE_REC_MISSING');
254: fnd_message.set_token('SUB_TYPE_ID', p_sub_type_id);
255: fnd_message.set_token('TRANSACTION_TYPE_ID', p_transaction_type_id);
256: fnd_msg_pub.add;
257: x_return_status := fnd_api.g_ret_sts_error;
258: END get_sub_type_rec;
251: EXCEPTION
252: WHEN no_data_found THEN
253: fnd_message.set_name('CSI', 'CSI_INT_SUB_TYPE_REC_MISSING');
254: fnd_message.set_token('SUB_TYPE_ID', p_sub_type_id);
255: fnd_message.set_token('TRANSACTION_TYPE_ID', p_transaction_type_id);
256: fnd_msg_pub.add;
257: x_return_status := fnd_api.g_ret_sts_error;
258: END get_sub_type_rec;
259:
280: WHERE transaction_id = p_mtl_txn_id;
281:
282: EXCEPTION
283: WHEN no_data_found THEN
284: fnd_message.set_name('CSI','CSI_NO_INVENTORY_RECORDS');
285: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_txn_id);
286: fnd_msg_pub.add;
287: RAISE fnd_api.g_exc_error;
288: END;
281:
282: EXCEPTION
283: WHEN no_data_found THEN
284: fnd_message.set_name('CSI','CSI_NO_INVENTORY_RECORDS');
285: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_txn_id);
286: fnd_msg_pub.add;
287: RAISE fnd_api.g_exc_error;
288: END;
289:
306: WHERE inventory_item_id = l_item_control_rec.inventory_item_id
307: AND organization_id = l_item_control_rec.organization_id;
308: EXCEPTION
309: WHEN no_data_found THEN
310: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
311: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
312: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
313: fnd_msg_pub.add;
314: RAISE fnd_api.g_exc_error;
307: AND organization_id = l_item_control_rec.organization_id;
308: EXCEPTION
309: WHEN no_data_found THEN
310: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
311: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
312: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
313: fnd_msg_pub.add;
314: RAISE fnd_api.g_exc_error;
315: END;
308: EXCEPTION
309: WHEN no_data_found THEN
310: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
311: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
312: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
313: fnd_msg_pub.add;
314: RAISE fnd_api.g_exc_error;
315: END;
316:
323: EXCEPTION
324: WHEN too_many_rows THEN
325: l_item_control_rec.mult_srl_control_flag := 'Y';
326: WHEN no_data_found THEN
327: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
328: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
329: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
330: fnd_msg_pub.add;
331: RAISE fnd_api.g_exc_error;
324: WHEN too_many_rows THEN
325: l_item_control_rec.mult_srl_control_flag := 'Y';
326: WHEN no_data_found THEN
327: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
328: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
329: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
330: fnd_msg_pub.add;
331: RAISE fnd_api.g_exc_error;
332: END;
325: l_item_control_rec.mult_srl_control_flag := 'Y';
326: WHEN no_data_found THEN
327: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
328: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
329: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
330: fnd_msg_pub.add;
331: RAISE fnd_api.g_exc_error;
332: END;
333:
390:
391: IF x_partner_order_rec.IB_OWNER = 'END_CUSTOMER' THEN
392:
393: IF x_partner_order_rec.END_CUSTOMER_ID is null Then
394: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
395: fnd_msg_pub.add;
396: raise fnd_api.g_exc_error;
397: ELSE
398: BEGIN
403: FROM hz_cust_accounts
404: WHERE cust_account_id = x_partner_order_rec.END_CUSTOMER_ID;
405: EXCEPTION
406: WHEN no_data_found THEN
407: fnd_message.set_name('CSI','CSI_INT_INV_CUST_ACCT_ID');
408: fnd_message.set_token('CUST_ACCOUNT_ID', x_partner_order_rec.END_CUSTOMER_ID);
409: fnd_msg_pub.add;
410: RAISE fnd_api.g_exc_error;
411: END;
404: WHERE cust_account_id = x_partner_order_rec.END_CUSTOMER_ID;
405: EXCEPTION
406: WHEN no_data_found THEN
407: fnd_message.set_name('CSI','CSI_INT_INV_CUST_ACCT_ID');
408: fnd_message.set_token('CUST_ACCOUNT_ID', x_partner_order_rec.END_CUSTOMER_ID);
409: fnd_msg_pub.add;
410: RAISE fnd_api.g_exc_error;
411: END;
412:
495: WHERE HCSU.site_use_id = l_cust_acct_site_use_id
496: AND HCAS.cust_acct_site_id = HCSU.cust_acct_site_id;
497: EXCEPTION
498: WHEN no_data_found THEN
499: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
500: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
501: fnd_message.set_token('SITE_USE_CODE','SHIP_TO');
502: fnd_msg_pub.add;
503: raise fnd_api.g_exc_error;
496: AND HCAS.cust_acct_site_id = HCSU.cust_acct_site_id;
497: EXCEPTION
498: WHEN no_data_found THEN
499: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
500: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
501: fnd_message.set_token('SITE_USE_CODE','SHIP_TO');
502: fnd_msg_pub.add;
503: raise fnd_api.g_exc_error;
504: END;
497: EXCEPTION
498: WHEN no_data_found THEN
499: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
500: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
501: fnd_message.set_token('SITE_USE_CODE','SHIP_TO');
502: fnd_msg_pub.add;
503: raise fnd_api.g_exc_error;
504: END;
505: ELSE -- null for both ship and Invoice to org in RMA's - Self bug. Raise the error much before rather than in the API. shegde
502: fnd_msg_pub.add;
503: raise fnd_api.g_exc_error;
504: END;
505: ELSE -- null for both ship and Invoice to org in RMA's - Self bug. Raise the error much before rather than in the API. shegde
506: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
507: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
508: fnd_message.set_token('SITE_USE_CODE','INVOICE_TO');
509: fnd_msg_pub.add;
510: raise fnd_api.g_exc_error;
503: raise fnd_api.g_exc_error;
504: END;
505: ELSE -- null for both ship and Invoice to org in RMA's - Self bug. Raise the error much before rather than in the API. shegde
506: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
507: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
508: fnd_message.set_token('SITE_USE_CODE','INVOICE_TO');
509: fnd_msg_pub.add;
510: raise fnd_api.g_exc_error;
511: END IF;
504: END;
505: ELSE -- null for both ship and Invoice to org in RMA's - Self bug. Raise the error much before rather than in the API. shegde
506: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
507: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
508: fnd_message.set_token('SITE_USE_CODE','INVOICE_TO');
509: fnd_msg_pub.add;
510: raise fnd_api.g_exc_error;
511: END IF;
512: EXCEPTION
810: l_dest_mtl_txn_tbl := l_src_mtl_txn_tbl;
811: END IF;
812:
813: IF l_s_ind = 0 then
814: fnd_message.set_name('CSI','CSI_NO_INVENTORY_RECORDS');
815: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_txn_id);
816: fnd_msg_pub.add;
817: RAISE fnd_api.g_exc_error;
818: END IF;
811: END IF;
812:
813: IF l_s_ind = 0 then
814: fnd_message.set_name('CSI','CSI_NO_INVENTORY_RECORDS');
815: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_txn_id);
816: fnd_msg_pub.add;
817: RAISE fnd_api.g_exc_error;
818: END IF;
819:
844: x_return_status := fnd_api.g_ret_sts_error;
845:
846: WHEN others THEN
847:
848: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
849: fnd_message.set_token('API_NAME','get_mtl_txn_recs');
850: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
851: fnd_msg_pub.add;
852:
845:
846: WHEN others THEN
847:
848: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
849: fnd_message.set_token('API_NAME','get_mtl_txn_recs');
850: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
851: fnd_msg_pub.add;
852:
853: x_return_status := fnd_api.g_ret_sts_unexp_error;
846: WHEN others THEN
847:
848: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
849: fnd_message.set_token('API_NAME','get_mtl_txn_recs');
850: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
851: fnd_msg_pub.add;
852:
853: x_return_status := fnd_api.g_ret_sts_unexp_error;
854:
1006: AND p_item_control_rec.serial_control_code in (2,5) THEN
1007: debug('A Multi-WIP Job and Serialized instance.'||l_instance_header_tbl(1).instance_id);
1008: ELSE
1009: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1010: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1011: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1012: fnd_msg_pub.add;
1013: RAISE fnd_api.g_exc_error;
1014: END IF;
1007: debug('A Multi-WIP Job and Serialized instance.'||l_instance_header_tbl(1).instance_id);
1008: ELSE
1009: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1010: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1011: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1012: fnd_msg_pub.add;
1013: RAISE fnd_api.g_exc_error;
1014: END IF;
1015:
1013: RAISE fnd_api.g_exc_error;
1014: END IF;
1015:
1016: Exception when others then
1017: fnd_message.set_name('FND','FND_GENERIC_MESSAGE');
1018: fnd_message.set_token('MESSAGE',substr(sqlerrm,1,255));
1019: fnd_msg_pub.add;
1020: raise fnd_api.g_exc_error;
1021: End;
1014: END IF;
1015:
1016: Exception when others then
1017: fnd_message.set_name('FND','FND_GENERIC_MESSAGE');
1018: fnd_message.set_token('MESSAGE',substr(sqlerrm,1,255));
1019: fnd_msg_pub.add;
1020: raise fnd_api.g_exc_error;
1021: End;
1022: */
1021: End;
1022: */
1023: ELSE
1024: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1025: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1026: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1027: fnd_msg_pub.add;
1028: RAISE fnd_api.g_exc_error;
1029: END IF;
1022: */
1023: ELSE
1024: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1025: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1026: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1027: fnd_msg_pub.add;
1028: RAISE fnd_api.g_exc_error;
1029: END IF;
1030: -- fix for Bug 2733128.
1034: NVL(l_instance_header_tbl(1).active_end_date,fnd_api.g_miss_date) = fnd_api.g_miss_date
1035: )
1036: THEN
1037: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1038: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1039: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1040: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1041: fnd_msg_pub.add;
1042: raise fnd_api.g_exc_error;
1035: )
1036: THEN
1037: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1038: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1039: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1040: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1041: fnd_msg_pub.add;
1042: raise fnd_api.g_exc_error;
1043: END IF;
1036: THEN
1037: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1038: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1039: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1040: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1041: fnd_msg_pub.add;
1042: raise fnd_api.g_exc_error;
1043: END IF;
1044: END IF;
1043: END IF;
1044: END IF;
1045: ELSE
1046: debug('Multiple Source Instances Found.');
1047: fnd_message.set_name('CSI', 'CSI_TXN_MULT_INST_FOUND');
1048: fnd_message.set_token('INV_ITEM_ID',l_instance_query_rec.inventory_item_id);
1049: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1050: fnd_msg_pub.add;
1051: raise fnd_api.g_exc_error;
1044: END IF;
1045: ELSE
1046: debug('Multiple Source Instances Found.');
1047: fnd_message.set_name('CSI', 'CSI_TXN_MULT_INST_FOUND');
1048: fnd_message.set_token('INV_ITEM_ID',l_instance_query_rec.inventory_item_id);
1049: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1050: fnd_msg_pub.add;
1051: raise fnd_api.g_exc_error;
1052: END IF;
1045: ELSE
1046: debug('Multiple Source Instances Found.');
1047: fnd_message.set_name('CSI', 'CSI_TXN_MULT_INST_FOUND');
1048: fnd_message.set_token('INV_ITEM_ID',l_instance_query_rec.inventory_item_id);
1049: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1050: fnd_msg_pub.add;
1051: raise fnd_api.g_exc_error;
1052: END IF;
1053: ELSE
1348: ELSE
1349: debug('sorry!!. This Line had A Receiving Node on the RMA Order earlier. Normal Processing...');
1350: IF l_instance_quantity < l_instances_tbl(l_ind).quantity THEN
1351:
1352: fnd_message.set_name('CSI', 'CSI_INT_QTY_CHK_FAILED');
1353: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(l_ind).instance_id);
1354: fnd_msg_pub.add;
1355: RAISE fnd_api.g_exc_error;
1356:
1349: debug('sorry!!. This Line had A Receiving Node on the RMA Order earlier. Normal Processing...');
1350: IF l_instance_quantity < l_instances_tbl(l_ind).quantity THEN
1351:
1352: fnd_message.set_name('CSI', 'CSI_INT_QTY_CHK_FAILED');
1353: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(l_ind).instance_id);
1354: fnd_msg_pub.add;
1355: RAISE fnd_api.g_exc_error;
1356:
1357: END IF;
1359: ELSIF l_instance_quantity < l_instances_tbl(l_ind).quantity THEN
1360: Bug 3746600 */
1361: IF l_instance_quantity < l_instances_tbl(l_ind).quantity THEN
1362:
1363: fnd_message.set_name('CSI', 'CSI_INT_QTY_CHK_FAILED');
1364: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(l_ind).instance_id);
1365: fnd_msg_pub.add;
1366: RAISE fnd_api.g_exc_error;
1367:
1360: Bug 3746600 */
1361: IF l_instance_quantity < l_instances_tbl(l_ind).quantity THEN
1362:
1363: fnd_message.set_name('CSI', 'CSI_INT_QTY_CHK_FAILED');
1364: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(l_ind).instance_id);
1365: fnd_msg_pub.add;
1366: RAISE fnd_api.g_exc_error;
1367:
1368: END IF;
1957: from csi_item_instances
1958: where instance_id = l_mtl_txn_rec.instance_id
1959: and sysdate between nvl(active_end_date, sysdate-1) and sysdate+1;
1960: Exception when others then
1961: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
1962: fnd_message.set_token('API_NAME','match_mtl_txn_for_txn_dtl');
1963: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
1964: fnd_msg_pub.add;
1965: raise fnd_api.g_exc_error;
1958: where instance_id = l_mtl_txn_rec.instance_id
1959: and sysdate between nvl(active_end_date, sysdate-1) and sysdate+1;
1960: Exception when others then
1961: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
1962: fnd_message.set_token('API_NAME','match_mtl_txn_for_txn_dtl');
1963: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
1964: fnd_msg_pub.add;
1965: raise fnd_api.g_exc_error;
1966: End;
1959: and sysdate between nvl(active_end_date, sysdate-1) and sysdate+1;
1960: Exception when others then
1961: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
1962: fnd_message.set_token('API_NAME','match_mtl_txn_for_txn_dtl');
1963: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
1964: fnd_msg_pub.add;
1965: raise fnd_api.g_exc_error;
1966: End;
1967:
2051: px_mtl_txn_tbl(l_ind).instance_id := px_line_dtl_tbl(l_t_ind).instance_id;
2052: ELSE
2053: l_return_status := fnd_api.g_ret_sts_error;
2054: debug('Lot number referenced on the transaction line detail is different from the one being received..');
2055: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2056: fnd_message.set_token('PARAM','Lot Number');
2057: fnd_message.set_token('VALUE',px_line_dtl_tbl(l_t_ind).lot_number);
2058: fnd_message.set_token('REASON','The Lot number and/or instance referenced on the transaction details is different from the one received. Pl. correct it and reprocess the error');
2059: fnd_msg_pub.add;
2052: ELSE
2053: l_return_status := fnd_api.g_ret_sts_error;
2054: debug('Lot number referenced on the transaction line detail is different from the one being received..');
2055: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2056: fnd_message.set_token('PARAM','Lot Number');
2057: fnd_message.set_token('VALUE',px_line_dtl_tbl(l_t_ind).lot_number);
2058: fnd_message.set_token('REASON','The Lot number and/or instance referenced on the transaction details is different from the one received. Pl. correct it and reprocess the error');
2059: fnd_msg_pub.add;
2060: raise fnd_api.g_exc_error;
2053: l_return_status := fnd_api.g_ret_sts_error;
2054: debug('Lot number referenced on the transaction line detail is different from the one being received..');
2055: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2056: fnd_message.set_token('PARAM','Lot Number');
2057: fnd_message.set_token('VALUE',px_line_dtl_tbl(l_t_ind).lot_number);
2058: fnd_message.set_token('REASON','The Lot number and/or instance referenced on the transaction details is different from the one received. Pl. correct it and reprocess the error');
2059: fnd_msg_pub.add;
2060: raise fnd_api.g_exc_error;
2061: END IF;
2054: debug('Lot number referenced on the transaction line detail is different from the one being received..');
2055: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2056: fnd_message.set_token('PARAM','Lot Number');
2057: fnd_message.set_token('VALUE',px_line_dtl_tbl(l_t_ind).lot_number);
2058: fnd_message.set_token('REASON','The Lot number and/or instance referenced on the transaction details is different from the one received. Pl. correct it and reprocess the error');
2059: fnd_msg_pub.add;
2060: raise fnd_api.g_exc_error;
2061: END IF;
2062: ELSE
2481: x_return_status := l_return_status;
2482: when others then
2483: debug('when others raised in sync_txn_dtls_and_mtl_txn');
2484: x_return_status := fnd_api.g_ret_sts_unexp_error;
2485: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
2486: fnd_message.set_token('API_NAME','sync_txn_dtls_and_mtl_txn');
2487: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
2488: fnd_msg_pub.add;
2489: END sync_txn_dtls_and_mtl_txn;
2482: when others then
2483: debug('when others raised in sync_txn_dtls_and_mtl_txn');
2484: x_return_status := fnd_api.g_ret_sts_unexp_error;
2485: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
2486: fnd_message.set_token('API_NAME','sync_txn_dtls_and_mtl_txn');
2487: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
2488: fnd_msg_pub.add;
2489: END sync_txn_dtls_and_mtl_txn;
2490:
2483: debug('when others raised in sync_txn_dtls_and_mtl_txn');
2484: x_return_status := fnd_api.g_ret_sts_unexp_error;
2485: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
2486: fnd_message.set_token('API_NAME','sync_txn_dtls_and_mtl_txn');
2487: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
2488: fnd_msg_pub.add;
2489: END sync_txn_dtls_and_mtl_txn;
2490:
2491: PROCEDURE rma_receipt(
2775: */
2776: IF l_item_control_rec.serial_control_code = 1 THEN
2777: IF nvl(l_line_dtl_tbl(l_ind).instance_id,fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
2778: debug('No instance reference in Txn Details for non serial item.');
2779: fnd_message.set_name('CSI', 'CSI_INST_REF_NOT_ENTERED');
2780: fnd_msg_pub.add;
2781: RAISE fnd_api.g_exc_error;
2782: END IF;
2783: END IF;
2793: p_item_control_rec => l_item_control_rec,
2794: x_return_status => l_return_status);
2795:
2796: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2797: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2798: fnd_message.set_token('PARAM','Item attributes');
2799: fnd_message.set_token('VALUE','Lot / Serial');
2800: fnd_message.set_token('REASON','The transaction details entered do not match the inventory material transaction for one or more of the attributes. Pl. correct it and reprocess the error');
2801: fnd_msg_pub.add;
2794: x_return_status => l_return_status);
2795:
2796: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2797: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2798: fnd_message.set_token('PARAM','Item attributes');
2799: fnd_message.set_token('VALUE','Lot / Serial');
2800: fnd_message.set_token('REASON','The transaction details entered do not match the inventory material transaction for one or more of the attributes. Pl. correct it and reprocess the error');
2801: fnd_msg_pub.add;
2802: RAISE fnd_api.g_exc_error;
2795:
2796: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2797: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2798: fnd_message.set_token('PARAM','Item attributes');
2799: fnd_message.set_token('VALUE','Lot / Serial');
2800: fnd_message.set_token('REASON','The transaction details entered do not match the inventory material transaction for one or more of the attributes. Pl. correct it and reprocess the error');
2801: fnd_msg_pub.add;
2802: RAISE fnd_api.g_exc_error;
2803: END IF;
2796: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2797: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2798: fnd_message.set_token('PARAM','Item attributes');
2799: fnd_message.set_token('VALUE','Lot / Serial');
2800: fnd_message.set_token('REASON','The transaction details entered do not match the inventory material transaction for one or more of the attributes. Pl. correct it and reprocess the error');
2801: fnd_msg_pub.add;
2802: RAISE fnd_api.g_exc_error;
2803: END IF;
2804:
2868: FROM csi_item_instances
2869: WHERE instance_id = l_tld_inst_tbl(i).instance_id;
2870: Exception
2871: when others then
2872: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
2873: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(i).instance_id);
2874: FND_MSG_PUB.add;
2875: End;
2876: l_upd_inst_tbl(i).object_version_number := l_obj_ver_num;
2869: WHERE instance_id = l_tld_inst_tbl(i).instance_id;
2870: Exception
2871: when others then
2872: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
2873: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(i).instance_id);
2874: FND_MSG_PUB.add;
2875: End;
2876: l_upd_inst_tbl(i).object_version_number := l_obj_ver_num;
2877: IF nvl(l_end_date , sysdate) between sysdate and sysdate +1 THEN --already expired earlier
2946: FROM csi_item_instances
2947: WHERE instance_id = l_tld_inst_tbl(m).instance_id;
2948: Exception
2949: when others then
2950: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
2951: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(m).instance_id);
2952: FND_MSG_PUB.add;
2953: End;
2954: l_upd_inst_tbl(m).object_version_number := l_obj_ver_num;
2947: WHERE instance_id = l_tld_inst_tbl(m).instance_id;
2948: Exception
2949: when others then
2950: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
2951: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(m).instance_id);
2952: FND_MSG_PUB.add;
2953: End;
2954: l_upd_inst_tbl(m).object_version_number := l_obj_ver_num;
2955: IF l_rem_qty > 0 THEN
3017: l_tld_inst_tbl(u_ind).processed_flag := 'Y'; --set it to processed
3018: l_rem_qty := l_rem_qty - l_quantity2;
3019: exit;
3020: ELSE
3021: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
3022: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(m).instance_id);
3023: FND_MSG_PUB.add;
3024: END IF;
3025: END IF;
3018: l_rem_qty := l_rem_qty - l_quantity2;
3019: exit;
3020: ELSE
3021: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
3022: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(m).instance_id);
3023: FND_MSG_PUB.add;
3024: END IF;
3025: END IF;
3026: END IF;
3076: debug('Transaction details NOT found for the RMA Order.');
3077:
3078: IF l_item_control_rec.serial_control_code = 1 THEN
3079: debug('NON Serialized item and installation details not entered.');
3080: fnd_message.set_name('CSI', 'CSI_INST_DTLS_NOT_ENTERED');
3081: fnd_msg_pub.add;
3082: RAISE fnd_api.g_exc_error;
3083: ELSE
3084: -- serialized item, so figure out the owner's instance
3209: l_cur_owner_party_id <> l_src_order_rec.party_id
3210: AND
3211: l_pty_override_flag = 'N'
3212: THEN
3213: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
3214: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(i_ind).instance_id );
3215: fnd_message.set_token('OLD_PARTY_ID', l_cur_owner_party_id );
3216: fnd_message.set_token('NEW_PARTY_ID', l_src_order_rec.party_id );
3217: fnd_msg_pub.add;
3210: AND
3211: l_pty_override_flag = 'N'
3212: THEN
3213: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
3214: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(i_ind).instance_id );
3215: fnd_message.set_token('OLD_PARTY_ID', l_cur_owner_party_id );
3216: fnd_message.set_token('NEW_PARTY_ID', l_src_order_rec.party_id );
3217: fnd_msg_pub.add;
3218: RAISE fnd_api.g_exc_error;
3211: l_pty_override_flag = 'N'
3212: THEN
3213: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
3214: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(i_ind).instance_id );
3215: fnd_message.set_token('OLD_PARTY_ID', l_cur_owner_party_id );
3216: fnd_message.set_token('NEW_PARTY_ID', l_src_order_rec.party_id );
3217: fnd_msg_pub.add;
3218: RAISE fnd_api.g_exc_error;
3219: END IF;
3212: THEN
3213: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
3214: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(i_ind).instance_id );
3215: fnd_message.set_token('OLD_PARTY_ID', l_cur_owner_party_id );
3216: fnd_message.set_token('NEW_PARTY_ID', l_src_order_rec.party_id );
3217: fnd_msg_pub.add;
3218: RAISE fnd_api.g_exc_error;
3219: END IF;
3220:
3772: WHEN others THEN
3773: rollback to rma_receipt;
3774:
3775: x_return_status := fnd_api.g_ret_sts_unexp_error;
3776: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3777: fnd_message.set_token('API_NAME',l_api_name);
3778: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 540));
3779: fnd_msg_pub.add;
3780: l_error_rec.error_text := csi_t_gen_utility_pvt.dump_error_stack;
3773: rollback to rma_receipt;
3774:
3775: x_return_status := fnd_api.g_ret_sts_unexp_error;
3776: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3777: fnd_message.set_token('API_NAME',l_api_name);
3778: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 540));
3779: fnd_msg_pub.add;
3780: l_error_rec.error_text := csi_t_gen_utility_pvt.dump_error_stack;
3781: debug('Error:(O) '||l_error_rec.error_text);
3774:
3775: x_return_status := fnd_api.g_ret_sts_unexp_error;
3776: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3777: fnd_message.set_token('API_NAME',l_api_name);
3778: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 540));
3779: fnd_msg_pub.add;
3780: l_error_rec.error_text := csi_t_gen_utility_pvt.dump_error_stack;
3781: debug('Error:(O) '||l_error_rec.error_text);
3782: px_trx_error_rec := l_error_rec;
3808: WHERE transaction_id = p_transaction_id;
3809:
3810: EXCEPTION
3811: WHEN no_data_found THEN
3812: fnd_message.set_name('CSI', 'CSI_INT_MTL_TXN_ID_INVALID');
3813: fnd_message.set_token('MTL_TXN_ID', p_transaction_id);
3814: fnd_msg_pub.add;
3815: RAISE fnd_api.g_exc_error;
3816: END;
3809:
3810: EXCEPTION
3811: WHEN no_data_found THEN
3812: fnd_message.set_name('CSI', 'CSI_INT_MTL_TXN_ID_INVALID');
3813: fnd_message.set_token('MTL_TXN_ID', p_transaction_id);
3814: fnd_msg_pub.add;
3815: RAISE fnd_api.g_exc_error;
3816: END;
3817:
3860: xnp_xml_utils.decode(P_Msg_Text, 'MTL_TRANSACTION_ID', l_mtl_txn_id);
3861:
3862: IF nvl(l_mtl_txn_id,fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
3863:
3864: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
3865: fnd_message.set_token('MESSAGE',
3866: 'xnp_xml_utils.decode failed for '||p_msg_header.message_id);
3867: fnd_msg_pub.add;
3868:
3861:
3862: IF nvl(l_mtl_txn_id,fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
3863:
3864: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
3865: fnd_message.set_token('MESSAGE',
3866: 'xnp_xml_utils.decode failed for '||p_msg_header.message_id);
3867: fnd_msg_pub.add;
3868:
3869: RAISE fnd_api.g_exc_error;
3885: x_error_message := csi_t_gen_utility_pvt.dump_error_stack;
3886: x_return_status := fnd_api.g_ret_sts_error;
3887:
3888: WHEN others THEN
3889: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3890: fnd_message.set_token('API_NAME',l_api_name);
3891: fnd_message.set_token('SQL_ERROR',SQLERRM);
3892: x_error_message := fnd_msg_pub.get;
3893: x_return_status := l_fnd_unexpected;
3886: x_return_status := fnd_api.g_ret_sts_error;
3887:
3888: WHEN others THEN
3889: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3890: fnd_message.set_token('API_NAME',l_api_name);
3891: fnd_message.set_token('SQL_ERROR',SQLERRM);
3892: x_error_message := fnd_msg_pub.get;
3893: x_return_status := l_fnd_unexpected;
3894:
3887:
3888: WHEN others THEN
3889: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3890: fnd_message.set_token('API_NAME',l_api_name);
3891: fnd_message.set_token('SQL_ERROR',SQLERRM);
3892: x_error_message := fnd_msg_pub.get;
3893: x_return_status := l_fnd_unexpected;
3894:
3895: END decode_message;