165: MSN.SERIAL_NUMBER = :B_SERIAL_NUMBER AND
166: MSN.INVENTORY_ITEM_ID = :B_ITEM_ID AND
167: MSN.CURRENT_ORGANIZATION_ID = :B_ORG_ID';
168:
169: lg_ret_sts_error CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_error;
170: lg_ret_sts_unexp_error CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_unexp_error;
171: lg_ret_sts_success CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_success;
172:
173: lg_exc_error EXCEPTION ; --fnd_api.g_exc_error;
166: MSN.INVENTORY_ITEM_ID = :B_ITEM_ID AND
167: MSN.CURRENT_ORGANIZATION_ID = :B_ORG_ID';
168:
169: lg_ret_sts_error CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_error;
170: lg_ret_sts_unexp_error CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_unexp_error;
171: lg_ret_sts_success CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_success;
172:
173: lg_exc_error EXCEPTION ; --fnd_api.g_exc_error;
174: lg_exc_unexpected_error EXCEPTION ; --fnd_api.g_exc_unexpected_error;
167: MSN.CURRENT_ORGANIZATION_ID = :B_ORG_ID';
168:
169: lg_ret_sts_error CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_error;
170: lg_ret_sts_unexp_error CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_unexp_error;
171: lg_ret_sts_success CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_success;
172:
173: lg_exc_error EXCEPTION ; --fnd_api.g_exc_error;
174: lg_exc_unexpected_error EXCEPTION ; --fnd_api.g_exc_unexpected_error;
175:
169: lg_ret_sts_error CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_error;
170: lg_ret_sts_unexp_error CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_unexp_error;
171: lg_ret_sts_success CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_success;
172:
173: lg_exc_error EXCEPTION ; --fnd_api.g_exc_error;
174: lg_exc_unexpected_error EXCEPTION ; --fnd_api.g_exc_unexpected_error;
175:
176:
177: TYPE seg_rec_type IS RECORD
170: lg_ret_sts_unexp_error CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_unexp_error;
171: lg_ret_sts_success CONSTANT VARCHAR2(30) := fnd_api.g_ret_sts_success;
172:
173: lg_exc_error EXCEPTION ; --fnd_api.g_exc_error;
174: lg_exc_unexpected_error EXCEPTION ; --fnd_api.g_exc_unexpected_error;
175:
176:
177: TYPE seg_rec_type IS RECORD
178: (colname varchar2(30),
784: END LOOP;
785: END if;
786: return true;
787: EXCEPTION
788: when FND_API.G_EXC_ERROR then
789: IF (l_debug = 1) THEN
790: inv_log_util.trace('SQL : ' || substr(sqlerrm, 1, 200), 'INV_TXN_MANAGER_GRP','9');
791: inv_log_util.trace('Error in check_partial_split : ' || l_error_exp, 'INV_TXN_MANAGER_GRP','9');
792: END IF;
1470: IF (l_debug = 1) THEN
1471: inv_log_util.trace('Error in derive_segment_ids : ' || l_error_exp, 'INV_TXN_MANAGER_GRP ','1');
1472: inv_log_util.trace('Error:'||substr(sqlerrm,1,250),'INV_TXN_MANAGER_GRP',1);
1473: END IF;
1474: x_return_status := FND_API.G_RET_STS_ERROR;
1475:
1476: END derive_segment_ids;
1477:
1478: -----------------------------------------------------------------------
1744: CLOSE get_transaction_details;
1745: FND_MESSAGE.SET_NAME('INV','TRX_TYPE_NOT_FOUND');
1746: FND_MESSAGE.SET_TOKEN('TRANSACTION_TYPE_ID', p_transaction_type_id);
1747: FND_MSG_PUB.ADD;
1748: RAISE FND_API.G_EXC_ERROR;
1749: END IF;
1750: CLOSE get_transaction_details;
1751:
1752: IF l_transaction_source_type_id = 5 AND l_transaction_action_id =32 THEN
1762: /*Bug,9717803 END Avoiding the indivisible lot validation for the reversal transactions */
1763:
1764: l_lot_indiv_trx_valid := INV_LOT_API_PUB.VALIDATE_LOT_INDIVISIBLE
1765: ( p_api_version => 1.0
1766: , p_init_msg_list => fnd_api.g_false
1767: , p_transaction_type_id => p_transaction_type_id
1768: , p_organization_id => p_organization_id
1769: , p_inventory_item_id => p_inventory_item_id
1770: , p_revision => p_revision
1801: --the transaction is not valid regarding lot indivisible:
1802: IF (l_debug = 1) THEN
1803: inv_log_util.trace('validate_quantities: Failed check for lot indivisibility', 'INV_TXN_MANAGER_GRP', 9);
1804: END IF;
1805: RAISE FND_API.G_EXC_ERROR;
1806: END IF;
1807:
1808: END IF;
1809: IF (l_debug = 1) THEN
1818:
1819: RETURN TRUE;
1820:
1821: EXCEPTION
1822: WHEN FND_API.G_EXC_ERROR THEN
1823: FND_MSG_PUB.Get(
1824: p_msg_index => 1,
1825: p_data => l_msg,
1826: p_encoded => FND_API.G_FALSE,
1822: WHEN FND_API.G_EXC_ERROR THEN
1823: FND_MSG_PUB.Get(
1824: p_msg_index => 1,
1825: p_data => l_msg,
1826: p_encoded => FND_API.G_FALSE,
1827: p_msg_index_out => l_msg_index_out);
1828:
1829: l_error_exp := l_msg;
1830: l_error_code := l_msg;
1829: l_error_exp := l_msg;
1830: l_error_code := l_msg;
1831:
1832: IF (l_debug = 1) THEN
1833: inv_log_util.trace('validate_quantities: FND_API.G_EXC_ERROR ' || l_error_code, 'INV_TXN_MANAGER_GRP', 9);
1834: END IF;
1835:
1836: errupdate(p_rowid, p_lot_rowid);
1837: RETURN FALSE;
1898: x_msg_count OUT NOCOPY NUMBER,
1899: x_msg_data OUT NOCOPY VARCHAR2,
1900: p_userid NUMBER,
1901: p_loginid NUMBER,
1902: p_validation_level NUMBER:= fnd_api.g_valid_level_full)
1903: IS
1904:
1905: srctypeid NUMBER;
1906: tvu_flow_schedule VARCHAR2(50);
2039: AND PROCESS_FLAG = 1
2040: AND ROWNUM < 2;
2041: EXCEPTION
2042: WHEN NO_DATA_FOUND THEN
2043: x_return_status := FND_API.G_RET_STS_ERROR;
2044: x_msg_data := 'No Transaction found in MTI';
2045: return;
2046: END;
2047:
2051: inv_log_util.trace('wip_constants.DMF_PATCHSET_J_VALUE'||wip_constants.dmf_patchset_J_VALUE,'INV_TXN_MANAGER_GRP', 9);
2052: END IF;
2053:
2054: IF (srctypeid = 5 AND wip_constants.DMF_PATCHSET_LEVEL>= wip_constants.DMF_PATCHSET_J_VALUE) THEN
2055: IF (p_validation_level <> fnd_api.g_valid_level_full) THEN
2056: l_validate_full := FALSE;
2057: /**implies this a WIP desktop transaction*/
2058: IF (l_debug = 1) THEN
2059: inv_log_util.trace('Val Grp:WIP desktop trx','INV_TXN_MANAGER_GRP', 9);
4236: -- end of fix for eam
4237:
4238: END IF;--J-dev
4239:
4240: x_return_status := FND_API.G_RET_STS_SUCCESS;
4241:
4242: FND_MESSAGE.clear;
4243:
4244:
4247: IF (l_debug = 1) THEN
4248: inv_log_util.trace('Error in validate_group : ' || l_error_exp, 'INV_TXN_MANAGER_GRP','1');
4249: inv_log_util.trace('Error:'||substr(sqlerrm,1,250),'INV_TXN_MANAGER_GRP',1);
4250: END IF;
4251: x_return_status := FND_API.G_RET_STS_ERROR;
4252: FND_MESSAGE.clear;
4253:
4254: END validate_group;
4255:
4627: /* this api will validate all the added new lot attributes intoduced in INVCONV
4628: project */
4629: l_attr_check := VALIDATE_ADDITIONAL_ATTR(
4630: p_api_version => 1.0
4631: , p_init_msg_list => fnd_api.g_false
4632: , p_validation_level => fnd_api.g_valid_level_full
4633: , p_intid => p_intid
4634: , p_rowid => p_rowid
4635: , p_inventory_item_id => p_itemid
4628: project */
4629: l_attr_check := VALIDATE_ADDITIONAL_ATTR(
4630: p_api_version => 1.0
4631: , p_init_msg_list => fnd_api.g_false
4632: , p_validation_level => fnd_api.g_valid_level_full
4633: , p_intid => p_intid
4634: , p_rowid => p_rowid
4635: , p_inventory_item_id => p_itemid
4636: , p_organization_id => p_orgid
6386: * validate_lines() : Outer
6387: *
6388: ******************************************************************/
6389: PROCEDURE validate_lines(p_header_id NUMBER,
6390: p_commit VARCHAR2 := fnd_api.g_false ,
6391: p_validation_level NUMBER := fnd_api.g_valid_level_full ,
6392: x_return_status OUT NOCOPY VARCHAR2,
6393: x_msg_count OUT NOCOPY NUMBER,
6394: x_msg_data OUT NOCOPY VARCHAR2,
6387: *
6388: ******************************************************************/
6389: PROCEDURE validate_lines(p_header_id NUMBER,
6390: p_commit VARCHAR2 := fnd_api.g_false ,
6391: p_validation_level NUMBER := fnd_api.g_valid_level_full ,
6392: x_return_status OUT NOCOPY VARCHAR2,
6393: x_msg_count OUT NOCOPY NUMBER,
6394: x_msg_data OUT NOCOPY VARCHAR2,
6395: p_userid NUMBER,
6491:
6492: END;
6493: END LOOP;
6494:
6495: x_return_status := FND_API.G_RET_STS_SUCCESS;
6496:
6497: EXCEPTION
6498: WHEN OTHERS THEN
6499: IF (l_debug = 1) THEN
6499: IF (l_debug = 1) THEN
6500: inv_log_util.trace('Error in outer validate_lines'||substr(sqlerrm,1,240),
6501: 'INV_TXN_MANAGER_GRP',1);
6502: END IF;
6503: x_return_status := FND_API.G_RET_STS_ERROR;
6504:
6505: END validate_lines;
6506:
6507:
6511: * Validate one transaction record in MTL_TRANSACTIONS_INTERFACE
6512: *
6513: ******************************************************************/
6514: PROCEDURE validate_lines(p_line_Rec_Type inv_txn_manager_pub.line_rec_type,
6515: p_commit VARCHAR2 := fnd_api.g_false ,
6516: p_validation_level NUMBER := fnd_api.g_valid_level_full ,
6517: p_error_flag OUT NOCOPY VARCHAR2,
6518: p_userid NUMBER,
6519: p_loginid NUMBER,
6512: *
6513: ******************************************************************/
6514: PROCEDURE validate_lines(p_line_Rec_Type inv_txn_manager_pub.line_rec_type,
6515: p_commit VARCHAR2 := fnd_api.g_false ,
6516: p_validation_level NUMBER := fnd_api.g_valid_level_full ,
6517: p_error_flag OUT NOCOPY VARCHAR2,
6518: p_userid NUMBER,
6519: p_loginid NUMBER,
6520: p_applid NUMBER,
6765: inv_log_util.trace('wip_constants.DMF_PATCHSET_J_VALUE'||wip_constants.dmf_patchset_J_VALUE,'INV_TXN_MANAGER_GRP', 9);
6766: END IF;
6767:
6768: IF (l_srctype = 5 AND wip_constants.DMF_PATCHSET_LEVEL>= wip_constants.DMF_PATCHSET_J_VALUE) THEN
6769: IF (p_validation_level <> fnd_api.g_valid_level_full) THEN
6770: l_validate_full := FALSE;
6771: /**implies this a WIP desktop transaction*/
6772: IF (l_debug = 1) THEN
6773: inv_log_util.trace('Val line:WIP desktop trx','INV_TXN_MANAGER_GRP', 9);
6803: inv_log_util.trace('Before calling setorgclientinfo with l_orgid '||l_orgid, 'INV_TXN_MANAGER_GRP', 9);
6804: END IF;
6805:
6806: IF (NOT setorgclientinfo(l_orgid)) THEN
6807: RAISE fnd_api.g_exc_error;
6808: END IF;
6809:
6810: IF (l_debug = 1) THEN
6811: inv_log_util.trace('After calling setorgclientinfo', 'INV_TXN_MANAGER_GRP',9);
6857: IF (l_debug = 1) THEN
6858: inv_log_util.trace('Failed the source project Validation**', 'INV_TXN_MANAGER_GRP',9);
6859: END IF;
6860: l_count := l_count + 1;
6861: RAISE fnd_api.g_exc_error;
6862: end if;
6863:
6864: IF (l_debug = 1) THEN
6865: inv_log_util.trace('After update on MTI for INV_PRJ_ERR', 'INV_TXN_MANAGER_GRP',9);
6868: /*
6869:
6870: IF (SQL%FOUND) THEN
6871: l_count := l_count + 1;
6872: RAISE fnd_api.g_exc_error;
6873: END IF;
6874:
6875: */
6876:
6916: IF (l_debug = 1) THEN
6917: inv_log_util.trace('Failed the Negative Txn cost Validation**', 'INV_TXN_MANAGER_GRP',9);
6918: END IF;
6919: l_count := l_count + 1;
6920: RAISE fnd_api.g_exc_error;
6921: end if;
6922:
6923: IF (l_debug = 1) THEN
6924: inv_log_util.trace('After update on MTI for INV_UNIT_COST_NEG','INV_TXN_MANAGER_GRP',9);
6967: IF (l_debug = 1) THEN
6968: inv_log_util.trace('Failed the exp org Validation**', 'INV_TXN_MANAGER_GRP',9);
6969: END IF;
6970: l_count := l_count + 1;
6971: RAISE fnd_api.g_exc_error;
6972: end if;
6973:
6974: IF (l_debug = 1) THEN
6975: inv_log_util.trace('After update on MTI for INV_PAORG_ERR','INV_TXN_MANAGER_GRP',9);
6977:
6978: /*
6979: IF (SQL%ROWCOUNT > 0) THEN
6980: l_count := l_count + 1;
6981: RAISE fnd_api.g_exc_error;
6982: END IF;
6983: */
6984:
6985: --End Fix 2505534
7001: l_error_code := FND_MESSAGE.get;
7002:
7003: errupdate(l_rowid,null);
7004: --exit;
7005: RAISE fnd_api.g_exc_error;
7006: END IF;
7007: END IF;
7008:
7009: IF l_itemid IS NULL THEN
7012: l_error_code := FND_MESSAGE.get;
7013:
7014: errupdate(l_rowid,null);
7015: --exit;
7016: RAISE fnd_api.g_exc_error;
7017: END IF;
7018: END IF;
7019:
7020: /* CFM Scrap Transactions */
7044: loaderrmsg('INV_INT_ITMCODE','INV-No item record');
7045: errupdate(l_rowid,null);
7046: l_count := l_count + 1;
7047: --exit;
7048: RAISE fnd_api.g_exc_error;
7049: END;
7050:
7051: ELSE
7052: BEGIN
7082: loaderrmsg('INV_INT_ITMCODE','INV-No item record');
7083: errupdate(l_rowid,null);
7084: l_count := l_count + 1;
7085: --exit;
7086: RAISE fnd_api.g_exc_error;
7087: END;
7088: END IF;
7089:
7090:
7114: FND_MESSAGE.set_name('INV', 'INV_INT_LOCSEGCODE');
7115: l_error_exp := FND_MESSAGE.get; --bug6679112, error_code=>error_exp
7116: errupdate(l_rowid,null);
7117: --exit;
7118: RAISE fnd_api.g_exc_error;
7119: END IF;
7120:
7121: /* get the default locator status */
7122: IF l_wms_installed THEN
7241:
7242: errupdate(l_rowid,null);
7243: l_count := l_count + 1;
7244: --exit;
7245: RAISE fnd_api.g_exc_error;
7246: END IF;
7247:
7248: END IF;
7249:
7262: loaderrmsg('INV_INT_XSUBCODE','INV_DEFAULT_SUB');
7263: errupdate(l_rowid,null);
7264: l_count := l_count + 1;
7265: --exit;
7266: RAISE fnd_api.g_exc_error;
7267: END;
7268: ELSE
7269: loaderrmsg('INV_INT_XSUBCODE','INV_INT_XSUBEXP');
7270: errupdate(l_rowid,null);
7269: loaderrmsg('INV_INT_XSUBCODE','INV_INT_XSUBEXP');
7270: errupdate(l_rowid,null);
7271: l_count := l_count + 1;
7272: --exit;
7273: RAISE fnd_api.g_exc_error;
7274: END IF;
7275: END IF;
7276:
7277:
7301: loaderrmsg('INV_INT_ITMCODE','INV-No item record');
7302: errupdate(l_rowid,null);
7303: l_count := l_count + 1;
7304: --exit;
7305: RAISE fnd_api.g_exc_error;
7306: END;
7307:
7308: --IF (l_xlocctrl IS NULL) THEN bug2460745
7309:
7339: loaderrmsg('INV_INT_XLOCCODE','INV_DEFAULT_LOC');
7340: errupdate(l_rowid,null);
7341: l_count := l_count + 1;
7342: --exit;
7343: RAISE fnd_api.g_exc_error;
7344: END;
7345:
7346: /* For srctype = 8 i.e internal order, the below code is added to append
7347: project and task from the requisition to a locator that is selected
7363:
7364: errupdate(l_rowid,null);
7365: l_count := l_count + 1;
7366: --exit;
7367: RAISE fnd_api.g_exc_error;
7368: END IF;
7369: END IF;
7370: ELSE
7371: -- Bug 5011566 setting transfer org as org context
7370: ELSE
7371: -- Bug 5011566 setting transfer org as org context
7372: IF (l_srctype in (8, 13)) and (l_acttype = 3) and (l_xorgid is not null) THEN
7373: IF (NOT setorgclientinfo(l_xorgid)) THEN
7374: RAISE fnd_api.g_exc_error;
7375: END IF;
7376: fnd_profile.put('MFG_ORGANIZATION_ID',l_xorgid);
7377: END IF;
7378:
7380: l_xlocctrl)) THEN
7381: FND_MESSAGE.set_name('INV', 'INV_INT_XLOCCODE');
7382: l_error_code := FND_MESSAGE.get;
7383: --exit;
7384: RAISE fnd_api.g_exc_error;
7385: END IF;
7386:
7387: /* get the default locator status */
7388: IF l_wms_installed THEN
7458: END IF;
7459: -- Bug 5011566 re-setting org as org context
7460: IF (l_srctype in (8, 13)) and (l_acttype = 3) and (l_xorgid is not null) then
7461: IF (NOT setorgclientinfo(l_orgid)) THEN
7462: RAISE fnd_api.g_exc_error;
7463: END IF;
7464: fnd_profile.put('MFG_ORGANIZATION_ID',l_orgid);
7465: END IF;
7466: END IF;
7480: inv_log_util.trace('re-setting org context, before calling setorgclientinfo with l_orgid '||l_orgid, 'INV_TXN_MANAGER_GRP', 9);
7481: END IF;
7482:
7483: IF (NOT setorgclientinfo(l_xorgid)) THEN
7484: RAISE fnd_api.g_exc_error;
7485: END IF;
7486: fnd_profile.put('MFG_ORGANIZATION_ID',l_xorgid);
7487:
7488: IF (l_debug = 1) THEN
7501:
7502: errupdate(l_rowid,null);
7503: l_count := l_count + 1;
7504: --exit;
7505: RAISE fnd_api.g_exc_error;
7506: END IF;
7507:
7508: -- Begin fix of bug 15931430
7509: IF (l_srctype in (8, 13)) and (l_acttype = 3) and (l_xorgid is not null) then
7510: IF (l_debug = 1) THEN
7511: inv_log_util.trace('For transfer org, before calling setorgclientinfo with l_orgid '||l_orgid, 'INV_TXN_MANAGER_GRP', 9);
7512: END IF;
7513: IF (NOT setorgclientinfo(l_orgid)) THEN
7514: RAISE fnd_api.g_exc_error;
7515: END IF;
7516: fnd_profile.put('MFG_ORGANIZATION_ID',l_orgid);
7517: IF (l_debug = 1) THEN
7518: inv_log_util.trace('For transfer org, after calling setorgclientinfo', 'INV_TXN_MANAGER_GRP',9);
7543:
7544: errupdate(l_rowid,null);
7545: l_count := l_count + 1;
7546: --exit;
7547: RAISE fnd_api.g_exc_error;
7548: END;
7549:
7550: /* Borrow Payback */
7551: IF(l_acttype = 2) THEN
7561:
7562: errupdate(l_rowid,null);
7563: l_count := l_count + 1;
7564: --exit;
7565: RAISE fnd_api.g_exc_error;
7566: END IF;
7567: END IF;
7568: --prOR := 0;
7569: IF (l_srctype <> 14) THEN /* PCST */
7575:
7576: errupdate(l_rowid,null);
7577: l_count := l_count + 1;
7578: --exit;
7579: RAISE fnd_api.g_exc_error;
7580: END IF;
7581:
7582: l_prdid := get_open_period(l_orgid,l_trxdate,0);
7583:
7592:
7593: errupdate(l_rowid,null);
7594: l_count := l_count + 1;
7595: --exit;
7596: RAISE fnd_api.g_exc_error;
7597: END IF;
7598: /*Bug#5205455. Validation of the acc period for to_org */
7599: IF ( l_acttype IN ( 3, 21) OR
7600: (l_srctype = 8 AND l_acttype IN (1, 2)) ) THEN
7643: FND_MESSAGE.set_name('INV', 'INV_NO_OPEN_PERIOD_TOORG');
7644: l_error_exp := FND_MESSAGE.get;
7645: errupdate(l_rowid,null);
7646: l_count := l_count + 1;
7647: RAISE fnd_api.g_exc_error;
7648: END IF;
7649: END IF;
7650: END IF;
7651:
7929: IF ( l_error_exp IS NOT NULL) THEN
7930: errupdate(l_rowid,null);
7931: l_count := l_count + 1;
7932: --exit;
7933: RAISE fnd_api.g_exc_error;
7934: END IF;
7935: END IF;
7936: END IF;
7937:
7957: IF l_error_exp IS NOT NULL THEN
7958: errupdate(l_rowid,null);
7959: l_count := l_count + 1;
7960: --exit;
7961: RAISE fnd_api.g_exc_error;
7962: END IF;
7963: END IF;
7964:
7965: /* Do this snapshot moves for non-CFM WIP completions,returns,
7992: IF l_error_exp IS NOT NULL THEN
7993: errupdate(l_rowid,null);
7994: l_count := l_count + 1;
7995: --exit;
7996: RAISE fnd_api.g_exc_error;
7997: END IF;
7998: END IF;
7999: END IF;
8000: END IF; --J-dev
8062: END IF;
8063: loaderrmsg('INV_INT_LOTCODE','INV_INVLTPU_LOTTRX_QTY');
8064: errupdate(l_rowid,null);
8065: l_count := l_count + 1;
8066: RAISE fnd_api.g_exc_error;
8067: ELSE
8068: IF (l_debug = 1) THEN
8069: inv_log_util.trace('no mismatch in lot/serial quantities','INV_TXN_MANAGER_GRP', 9);
8070: END IF;
8110: END IF;
8111: loaderrmsg('INV_INT_SERMISCODE','INV_INVLTPU_LOTTRX_QTY');
8112: errupdate(l_rowid,null);
8113: l_count := l_count + 1;
8114: RAISE fnd_api.g_exc_error;
8115: ELSE
8116: IF (l_debug = 1) THEN
8117: inv_log_util.trace('no mismatch in serial quantities','INV_TXN_MANAGER_GRP', 9);
8118: END IF;
8152: END IF;
8153: errupdate(l_rowid,null);
8154: l_count := l_count + 1;
8155: ROLLBACK TO val_lot_serial_for_rcpt_sp;
8156: RAISE fnd_api.g_exc_error;
8157: ELSE
8158: IF (l_debug = 1) THEN
8159: inv_log_util.trace('Call to validate_lot_serial_for_rcpt successful','INV_TXN_MANAGER_GRP', 9);
8160: END IF;
8197: -- INVCONV end fabdi
8198: THEN
8199: l_count := l_count + 1;
8200: --exit;
8201: RAISE fnd_api.g_exc_error;
8202:
8203: -- bug 8669802 When txn_uom is different from pri_uom, the primary qty on for item and lot could be
8204: -- different, if uom conversion setup for item is different from lot. We need honor
8205: -- lot primary_qty converion.
8234: loaderrmsg('INV_INT_LOTCODE','INV_INT_LOTEXP');
8235: errupdate(l_rowid,null);
8236: l_count := l_count + 1;
8237: --exit;
8238: RAISE fnd_api.g_exc_error;
8239: END;
8240: ELSE
8241: loaderrmsg('INV_INT_LOTCODE','INV_INT_LOTEXP');
8242: errupdate(l_rowid,null);
8241: loaderrmsg('INV_INT_LOTCODE','INV_INT_LOTEXP');
8242: errupdate(l_rowid,null);
8243: l_count := l_count + 1;
8244: --exit;
8245: RAISE fnd_api.g_exc_error;
8246: END IF;--l_intid is null
8247: ELSE
8248: IF l_intid IS NOT NULL THEN
8249: DELETE FROM MTL_TRANSACTION_LOTS_INTERFACE
8274: loaderrmsg('INV_INT_SERMISCODE','INV_INT_SERMISEXP');
8275: errupdate(l_rowid,null);
8276: l_count := l_count + 1;
8277: --exit;
8278: RAISE fnd_api.g_exc_error;
8279: ELSE
8280: BEGIN
8281: SELECT 1
8282: into l_tnum
8287: WHEN NO_DATA_FOUND THEN
8288: loaderrmsg('INV_INT_SERMISCODE','INV_INT_SERMISEXP');
8289: errupdate(l_rowid,null);
8290: l_count := l_count + 1;
8291: RAISE fnd_api.g_exc_error;
8292: --exit;
8293: END;
8294: END IF;--l_intid is null
8295: ELSE
8364: l_error_code := FND_MESSAGE.get;
8365:
8366: errupdate(l_rowid,null);
8367: --exit;
8368: RAISE fnd_api.g_exc_error;
8369: END IF;
8370: END IF;
8371: END IF;
8372:
8377: IF ( NOT validate_acctid(l_acct, l_orgid, l_trxdate)) THEN
8378: FND_MESSAGE.set_name('INV', 'INV_INT_ACTCODE');
8379: l_error_code := FND_MESSAGE.get;
8380: errupdate(l_rowid,null);
8381: RAISE fnd_api.g_exc_error;
8382: END IF;
8383: END IF;
8384:
8385: --J-dev
8395:
8396: errupdate(l_rowid,null);
8397: l_count := l_count + 1;
8398: --exit;
8399: RAISE fnd_api.g_exc_error;
8400:
8401: END IF;
8402:
8403:
8742: IF (l_debug = 1) THEN
8743: inv_log_util.trace('After getting transfer price. Status: ' || x_return_status, 'INV_TXN_MANAGER_GRP','1');
8744: END IF;
8745:
8746: IF x_return_status = FND_API.G_RET_STS_SUCCESS
8747: THEN
8748:
8749: --
8750: -- Bug 5136335
8772: FND_MESSAGE.set_name('BOM', 'CST_XFER_PRICE_ERROR');
8773: l_error_code := FND_MESSAGE.get;
8774: errupdate(l_rowid,null);
8775: l_count := l_count + 1;
8776: RAISE fnd_api.g_exc_error;
8777: END IF;
8778:
8779: ELSE
8780: IF (l_debug = 1) THEN
8888:
8889: /*---------------------------------------+
8890: | Commit work only if not a CFM WIP txn |
8891: +---------------------------------------*/
8892: IF (l_flow_schedule_children <> 1) AND FND_API.To_Boolean( p_commit ) THEN
8893: COMMIT WORK;
8894: END IF;
8895: -- END LOOP;
8896:
8977:
8978: /*---------------------------------------+
8979: | Commit work only if not a CFM WIP txn |
8980: +---------------------------------------*/
8981: IF (l_flow_schedule_children <> 1) AND FND_API.To_Boolean( p_commit ) THEN
8982: COMMIT WORK;
8983: END IF;
8984:
8985: l_error_exp := '';
9052: * tmpinsert()
9053: *
9054: ******************************************************************/
9055: FUNCTION tmpinsert(p_header_id IN NUMBER,
9056: p_validation_level IN NUMBER := fnd_api.g_valid_level_full )
9057: RETURN BOOLEAN
9058: IS
9059:
9060: l_lt_flow_schedule NUMBER;
9435: TRANSFER_PLANNING_TP_TYPE,
9436: TRANSACTION_BATCH_ID,
9437: TRANSACTION_BATCH_SEQ,
9438: TRANSFER_COST_GROUP_ID,
9439: Decode(p_validation_level,fnd_api.g_valid_level_none,transaction_mode,INV_TXN_MANAGER_GRP.proc_mode_mti),
9440: -- start of fix for eam
9441: -- added following 4 columns
9442: REBUILD_ITEM_ID,
9443: REBUILD_ACTIVITY_ID,
9782: MTI.TRANSFER_PLANNING_TP_TYPE,
9783: MTI.TRANSACTION_BATCH_ID,
9784: MTI.TRANSACTION_BATCH_SEQ,
9785: MTI.TRANSFER_COST_GROUP_ID,
9786: Decode(p_validation_level,fnd_api.g_valid_level_none,mti.transaction_mode,INV_TXN_MANAGER_GRP.proc_mode_mti),
9787: -- start of fix for eam
9788: -- added following 4 columns
9789: MTI.REBUILD_ITEM_ID,
9790: MTI.REBUILD_ACTIVITY_ID,
10136: mti.TRANSFER_PLANNING_TP_TYPE,
10137: MTI.TRANSACTION_BATCH_ID,
10138: MTI.TRANSACTION_BATCH_SEQ,
10139: MTI.TRANSFER_COST_GROUP_ID,
10140: Decode(p_validation_level,fnd_api.g_valid_level_none,mti.transaction_mode,INV_TXN_MANAGER_GRP.proc_mode_mti),
10141: -- start of fix for eam
10142: -- added following 4 columns
10143: MTI.REBUILD_ITEM_ID,
10144: MTI.REBUILD_ACTIVITY_ID,
10466: mti.TRANSFER_PLANNING_TP_TYPE,
10467: MTI.TRANSACTION_BATCH_ID,
10468: MTI.TRANSACTION_BATCH_SEQ,
10469: MTI.TRANSFER_COST_GROUP_ID,
10470: Decode(p_validation_level,fnd_api.g_valid_level_none,mti.transaction_mode,INV_TXN_MANAGER_GRP.proc_mode_mti),
10471: -- start of fix for eam
10472: -- added following 4 columns
10473: MTI.REBUILD_ITEM_ID,
10474: MTI.REBUILD_ACTIVITY_ID,
11494: , x_msg_data OUT NOCOPY VARCHAR2
11495: , x_validation_status OUT NOCOPY VARCHAR2
11496: , p_header_id IN NUMBER
11497: , p_validation_level IN NUMBER
11498: := fnd_api.g_valid_level_full
11499: )
11500: IS
11501: /*Select only lot split/merge and translate transactions */
11502: CURSOR mti_csr(l_header_id IN NUMBER)
12131: mydebug ('breadcrumb 10', 'tmpinsert2');
12132: END IF;
12133:
12134: l_validation_status := 'Y';
12135: x_return_status := fnd_api.g_ret_sts_success;
12136: l_sysdate := SYSDATE;
12137: l_user_id := fnd_global.user_id;
12138: l_login_id := fnd_global.login_id;
12139:
12492: , l_mti_csr.transfer_cost_group_id
12493: ,
12494: --this goes into transaction_mode
12495: DECODE (p_validation_level
12496: , fnd_api.g_valid_level_none, l_mti_csr.transaction_mode
12497: , inv_txn_manager_grp.proc_mode_mti
12498: )
12499: , l_mti_csr.rebuild_item_id
12500: , l_mti_csr.rebuild_activity_id
12799: );
12800: END IF;
12801:
12802: x_validation_status := 'N';
12803: RAISE fnd_api.g_exc_unexpected_error;
12804: END;
12805:
12806: IF (l_debug = 1)
12807: THEN
12857: THEN
12858: fnd_message.set_name ('INV', 'INV_INVALID_SERIAL_RANGE');
12859: fnd_msg_pub.ADD;
12860: l_validation_status := 'N';
12861: RAISE fnd_api.g_exc_error;
12862: END IF;
12863:
12864: /***********************************************************************
12865: * Each MSNI can have a range of serials. Need to expand them and *
12950:
12951: fnd_message.set_name ('WMS', 'WMS_GET_LOT_ATTR_ERROR');
12952: fnd_msg_pub.ADD;
12953: l_validation_status := 'N';
12954: RAISE fnd_api.g_exc_unexpected_error;
12955: END;
12956:
12957: BEGIN
12958: IF (l_debug = 1)
12988: fnd_message.set_name ('WMS'
12989: , 'WMS_VALIDATE_ATTR_ERROR');
12990: fnd_msg_pub.ADD;
12991: l_validation_status := 'N';
12992: RAISE fnd_api.g_exc_unexpected_error;
12993: END;
12994:
12995: IF ( x_return_status <> fnd_api.g_ret_sts_success
12996: OR x_validation_status <> 'Y'
12991: l_validation_status := 'N';
12992: RAISE fnd_api.g_exc_unexpected_error;
12993: END;
12994:
12995: IF ( x_return_status <> fnd_api.g_ret_sts_success
12996: OR x_validation_status <> 'Y'
12997: )
12998: THEN
12999: IF (l_debug = 1)
13003: , 'tmpinsert2'
13004: );
13005: END IF;
13006: l_validation_status := 'N';
13007: RAISE fnd_api.g_exc_error;
13008: END IF;
13009:
13010: IF (l_debug = 1)
13011: THEN
13415:
13416: fnd_message.set_name ('INV', 'INVALID_SERIAL_NUMBER');
13417: fnd_msg_pub.ADD;
13418: l_validation_status := 'N';
13419: RAISE fnd_api.g_exc_error;
13420: END IF;
13421:
13422: END LOOP;
13423: END LOOP;
13437: );
13438: END IF;
13439:
13440: l_validation_status := 'N';
13441: RAISE fnd_api.g_exc_unexpected_error;
13442: WHEN OTHERS
13443: THEN
13444: IF (l_debug = 1)
13445: THEN
13447: ('exception raised while inserting into MSNT for lot split/merge'
13448: , SQLERRM
13449: );
13450: END IF;
13451: RAISE fnd_api.g_exc_unexpected_error;
13452: END;
13453: ELSE
13454: IF (l_debug = 1)
13455: THEN
13524: mydebug('Lot translate : Items have different Serial Attr Context', 'tmpinsert2');
13525: END IF;
13526: fnd_message.set_name ('INV', 'INV_SERIAL_CONTEXT_DIFF');
13527: fnd_msg_pub.ADD;
13528: RAISE fnd_api.g_exc_error;
13529: l_validation_status := 'N';
13530: END IF;
13531: END IF;
13532: ELSE /*Source MTIs*/
13877: );
13878: END IF;
13879:
13880: l_validation_status := 'N';
13881: RAISE fnd_api.g_exc_unexpected_error;
13882: WHEN OTHERS
13883: THEN
13884: IF (l_debug = 1)
13885: THEN
13890: );
13891: END IF;
13892:
13893: l_validation_status := 'N';
13894: RAISE fnd_api.g_exc_unexpected_error;
13895: END;
13896: END IF;
13897: END IF; --if serial_controlled
13898: END LOOP;--loop of MTLI
13906: mydebug (' exception happened in tmpinsert2 ' || SQLERRM, 'tmpinsert2');
13907: END IF;
13908:
13909: l_validation_status := 'N';
13910: RAISE fnd_api.g_exc_unexpected_error;
13911: END;
13912:
13913: /*All records processed successfully*/
13914: IF (l_debug = 1)
13916: mydebug (' insertions done .. !! ', 'tmpinsert2');
13917: END IF;
13918:
13919: x_validation_status := 'Y';
13920: x_return_status := fnd_api.g_ret_sts_success;
13921: EXCEPTION
13922: WHEN fnd_api.g_exc_error
13923: THEN
13924: IF (l_debug = 1)
13918:
13919: x_validation_status := 'Y';
13920: x_return_status := fnd_api.g_ret_sts_success;
13921: EXCEPTION
13922: WHEN fnd_api.g_exc_error
13923: THEN
13924: IF (l_debug = 1)
13925: THEN
13926: mydebug ('breadcrumb 290', 'tmpinsert2');
13926: mydebug ('breadcrumb 290', 'tmpinsert2');
13927: END IF;
13928:
13929: x_validation_status := l_validation_status;
13930: x_return_status := fnd_api.g_ret_sts_error;
13931: fnd_msg_pub.count_and_get (p_count => x_msg_count
13932: , p_data => x_msg_data);
13933: WHEN fnd_api.g_exc_unexpected_error
13934: THEN
13929: x_validation_status := l_validation_status;
13930: x_return_status := fnd_api.g_ret_sts_error;
13931: fnd_msg_pub.count_and_get (p_count => x_msg_count
13932: , p_data => x_msg_data);
13933: WHEN fnd_api.g_exc_unexpected_error
13934: THEN
13935: x_validation_status := l_validation_status;
13936: x_return_status := fnd_api.g_ret_sts_unexp_error;
13937: fnd_msg_pub.count_and_get (p_count => x_msg_count
13932: , p_data => x_msg_data);
13933: WHEN fnd_api.g_exc_unexpected_error
13934: THEN
13935: x_validation_status := l_validation_status;
13936: x_return_status := fnd_api.g_ret_sts_unexp_error;
13937: fnd_msg_pub.count_and_get (p_count => x_msg_count
13938: , p_data => x_msg_data);
13939: WHEN OTHERS
13940: THEN
13938: , p_data => x_msg_data);
13939: WHEN OTHERS
13940: THEN
13941: x_validation_status := l_validation_status;
13942: x_return_status := fnd_api.g_ret_sts_unexp_error;
13943:
13944: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
13945: THEN
13946: fnd_msg_pub.add_exc_msg (g_pkg_name, 'tmpinert2');
13994: -- Do not call the query_tree for gme yield transactions.
13995: -----------------------------------------------------------------------
13996: FUNCTION Validate_Transactions(
13997: p_api_version IN NUMBER ,
13998: p_init_msg_list IN VARCHAR2 := fnd_api.g_false ,
13999: p_validation_level IN NUMBER := fnd_api.g_valid_level_full ,
14000: p_header_id IN NUMBER,
14001: x_return_status OUT NOCOPY VARCHAR2 ,
14002: x_msg_count OUT NOCOPY NUMBER ,
13995: -----------------------------------------------------------------------
13996: FUNCTION Validate_Transactions(
13997: p_api_version IN NUMBER ,
13998: p_init_msg_list IN VARCHAR2 := fnd_api.g_false ,
13999: p_validation_level IN NUMBER := fnd_api.g_valid_level_full ,
14000: p_header_id IN NUMBER,
14001: x_return_status OUT NOCOPY VARCHAR2 ,
14002: x_msg_count OUT NOCOPY NUMBER ,
14003: x_msg_data OUT NOCOPY VARCHAR2 ,
14001: x_return_status OUT NOCOPY VARCHAR2 ,
14002: x_msg_count OUT NOCOPY NUMBER ,
14003: x_msg_data OUT NOCOPY VARCHAR2 ,
14004: x_trans_count OUT NOCOPY NUMBER ,
14005: p_free_tree IN VARCHAR2 := fnd_api.g_true)
14006:
14007: RETURN NUMBER
14008: IS
14009: l_header_id NUMBER;
14276: IF l_userid is NULL THEN
14277: l_userid := -1;
14278: END IF;
14279:
14280: x_return_status := FND_API.G_RET_STS_ERROR;
14281: x_msg_count := 0;
14282: x_msg_data := '';
14283: x_trans_count := 0;
14284:
14310: l_userid,
14311: l_loginid,
14312: p_validation_level);
14313:
14314: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
14315: IF (l_debug = 1) THEN
14316: inv_log_util.trace('Unexpected Error in Validate Group : ' || x_msg_data,'INV_TXN_MANAGER_GRP', 9);
14317: END IF;
14318: RAISE fnd_api.g_exc_unexpected_error;
14314: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
14315: IF (l_debug = 1) THEN
14316: inv_log_util.trace('Unexpected Error in Validate Group : ' || x_msg_data,'INV_TXN_MANAGER_GRP', 9);
14317: END IF;
14318: RAISE fnd_api.g_exc_unexpected_error;
14319: END IF;
14320:
14321: batch_error := FALSE;
14322:
14345: IF (line_vldn_error_flag = 'Y') then
14346: IF (l_debug = 1) THEN
14347: inv_log_util.trace('Error in Line Validatin', 'INV_TXN_MANAGER_GRP', 9);
14348: END IF;
14349: RAISE fnd_api.g_exc_unexpected_error;
14350: --SQL error
14351: END IF;
14352: EXCEPTION
14353: /* Added for Bug 6679112 */
14524: l_actid = INV_GLOBALS.G_ACTION_ASSYRETURN AND l_dem_hdr_id IS NOT NULL ) then
14525:
14526: INV_QUANTITY_TREE_PVT.create_tree
14527: ( p_api_version_number => 1.0
14528: , p_init_msg_lst => fnd_api.g_false
14529: , x_return_status => l_return_status
14530: , x_msg_count => l_msg_count
14531: , x_msg_data => l_msg_data
14532: , p_organization_id => l_org_id
14550: ELSE
14551:
14552: INV_QUANTITY_TREE_PVT.create_tree
14553: ( p_api_version_number => 1.0
14554: , p_init_msg_lst => fnd_api.g_false
14555: , x_return_status => l_return_status
14556: , x_msg_count => l_msg_count
14557: , x_msg_data => l_msg_data
14558: , p_organization_id => l_org_id
14581: END IF;
14582:
14583:
14584:
14585: IF l_return_status IN (fnd_api.g_ret_sts_error, fnd_api.g_ret_sts_unexp_error) THEN
14586: IF (l_debug = 1) THEN
14587: inv_log_util.trace('Error while creating tree : x_msg_data = ' || l_msg_data,'INV_TXN_MANAGER_GRP', 9);
14588: END IF;
14589: FND_MESSAGE.set_name('INV','INV_ERR_CREATETREE');
14628: IF ( NOT l_current_batch_failed) THEN --100
14629:
14630: INV_QUANTITY_TREE_PVT.query_tree
14631: ( p_api_version_number => 1.0
14632: , p_init_msg_lst => fnd_api.g_false
14633: , x_return_status => l_return_status
14634: , x_msg_count => l_msg_count
14635: , x_msg_data => l_msg_data
14636: , p_tree_id => l_tree_id
14647: , x_att => l_att
14648: , x_atr => l_atr
14649: );
14650:
14651: IF l_return_status = fnd_api.g_ret_sts_error THEN
14652: IF (l_debug = 1) THEN
14653: inv_log_util.trace('Expected Error while querying tree : ' || l_msg_data,'INV_TXN_MANAGER_GRP', 9);
14654: END IF;
14655:
14688: l_current_err_batch_id := l_Line_rec_Type.transaction_batch_id;--Bug#5075521
14689:
14690: END IF ;
14691:
14692: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
14693: IF (l_debug = 1) THEN
14694: inv_log_util.trace('UnExpected Error while querying tree : ' || l_msg_data,'INV_TXN_MANAGER_GRP', 9);
14695: END IF;
14696:
14834:
14835: IF (NOT l_current_batch_failed ) THEN --200
14836: INV_QUANTITY_TREE_PVT.query_tree
14837: ( p_api_version_number => 1.0
14838: , p_init_msg_lst => fnd_api.g_false
14839: , x_return_status => l_return_status
14840: , x_msg_count => l_msg_count
14841: , x_msg_data => l_msg_data
14842: , p_tree_id => l_tree_id
14852: , x_att => l_item_att
14853: , x_atr => l_item_atr
14854: );
14855:
14856: IF l_return_status = fnd_api.g_ret_sts_error THEN
14857: IF (l_debug = 1) THEN
14858: inv_log_util.trace('Expected Error while querying tree : ' || l_msg_data,'INV_TXN_MANAGER_GRP', 9);
14859: END IF;
14860:
14892: l_current_batch_failed := TRUE;--Bug#5075521
14893: l_current_err_batch_id := l_Line_rec_Type.transaction_batch_id;--Bug#5075521
14894: END IF ;
14895:
14896: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
14897: IF (l_debug = 1) THEN
14898: inv_log_util.trace('UnExpected Error while querying tree : ' || l_msg_data,'INV_TXN_MANAGER_GRP', 9);
14899: END IF;
14900:
15039: IF ( NOT l_current_batch_failed ) THEN --300
15040: IF (l_actid in (2,28)) then
15041: inv_quantity_tree_pub.update_quantities
15042: (p_api_version_number => 1.0,
15043: p_init_msg_lst => fnd_api.g_false,
15044: x_return_status => l_return_status,
15045: x_msg_count => l_msg_count,
15046: x_msg_data => l_msg_data,
15047: p_organization_id => l_org_id,
15067: x_att => l_att,
15068: x_atr => l_atr);
15069:
15070:
15071: IF l_return_status <> fnd_api.g_ret_sts_success THEN
15072: FND_MESSAGE.set_name('INV', 'INV_ERR_CREATETREE');
15073: FND_MESSAGE.set_token('ROUTINE','INV_QUANTITY_TREE_PUB.UPDATE_QUANTITIES');
15074: l_error_code:= fnd_message.get;
15075: l_error_exp :=l_msg_data;
15109: sign is derived from transaction_quantity */
15110:
15111: inv_quantity_tree_pub.update_quantities
15112: (p_api_version_number => 1.0,
15113: p_init_msg_lst => fnd_api.g_false,
15114: x_return_status => l_return_status,
15115: x_msg_count => l_msg_count,
15116: x_msg_data => l_msg_data,
15117: p_organization_id => l_org_id,
15136: x_qs => l_qs,
15137: x_att => l_att,
15138: x_atr => l_atr);
15139:
15140: IF l_return_status <> fnd_api.g_ret_sts_success THEN
15141: FND_MESSAGE.set_name('INV', 'INV_ERR_CREATETREE');
15142: FND_MESSAGE.set_token('ROUTINE','INV_QUANTITY_TREE_PUB.UPDATE_QUANTITIES');
15143: l_error_code:= fnd_message.get;
15144: l_error_exp :=l_msg_data;
15191:
15192: --free all trees created so far.
15193: /* INV_QUANTITY_TREE_PVT.free_All
15194: ( p_api_version_number => 1.0
15195: , p_init_msg_lst => fnd_api.g_false
15196: , x_return_status => l_return_status
15197: , x_msg_count => l_msg_count
15198: , x_msg_data => l_msg_data); */
15199:
15200: --Jalaj Srivastava Bug 4672291
15201: --Call free_tree only when l_tree_id is not null
15202: --Jalaj Srivastava Bug 5155661
15203: --free the tree only if p_free_tree is true
15204: IF (p_free_tree = fnd_api.G_TRUE)
15205: AND (l_tree_id IS NOT NULL) THEN
15206: INV_QUANTITY_TREE_PVT.free_tree
15207: ( p_api_version_number => 1.0
15208: , p_init_msg_lst => fnd_api.g_false
15204: IF (p_free_tree = fnd_api.G_TRUE)
15205: AND (l_tree_id IS NOT NULL) THEN
15206: INV_QUANTITY_TREE_PVT.free_tree
15207: ( p_api_version_number => 1.0
15208: , p_init_msg_lst => fnd_api.g_false
15209: , x_return_status => l_return_status
15210: , x_msg_count => l_msg_count
15211: , x_msg_data => l_msg_data
15212: , p_tree_id => l_tree_id );
15312:
15313:
15314: FUNCTION Validate_Additional_Attr(
15315: p_api_version IN NUMBER
15316: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
15317: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
15318: , p_intid IN NUMBER
15319: , p_rowid IN VARCHAR2
15320: , p_inventory_item_id IN NUMBER
15313:
15314: FUNCTION Validate_Additional_Attr(
15315: p_api_version IN NUMBER
15316: , p_init_msg_list IN VARCHAR2 := fnd_api.g_false
15317: , p_validation_level IN NUMBER := fnd_api.g_valid_level_full
15318: , p_intid IN NUMBER
15319: , p_rowid IN VARCHAR2
15320: , p_inventory_item_id IN NUMBER
15321: , p_organization_id IN NUMBER
15467: IF (l_debug = 1) THEN
15468: inv_log_util.trace('Error from get_origination_date', 'INV_TXN_MANAGER_GRP', 9);
15469: END IF;
15470: CLOSE c_get_lot_record;
15471: RAISE FND_API.G_EXC_ERROR;
15472: END IF;
15473: -- dbms_output.put_line('Existing Lot Child ');
15474: IF (l_orig_date IS NULL AND p_expiration_date IS NULL) THEN
15475: IF (l_debug = 1) THEN
15583: , x_return_status => l_return_status
15584: , x_msg_count => l_msg_count
15585: , x_msg_data => l_msg_data);
15586:
15587: IF l_return_status <> fnd_api.g_ret_sts_success
15588: THEN
15589: l_error_code := l_msg_data;
15590: l_error_exp := l_msg_data;
15591: RAISE FND_API.G_EXC_ERROR;
15587: IF l_return_status <> fnd_api.g_ret_sts_success
15588: THEN
15589: l_error_code := l_msg_data;
15590: l_error_exp := l_msg_data;
15591: RAISE FND_API.G_EXC_ERROR;
15592: END IF;
15593:
15594: p_grade_code := l_lot_record.grade_code;
15595: p_retest_date := l_lot_record.retest_date;
15662: , x_msg_count => l_msg_count
15663: , x_msg_data => l_msg_data
15664: );
15665:
15666: IF l_return_status <> fnd_api.g_ret_sts_success THEN
15667: l_error_code := l_msg_data;
15668: l_error_exp := l_msg_data;
15669: RAISE FND_API.G_EXC_ERROR;
15670: END IF;
15665:
15666: IF l_return_status <> fnd_api.g_ret_sts_success THEN
15667: l_error_code := l_msg_data;
15668: l_error_exp := l_msg_data;
15669: RAISE FND_API.G_EXC_ERROR;
15670: END IF;
15671:
15672: p_grade_code := l_lot_record.grade_code;
15673: p_retest_date := l_lot_record.retest_date;
15694: , x_msg_count => l_msg_count
15695: , x_msg_data => l_msg_data
15696: );
15697:
15698: IF l_return_status <> fnd_api.g_ret_sts_success THEN
15699: l_error_code := l_msg_data;
15700: l_error_exp := l_msg_data;
15701: RAISE FND_API.G_EXC_ERROR;
15702: END IF;
15697:
15698: IF l_return_status <> fnd_api.g_ret_sts_success THEN
15699: l_error_code := l_msg_data;
15700: l_error_exp := l_msg_data;
15701: RAISE FND_API.G_EXC_ERROR;
15702: END IF;
15703:
15704: p_grade_code := l_lot_record.grade_code;
15705: p_retest_date := l_lot_record.retest_date;
15742: IF NOT(l_check)
15743: THEN
15744: l_error_code := l_msg_data;
15745: l_error_exp := l_msg_data;
15746: RAISE FND_API.G_EXC_ERROR;
15747:
15748: END IF;
15749:
15750: IF (l_debug = 1) THEN
15763: IF NOT(l_check)
15764: THEN
15765: l_error_code := l_msg_data;
15766: l_error_exp := l_msg_data;
15767: RAISE FND_API.G_EXC_ERROR;
15768: END IF;
15769:
15770: IF (l_debug = 1) THEN
15771: inv_log_util.trace('validate_grade_code pass', 'INV_TXN_MANAGER_GRP', 9);
15779: IF NOT(l_check)
15780: THEN
15781: l_error_code := l_msg_data;
15782: l_error_exp := l_msg_data;
15783: RAISE FND_API.G_EXC_ERROR;
15784: END IF;
15785: IF (l_debug = 1) THEN
15786: inv_log_util.trace('validate_origination_type pass', 'INV_TXN_MANAGER_GRP', 9);
15787: END IF;
15800: IF NOT(l_check)
15801: THEN
15802: l_error_code := l_msg_data;
15803: l_error_exp := l_msg_data;
15804: RAISE FND_API.G_EXC_ERROR;
15805: END IF;
15806: IF (l_debug = 1) THEN
15807: inv_log_util.trace('validate_exp_action_code pass', 'INV_TXN_MANAGER_GRP', 9);
15808: END IF;
15818: IF NOT(l_check)
15819: THEN
15820: l_error_code := l_msg_data;
15821: l_error_exp := l_msg_data;
15822: RAISE FND_API.G_EXC_ERROR;
15823: END IF;
15824: IF (l_debug = 1) THEN
15825: inv_log_util.trace('validate_retest_date pass', 'INV_TXN_MANAGER_GRP', 9);
15826: END IF;
15834: IF NOT(l_check)
15835: THEN
15836: l_error_code := l_msg_data;
15837: l_error_exp := l_msg_data;
15838: RAISE FND_API.G_EXC_ERROR;
15839:
15840: END IF;
15841: IF (l_debug = 1) THEN
15842: inv_log_util.trace('validate_exp_action_date pass', 'INV_TXN_MANAGER_GRP', 9);
15852: IF NOT(l_check)
15853: THEN
15854: l_error_code := l_msg_data;
15855: l_error_exp := l_msg_data;
15856: RAISE FND_API.G_EXC_ERROR;
15857: END IF;
15858: IF (l_debug = 1) THEN
15859: inv_log_util.trace('validate_maturity_date pass', 'INV_TXN_MANAGER_GRP', 9);
15860: END IF;
15868: IF NOT(l_check)
15869: THEN
15870: l_error_code := l_msg_data;
15871: l_error_exp := l_msg_data;
15872: RAISE FND_API.G_EXC_ERROR;
15873: END IF;
15874: IF (l_debug = 1) THEN
15875: inv_log_util.trace('validate_hold_date pass', 'INV_TXN_MANAGER_GRP', 9);
15876: END IF;
15884: IF NOT(l_check)
15885: THEN
15886: l_error_code := l_msg_data;
15887: l_error_exp := l_msg_data;
15888: RAISE FND_API.G_EXC_ERROR;
15889: END IF;
15890: IF (l_debug = 1) THEN
15891: inv_log_util.trace('validate_reason_code pass', 'INV_TXN_MANAGER_GRP', 9);
15892: END IF;
15943: );
15944: IF l_return_status <> 'S' THEN
15945: l_error_code := l_msg_data;
15946: l_error_exp := l_msg_data;
15947: RAISE FND_API.G_EXC_ERROR;
15948: END IF;
15949:
15950: END IF;
15951:
15951:
15952: return true;
15953: /******************* END Perform Date validation logic ********************/
15954: EXCEPTION
15955: WHEN FND_API.G_EXC_ERROR THEN
15956: x_return_status := FND_API.G_RET_STS_ERROR;
15957: UPDATE MTL_TRANSACTION_LOTS_INTERFACE MTLI
15958: SET LAST_UPDATE_DATE = SYSDATE,
15959: LAST_UPDATED_BY = l_userid,
15952: return true;
15953: /******************* END Perform Date validation logic ********************/
15954: EXCEPTION
15955: WHEN FND_API.G_EXC_ERROR THEN
15956: x_return_status := FND_API.G_RET_STS_ERROR;
15957: UPDATE MTL_TRANSACTION_LOTS_INTERFACE MTLI
15958: SET LAST_UPDATE_DATE = SYSDATE,
15959: LAST_UPDATED_BY = l_userid,
15960: LAST_UPDATE_LOGIN = l_loginid,
15973: IF (l_debug = 1) THEN
15974: inv_log_util.trace('Validate_Additional_Attr: error NO_DATA_FOUND' , 'INV_TXN_MANAGER_GRP', 9);
15975: END IF;
15976:
15977: x_return_status := fnd_api.g_ret_sts_error;
15978:
15979: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
15980: p_count => x_msg_count,
15981: p_data => x_msg_data);
15975: END IF;
15976:
15977: x_return_status := fnd_api.g_ret_sts_error;
15978:
15979: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
15980: p_count => x_msg_count,
15981: p_data => x_msg_data);
15982: if( x_msg_count > 1 ) then
15983: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
15979: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
15980: p_count => x_msg_count,
15981: p_data => x_msg_data);
15982: if( x_msg_count > 1 ) then
15983: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
15984: end if;
15985:
15986: l_error_code := x_msg_data;
15987: l_error_exp := x_msg_data;
16004: IF (l_debug = 1) THEN
16005: inv_log_util.trace('Validate_Additional_Attr: error OTHERS exception' , 'INV_TXN_MANAGER_GRP', 9);
16006: END IF;
16007:
16008: x_return_status := fnd_api.g_ret_sts_unexp_error;
16009:
16010: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
16011: p_count => x_msg_count,
16012: p_data => x_msg_data);
16006: END IF;
16007:
16008: x_return_status := fnd_api.g_ret_sts_unexp_error;
16009:
16010: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
16011: p_count => x_msg_count,
16012: p_data => x_msg_data);
16013: if( x_msg_count > 1 ) then
16014: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
16010: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
16011: p_count => x_msg_count,
16012: p_data => x_msg_data);
16013: if( x_msg_count > 1 ) then
16014: x_msg_data := fnd_msg_pub.get(x_msg_count, FND_API.G_FALSE);
16015: end if;
16016:
16017: l_error_code := x_msg_data;
16018: l_error_exp := x_msg_data;