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:
307: WHERE inventory_item_id = l_item_control_rec.inventory_item_id
308: AND organization_id = l_item_control_rec.organization_id;
309: EXCEPTION
310: WHEN no_data_found THEN
311: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
312: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
313: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
314: fnd_msg_pub.add;
315: RAISE fnd_api.g_exc_error;
308: AND organization_id = l_item_control_rec.organization_id;
309: EXCEPTION
310: WHEN no_data_found THEN
311: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
312: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
313: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
314: fnd_msg_pub.add;
315: RAISE fnd_api.g_exc_error;
316: END;
309: EXCEPTION
310: WHEN no_data_found THEN
311: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
312: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
313: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
314: fnd_msg_pub.add;
315: RAISE fnd_api.g_exc_error;
316: END;
317:
324: EXCEPTION
325: WHEN too_many_rows THEN
326: l_item_control_rec.mult_srl_control_flag := 'Y';
327: WHEN no_data_found THEN
328: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
329: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
330: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
331: fnd_msg_pub.add;
332: RAISE fnd_api.g_exc_error;
325: WHEN too_many_rows THEN
326: l_item_control_rec.mult_srl_control_flag := 'Y';
327: WHEN no_data_found THEN
328: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
329: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
330: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
331: fnd_msg_pub.add;
332: RAISE fnd_api.g_exc_error;
333: END;
326: l_item_control_rec.mult_srl_control_flag := 'Y';
327: WHEN no_data_found THEN
328: fnd_message.set_name('CSI', 'CSI_INT_ITEM_ID_MISSING');
329: fnd_message.set_token('INVENTORY_ITEM_ID', l_item_control_rec.inventory_item_id);
330: fnd_message.set_token('INV_ORGANZATION_ID', l_item_control_rec.organization_id);
331: fnd_msg_pub.add;
332: RAISE fnd_api.g_exc_error;
333: END;
334:
391:
392: IF x_partner_order_rec.IB_OWNER = 'END_CUSTOMER' THEN
393:
394: IF x_partner_order_rec.END_CUSTOMER_ID is null Then
395: fnd_message.set_name('CSI','CSI_PARTNER_VAL_MISSING');
396: fnd_msg_pub.add;
397: raise fnd_api.g_exc_error;
398: ELSE
399: BEGIN
404: FROM hz_cust_accounts
405: WHERE cust_account_id = x_partner_order_rec.END_CUSTOMER_ID;
406: EXCEPTION
407: WHEN no_data_found THEN
408: fnd_message.set_name('CSI','CSI_INT_INV_CUST_ACCT_ID');
409: fnd_message.set_token('CUST_ACCOUNT_ID', x_partner_order_rec.END_CUSTOMER_ID);
410: fnd_msg_pub.add;
411: RAISE fnd_api.g_exc_error;
412: END;
405: WHERE cust_account_id = x_partner_order_rec.END_CUSTOMER_ID;
406: EXCEPTION
407: WHEN no_data_found THEN
408: fnd_message.set_name('CSI','CSI_INT_INV_CUST_ACCT_ID');
409: fnd_message.set_token('CUST_ACCOUNT_ID', x_partner_order_rec.END_CUSTOMER_ID);
410: fnd_msg_pub.add;
411: RAISE fnd_api.g_exc_error;
412: END;
413:
496: WHERE HCSU.site_use_id = l_cust_acct_site_use_id
497: AND HCAS.cust_acct_site_id = HCSU.cust_acct_site_id;
498: EXCEPTION
499: WHEN no_data_found THEN
500: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
501: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
502: fnd_message.set_token('SITE_USE_CODE','SHIP_TO');
503: fnd_msg_pub.add;
504: raise fnd_api.g_exc_error;
497: AND HCAS.cust_acct_site_id = HCSU.cust_acct_site_id;
498: EXCEPTION
499: WHEN no_data_found THEN
500: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
501: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
502: fnd_message.set_token('SITE_USE_CODE','SHIP_TO');
503: fnd_msg_pub.add;
504: raise fnd_api.g_exc_error;
505: END;
498: EXCEPTION
499: WHEN no_data_found THEN
500: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
501: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
502: fnd_message.set_token('SITE_USE_CODE','SHIP_TO');
503: fnd_msg_pub.add;
504: raise fnd_api.g_exc_error;
505: END;
506: 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
503: fnd_msg_pub.add;
504: raise fnd_api.g_exc_error;
505: END;
506: 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
507: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
508: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
509: fnd_message.set_token('SITE_USE_CODE','INVOICE_TO');
510: fnd_msg_pub.add;
511: raise fnd_api.g_exc_error;
504: raise fnd_api.g_exc_error;
505: END;
506: 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
507: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
508: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
509: fnd_message.set_token('SITE_USE_CODE','INVOICE_TO');
510: fnd_msg_pub.add;
511: raise fnd_api.g_exc_error;
512: END IF;
505: END;
506: 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
507: fnd_message.set_name('CSI','CSI_TXN_SITE_USE_INVALID');
508: fnd_message.set_token('SITE_USE_ID',l_cust_acct_site_use_id);
509: fnd_message.set_token('SITE_USE_CODE','INVOICE_TO');
510: fnd_msg_pub.add;
511: raise fnd_api.g_exc_error;
512: END IF;
513: EXCEPTION
811: l_dest_mtl_txn_tbl := l_src_mtl_txn_tbl;
812: END IF;
813:
814: IF l_s_ind = 0 then
815: fnd_message.set_name('CSI','CSI_NO_INVENTORY_RECORDS');
816: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_txn_id);
817: fnd_msg_pub.add;
818: RAISE fnd_api.g_exc_error;
819: END IF;
812: END IF;
813:
814: IF l_s_ind = 0 then
815: fnd_message.set_name('CSI','CSI_NO_INVENTORY_RECORDS');
816: fnd_message.set_token('MTL_TRANSACTION_ID',p_mtl_txn_id);
817: fnd_msg_pub.add;
818: RAISE fnd_api.g_exc_error;
819: END IF;
820:
845: x_return_status := fnd_api.g_ret_sts_error;
846:
847: WHEN others THEN
848:
849: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
850: fnd_message.set_token('API_NAME','get_mtl_txn_recs');
851: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
852: fnd_msg_pub.add;
853:
846:
847: WHEN others THEN
848:
849: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
850: fnd_message.set_token('API_NAME','get_mtl_txn_recs');
851: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
852: fnd_msg_pub.add;
853:
854: x_return_status := fnd_api.g_ret_sts_unexp_error;
847: WHEN others THEN
848:
849: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
850: fnd_message.set_token('API_NAME','get_mtl_txn_recs');
851: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
852: fnd_msg_pub.add;
853:
854: x_return_status := fnd_api.g_ret_sts_unexp_error;
855:
1011: AND p_item_control_rec.serial_control_code in (2,5) THEN
1012: debug('A Multi-WIP Job and Serialized instance.'||l_instance_header_tbl(1).instance_id);
1013: ELSE
1014: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1015: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1016: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1017: fnd_msg_pub.add;
1018: RAISE fnd_api.g_exc_error;
1019: END IF;
1012: debug('A Multi-WIP Job and Serialized instance.'||l_instance_header_tbl(1).instance_id);
1013: ELSE
1014: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1015: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1016: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1017: fnd_msg_pub.add;
1018: RAISE fnd_api.g_exc_error;
1019: END IF;
1020:
1018: RAISE fnd_api.g_exc_error;
1019: END IF;
1020:
1021: Exception when others then
1022: fnd_message.set_name('FND','FND_GENERIC_MESSAGE');
1023: fnd_message.set_token('MESSAGE',substr(sqlerrm,1,255));
1024: fnd_msg_pub.add;
1025: raise fnd_api.g_exc_error;
1026: End;
1019: END IF;
1020:
1021: Exception when others then
1022: fnd_message.set_name('FND','FND_GENERIC_MESSAGE');
1023: fnd_message.set_token('MESSAGE',substr(sqlerrm,1,255));
1024: fnd_msg_pub.add;
1025: raise fnd_api.g_exc_error;
1026: End;
1027: */
1026: End;
1027: */
1028: ELSE
1029: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1030: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1031: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1032: fnd_msg_pub.add;
1033: RAISE fnd_api.g_exc_error;
1034: END IF;
1027: */
1028: ELSE
1029: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1030: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1031: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1032: fnd_msg_pub.add;
1033: RAISE fnd_api.g_exc_error;
1034: END IF;
1035: -- fix for Bug 2733128.
1039: NVL(l_instance_header_tbl(1).active_end_date,fnd_api.g_miss_date) = fnd_api.g_miss_date
1040: )
1041: THEN
1042: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1043: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1044: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1045: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1046: fnd_msg_pub.add;
1047: raise fnd_api.g_exc_error;
1040: )
1041: THEN
1042: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1043: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1044: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1045: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1046: fnd_msg_pub.add;
1047: raise fnd_api.g_exc_error;
1048: END IF;
1041: THEN
1042: debug('Location type code is :'||l_instance_header_tbl(1).location_type_code);
1043: fnd_message.set_name('CSI', 'CSI_NON_RETURNABLE_INSTANCE');
1044: fnd_message.set_token('LOC_TYPE_CODE', l_instance_header_tbl(1).location_type_code);
1045: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1046: fnd_msg_pub.add;
1047: raise fnd_api.g_exc_error;
1048: END IF;
1049: END IF;
1051: AND p_item_control_rec.lot_control_code <> 2 ) THEN
1052: -- Added condition for bug 6336254, if the item is non-serialized but lot controlled,
1053: -- there are could be multiple instances found in install base
1054: debug('Multiple Source Instances Found.');
1055: fnd_message.set_name('CSI', 'CSI_TXN_MULT_INST_FOUND');
1056: fnd_message.set_token('INV_ITEM_ID',l_instance_query_rec.inventory_item_id);
1057: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1058: fnd_msg_pub.add;
1059: raise fnd_api.g_exc_error;
1052: -- Added condition for bug 6336254, if the item is non-serialized but lot controlled,
1053: -- there are could be multiple instances found in install base
1054: debug('Multiple Source Instances Found.');
1055: fnd_message.set_name('CSI', 'CSI_TXN_MULT_INST_FOUND');
1056: fnd_message.set_token('INV_ITEM_ID',l_instance_query_rec.inventory_item_id);
1057: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1058: fnd_msg_pub.add;
1059: raise fnd_api.g_exc_error;
1060: END IF;
1053: -- there are could be multiple instances found in install base
1054: debug('Multiple Source Instances Found.');
1055: fnd_message.set_name('CSI', 'CSI_TXN_MULT_INST_FOUND');
1056: fnd_message.set_token('INV_ITEM_ID',l_instance_query_rec.inventory_item_id);
1057: fnd_message.set_token('INV_ORG_ID',l_instance_query_rec.inv_organization_id);
1058: fnd_msg_pub.add;
1059: raise fnd_api.g_exc_error;
1060: END IF;
1061: ELSE
1356: ELSE
1357: debug('sorry!!. This Line had A Receiving Node on the RMA Order earlier. Normal Processing...');
1358: IF l_instance_quantity < l_instances_tbl(l_ind).quantity THEN
1359:
1360: fnd_message.set_name('CSI', 'CSI_INT_QTY_CHK_FAILED');
1361: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(l_ind).instance_id);
1362: fnd_msg_pub.add;
1363: RAISE fnd_api.g_exc_error;
1364:
1357: debug('sorry!!. This Line had A Receiving Node on the RMA Order earlier. Normal Processing...');
1358: IF l_instance_quantity < l_instances_tbl(l_ind).quantity THEN
1359:
1360: fnd_message.set_name('CSI', 'CSI_INT_QTY_CHK_FAILED');
1361: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(l_ind).instance_id);
1362: fnd_msg_pub.add;
1363: RAISE fnd_api.g_exc_error;
1364:
1365: END IF;
1367: ELSIF l_instance_quantity < l_instances_tbl(l_ind).quantity THEN
1368: Bug 3746600 */
1369: IF l_instance_quantity < l_instances_tbl(l_ind).quantity THEN
1370:
1371: fnd_message.set_name('CSI', 'CSI_INT_QTY_CHK_FAILED');
1372: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(l_ind).instance_id);
1373: fnd_msg_pub.add;
1374: RAISE fnd_api.g_exc_error;
1375:
1368: Bug 3746600 */
1369: IF l_instance_quantity < l_instances_tbl(l_ind).quantity THEN
1370:
1371: fnd_message.set_name('CSI', 'CSI_INT_QTY_CHK_FAILED');
1372: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(l_ind).instance_id);
1373: fnd_msg_pub.add;
1374: RAISE fnd_api.g_exc_error;
1375:
1376: END IF;
1970: where instance_id = l_mtl_txn_rec.instance_id
1971: and sysdate < nvl(active_end_date, sysdate+1); -- changed for bug#14364807
1972: --and sysdate between nvl(active_end_date, sysdate-1) and sysdate+1; -- commented for bug # 14364807
1973: Exception when others then
1974: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
1975: fnd_message.set_token('API_NAME','match_mtl_txn_for_txn_dtl');
1976: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
1977: fnd_msg_pub.add;
1978: raise fnd_api.g_exc_error;
1971: and sysdate < nvl(active_end_date, sysdate+1); -- changed for bug#14364807
1972: --and sysdate between nvl(active_end_date, sysdate-1) and sysdate+1; -- commented for bug # 14364807
1973: Exception when others then
1974: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
1975: fnd_message.set_token('API_NAME','match_mtl_txn_for_txn_dtl');
1976: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
1977: fnd_msg_pub.add;
1978: raise fnd_api.g_exc_error;
1979: End;
1972: --and sysdate between nvl(active_end_date, sysdate-1) and sysdate+1; -- commented for bug # 14364807
1973: Exception when others then
1974: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
1975: fnd_message.set_token('API_NAME','match_mtl_txn_for_txn_dtl');
1976: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
1977: fnd_msg_pub.add;
1978: raise fnd_api.g_exc_error;
1979: End;
1980:
2064: px_mtl_txn_tbl(l_ind).instance_id := px_line_dtl_tbl(l_t_ind).instance_id;
2065: ELSE
2066: l_return_status := fnd_api.g_ret_sts_error;
2067: debug('Lot number referenced on the transaction line detail is different from the one being received..');
2068: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2069: fnd_message.set_token('PARAM','Lot Number');
2070: fnd_message.set_token('VALUE',px_line_dtl_tbl(l_t_ind).lot_number);
2071: 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');
2072: fnd_msg_pub.add;
2065: ELSE
2066: l_return_status := fnd_api.g_ret_sts_error;
2067: debug('Lot number referenced on the transaction line detail is different from the one being received..');
2068: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2069: fnd_message.set_token('PARAM','Lot Number');
2070: fnd_message.set_token('VALUE',px_line_dtl_tbl(l_t_ind).lot_number);
2071: 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');
2072: fnd_msg_pub.add;
2073: raise fnd_api.g_exc_error;
2066: l_return_status := fnd_api.g_ret_sts_error;
2067: debug('Lot number referenced on the transaction line detail is different from the one being received..');
2068: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2069: fnd_message.set_token('PARAM','Lot Number');
2070: fnd_message.set_token('VALUE',px_line_dtl_tbl(l_t_ind).lot_number);
2071: 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');
2072: fnd_msg_pub.add;
2073: raise fnd_api.g_exc_error;
2074: END IF;
2067: debug('Lot number referenced on the transaction line detail is different from the one being received..');
2068: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2069: fnd_message.set_token('PARAM','Lot Number');
2070: fnd_message.set_token('VALUE',px_line_dtl_tbl(l_t_ind).lot_number);
2071: 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');
2072: fnd_msg_pub.add;
2073: raise fnd_api.g_exc_error;
2074: END IF;
2075: ELSE
2520: x_return_status := l_return_status;
2521: when others then
2522: debug('when others raised in sync_txn_dtls_and_mtl_txn');
2523: x_return_status := fnd_api.g_ret_sts_unexp_error;
2524: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
2525: fnd_message.set_token('API_NAME','sync_txn_dtls_and_mtl_txn');
2526: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
2527: fnd_msg_pub.add;
2528: END sync_txn_dtls_and_mtl_txn;
2521: when others then
2522: debug('when others raised in sync_txn_dtls_and_mtl_txn');
2523: x_return_status := fnd_api.g_ret_sts_unexp_error;
2524: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
2525: fnd_message.set_token('API_NAME','sync_txn_dtls_and_mtl_txn');
2526: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
2527: fnd_msg_pub.add;
2528: END sync_txn_dtls_and_mtl_txn;
2529:
2522: debug('when others raised in sync_txn_dtls_and_mtl_txn');
2523: x_return_status := fnd_api.g_ret_sts_unexp_error;
2524: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
2525: fnd_message.set_token('API_NAME','sync_txn_dtls_and_mtl_txn');
2526: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 240));
2527: fnd_msg_pub.add;
2528: END sync_txn_dtls_and_mtl_txn;
2529:
2530: PROCEDURE rma_receipt(
2814: */
2815: IF l_item_control_rec.serial_control_code = 1 THEN
2816: IF nvl(l_line_dtl_tbl(l_ind).instance_id,fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
2817: debug('No instance reference in Txn Details for non serial item.');
2818: fnd_message.set_name('CSI', 'CSI_INST_REF_NOT_ENTERED');
2819: fnd_msg_pub.add;
2820: RAISE fnd_api.g_exc_error;
2821: END IF;
2822: END IF;
2832: p_item_control_rec => l_item_control_rec,
2833: x_return_status => l_return_status);
2834:
2835: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2836: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2837: fnd_message.set_token('PARAM','Item attributes');
2838: fnd_message.set_token('VALUE','Lot / Serial');
2839: 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');
2840: fnd_msg_pub.add;
2833: x_return_status => l_return_status);
2834:
2835: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2836: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2837: fnd_message.set_token('PARAM','Item attributes');
2838: fnd_message.set_token('VALUE','Lot / Serial');
2839: 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');
2840: fnd_msg_pub.add;
2841: RAISE fnd_api.g_exc_error;
2834:
2835: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2836: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2837: fnd_message.set_token('PARAM','Item attributes');
2838: fnd_message.set_token('VALUE','Lot / Serial');
2839: 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');
2840: fnd_msg_pub.add;
2841: RAISE fnd_api.g_exc_error;
2842: END IF;
2835: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2836: fnd_message.set_name('CSI','CSI_TXN_PARAM_IGNORED_WARN');
2837: fnd_message.set_token('PARAM','Item attributes');
2838: fnd_message.set_token('VALUE','Lot / Serial');
2839: 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');
2840: fnd_msg_pub.add;
2841: RAISE fnd_api.g_exc_error;
2842: END IF;
2843:
2907: FROM csi_item_instances
2908: WHERE instance_id = l_tld_inst_tbl(i).instance_id;
2909: Exception
2910: when others then
2911: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
2912: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(i).instance_id);
2913: FND_MSG_PUB.add;
2914: End;
2915: l_upd_inst_tbl(i).object_version_number := l_obj_ver_num;
2908: WHERE instance_id = l_tld_inst_tbl(i).instance_id;
2909: Exception
2910: when others then
2911: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
2912: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(i).instance_id);
2913: FND_MSG_PUB.add;
2914: End;
2915: l_upd_inst_tbl(i).object_version_number := l_obj_ver_num;
2916: IF nvl(l_end_date , sysdate) between sysdate and sysdate +1 THEN --already expired earlier
2985: FROM csi_item_instances
2986: WHERE instance_id = l_tld_inst_tbl(m).instance_id;
2987: Exception
2988: when others then
2989: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
2990: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(m).instance_id);
2991: FND_MSG_PUB.add;
2992: End;
2993: l_upd_inst_tbl(m).object_version_number := l_obj_ver_num;
2986: WHERE instance_id = l_tld_inst_tbl(m).instance_id;
2987: Exception
2988: when others then
2989: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
2990: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(m).instance_id);
2991: FND_MSG_PUB.add;
2992: End;
2993: l_upd_inst_tbl(m).object_version_number := l_obj_ver_num;
2994: IF l_rem_qty > 0 THEN
3056: l_tld_inst_tbl(u_ind).processed_flag := 'Y'; --set it to processed
3057: l_rem_qty := l_rem_qty - l_quantity2;
3058: exit;
3059: ELSE
3060: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
3061: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(m).instance_id);
3062: FND_MSG_PUB.add;
3063: END IF;
3064: END IF;
3057: l_rem_qty := l_rem_qty - l_quantity2;
3058: exit;
3059: ELSE
3060: FND_MESSAGE.set_name('CSI','CSI_TXN_INVALID_INST_REF');
3061: FND_MESSAGE.set_token('INSTANCE_ID', l_tld_inst_tbl(m).instance_id);
3062: FND_MSG_PUB.add;
3063: END IF;
3064: END IF;
3065: END IF;
3115: debug('Transaction details NOT found for the RMA Order.');
3116:
3117: IF l_item_control_rec.serial_control_code = 1 THEN
3118: debug('NON Serialized item and installation details not entered.');
3119: fnd_message.set_name('CSI', 'CSI_INST_DTLS_NOT_ENTERED');
3120: fnd_msg_pub.add;
3121: RAISE fnd_api.g_exc_error;
3122: ELSE
3123: -- serialized item, so figure out the owner's instance
3248: l_cur_owner_party_id <> l_src_order_rec.party_id
3249: AND
3250: l_pty_override_flag = 'N'
3251: THEN
3252: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
3253: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(i_ind).instance_id );
3254: fnd_message.set_token('OLD_PARTY_ID', l_cur_owner_party_id );
3255: fnd_message.set_token('NEW_PARTY_ID', l_src_order_rec.party_id );
3256: fnd_msg_pub.add;
3249: AND
3250: l_pty_override_flag = 'N'
3251: THEN
3252: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
3253: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(i_ind).instance_id );
3254: fnd_message.set_token('OLD_PARTY_ID', l_cur_owner_party_id );
3255: fnd_message.set_token('NEW_PARTY_ID', l_src_order_rec.party_id );
3256: fnd_msg_pub.add;
3257: RAISE fnd_api.g_exc_error;
3250: l_pty_override_flag = 'N'
3251: THEN
3252: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
3253: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(i_ind).instance_id );
3254: fnd_message.set_token('OLD_PARTY_ID', l_cur_owner_party_id );
3255: fnd_message.set_token('NEW_PARTY_ID', l_src_order_rec.party_id );
3256: fnd_msg_pub.add;
3257: RAISE fnd_api.g_exc_error;
3258: END IF;
3251: THEN
3252: fnd_message.set_name('CSI','CSI_RMA_OWNER_MISMATCH'); -- need to seed a new message
3253: fnd_message.set_token('INSTANCE_ID', l_instances_tbl(i_ind).instance_id );
3254: fnd_message.set_token('OLD_PARTY_ID', l_cur_owner_party_id );
3255: fnd_message.set_token('NEW_PARTY_ID', l_src_order_rec.party_id );
3256: fnd_msg_pub.add;
3257: RAISE fnd_api.g_exc_error;
3258: END IF;
3259:
3811: WHEN others THEN
3812: rollback to rma_receipt;
3813:
3814: x_return_status := fnd_api.g_ret_sts_unexp_error;
3815: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3816: fnd_message.set_token('API_NAME',l_api_name);
3817: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 540));
3818: fnd_msg_pub.add;
3819: l_error_rec.error_text := csi_t_gen_utility_pvt.dump_error_stack;
3812: rollback to rma_receipt;
3813:
3814: x_return_status := fnd_api.g_ret_sts_unexp_error;
3815: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3816: fnd_message.set_token('API_NAME',l_api_name);
3817: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 540));
3818: fnd_msg_pub.add;
3819: l_error_rec.error_text := csi_t_gen_utility_pvt.dump_error_stack;
3820: debug('Error:(O) '||l_error_rec.error_text);
3813:
3814: x_return_status := fnd_api.g_ret_sts_unexp_error;
3815: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3816: fnd_message.set_token('API_NAME',l_api_name);
3817: fnd_message.set_token('SQL_ERROR',substr(sqlerrm, 1, 540));
3818: fnd_msg_pub.add;
3819: l_error_rec.error_text := csi_t_gen_utility_pvt.dump_error_stack;
3820: debug('Error:(O) '||l_error_rec.error_text);
3821: px_trx_error_rec := l_error_rec;
3847: WHERE transaction_id = p_transaction_id;
3848:
3849: EXCEPTION
3850: WHEN no_data_found THEN
3851: fnd_message.set_name('CSI', 'CSI_INT_MTL_TXN_ID_INVALID');
3852: fnd_message.set_token('MTL_TXN_ID', p_transaction_id);
3853: fnd_msg_pub.add;
3854: RAISE fnd_api.g_exc_error;
3855: END;
3848:
3849: EXCEPTION
3850: WHEN no_data_found THEN
3851: fnd_message.set_name('CSI', 'CSI_INT_MTL_TXN_ID_INVALID');
3852: fnd_message.set_token('MTL_TXN_ID', p_transaction_id);
3853: fnd_msg_pub.add;
3854: RAISE fnd_api.g_exc_error;
3855: END;
3856:
3899: xnp_xml_utils.decode(P_Msg_Text, 'MTL_TRANSACTION_ID', l_mtl_txn_id);
3900:
3901: IF nvl(l_mtl_txn_id,fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
3902:
3903: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
3904: fnd_message.set_token('MESSAGE',
3905: 'xnp_xml_utils.decode failed for '||p_msg_header.message_id);
3906: fnd_msg_pub.add;
3907:
3900:
3901: IF nvl(l_mtl_txn_id,fnd_api.g_miss_num) = fnd_api.g_miss_num THEN
3902:
3903: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
3904: fnd_message.set_token('MESSAGE',
3905: 'xnp_xml_utils.decode failed for '||p_msg_header.message_id);
3906: fnd_msg_pub.add;
3907:
3908: RAISE fnd_api.g_exc_error;
3924: x_error_message := csi_t_gen_utility_pvt.dump_error_stack;
3925: x_return_status := fnd_api.g_ret_sts_error;
3926:
3927: WHEN others THEN
3928: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3929: fnd_message.set_token('API_NAME',l_api_name);
3930: fnd_message.set_token('SQL_ERROR',SQLERRM);
3931: x_error_message := fnd_msg_pub.get;
3932: x_return_status := l_fnd_unexpected;
3925: x_return_status := fnd_api.g_ret_sts_error;
3926:
3927: WHEN others THEN
3928: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3929: fnd_message.set_token('API_NAME',l_api_name);
3930: fnd_message.set_token('SQL_ERROR',SQLERRM);
3931: x_error_message := fnd_msg_pub.get;
3932: x_return_status := l_fnd_unexpected;
3933:
3926:
3927: WHEN others THEN
3928: fnd_message.set_name('CSI','CSI_UNEXP_SQL_ERROR');
3929: fnd_message.set_token('API_NAME',l_api_name);
3930: fnd_message.set_token('SQL_ERROR',SQLERRM);
3931: x_error_message := fnd_msg_pub.get;
3932: x_return_status := l_fnd_unexpected;
3933:
3934: END decode_message;