83: , x_total_cost => x_item_cost /* total cost */
84: , x_no_of_rows => l_no_of_rows /* number of detail rows retrieved */
85: );
86:
87: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
88: x_item_cost := 0;
89: END IF;
90:
91: EXCEPTION
193:
194: IF (l_debug = 1) THEN
195: mdebug('Due date'||to_char(l_result_date));
196: END IF;
197: if (l_return_status <> fnd_api.g_ret_sts_success) then
198: IF (l_debug = 1) THEN
199: mdebug('error in due date computation');
200: END IF;
201: raise fnd_api.g_exc_unexpected_error;
197: if (l_return_status <> fnd_api.g_ret_sts_success) then
198: IF (l_debug = 1) THEN
199: mdebug('error in due date computation');
200: END IF;
201: raise fnd_api.g_exc_unexpected_error;
202: end if;
203:
204: return l_result_date;
205:
529: p_lot_expiration IN date ,
530: p_revision IN VARCHAR2 ,
531: p_transaction_reason_id IN NUMBER ,
532: p_transaction_process_mode IN NUMBER DEFAULT 3,
533: p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE)
534: IS
535: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
536: BEGIN
537: -- Start OF comments
566: -- default = 3 (Background processing) this parameter is not really used
567: -- since the only way the processing can be done now is in background mode
568: --
569: -- p_simulate IN VARCHAR2 (defaulted)
570: -- default = FND_API.G_FALSE may modify tables other than interface
571: -- FND_API.G_TRUE - may modify only interface tables
572: --
573: -- OUT :
574: -- Version: Current Version 0.9
567: -- since the only way the processing can be done now is in background mode
568: --
569: -- p_simulate IN VARCHAR2 (defaulted)
570: -- default = FND_API.G_FALSE may modify tables other than interface
571: -- FND_API.G_TRUE - may modify only interface tables
572: --
573: -- OUT :
574: -- Version: Current Version 0.9
575: -- Changed : Nothing
658: END IF;
659:
660: IF MTL_CCEOI_VAR_PVT.G_CC_ENTRY_REC_TMP.entry_status_code = 5
661: AND MTL_CCEOI_VAR_PVT.G_ADJUSTMENT_QUANTITY <> 0
662: AND NOT FND_API.to_Boolean(p_simulate)
663: THEN
664: --
665: IF (l_debug = 1) THEN
666: MDEBUG( 'F-P-U-Inside the If value ');
770:
771: IF ( l_txn_return_status <> 0 ) THEN
772: -- This 'Transaction Failed' message is set on the java side
773:
774: RAISE FND_API.G_EXC_ERROR;
775: mdebug ( 'Txn failed');
776: END IF;
777:
778: -- 8712932 End
814: p_revision VARCHAR2 ,
815: p_transaction_reason_id NUMBER ,
816: p_serial_number VARCHAR2 ,
817: p_transaction_process_mode NUMBER ,
818: p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE)
819: IS
820: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
821: BEGIN
822: -- Start OF comments
847: --
848: -- p_transaction_process_mode IN NUMBER (required-defaulted)
849: -- default = 3 (Background processing)
850: --
851: -- p_simulate in varchar2 (defaulted FND_API.G_FALSE)
852: -- G_FALSE - may modify data in tables other than ccoi interface
853: -- G_TRUE - may not modify data in tables othert than ccoi interface
854:
855: -- OUT :
909: p_revision VARCHAR2 ,
910: p_transaction_reason_id NUMBER ,
911: p_serial_number VARCHAR2 ,
912: p_transaction_process_mode NUMBER ,
913: p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE)
914: IS
915: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
916: BEGIN
917: -- Start OF comments
942: --
943: -- p_transaction_process_mode IN NUMBER (required-defaulted)
944: -- default = 3 (Background processing)
945: --
946: -- p_simulate in varchar2 (defaulted FND_API.G_FALSE)
947: -- G_FALSE - may modify data in tables other than cc interface
948: -- G_TRUE - may not modify data in tables other than cc interface
949: -- OUT :
950: -- Version: Current Version 0.9
1018: p_adjustment_quantity IN NUMBER ,
1019: p_system_quantity IN NUMBER ,
1020: p_approval_option_code IN NUMBER ,
1021: p_interface_rec IN MTL_CCEOI_VAR_PVT.INV_CCEOI_TYPE ,
1022: p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE)
1023: IS
1024: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
1025: BEGIN
1026: -- Start OF comments
1066: --
1067: -- p_interface_rec IN MTL_CC_ENTRIES_INTERFACE%rowtype
1068: --
1069: -- p_simulate IN varchar2 (default)
1070: -- default = FND_API.G_FALSE - may modify data in other tables
1071: -- FND_API.G_TRUE modify data only in the interface tables
1072: --
1073: -- OUT :
1074: -- Version: Current Version 0.9
1067: -- p_interface_rec IN MTL_CC_ENTRIES_INTERFACE%rowtype
1068: --
1069: -- p_simulate IN varchar2 (default)
1070: -- default = FND_API.G_FALSE - may modify data in other tables
1071: -- FND_API.G_TRUE modify data only in the interface tables
1072: --
1073: -- OUT :
1074: -- Version: Current Version 0.9
1075: -- Changed : Nothing
1668: --
1669: -- Calculates adjustments for Step 4
1670: PROCEDURE Calculate_Adjustment(
1671: p_api_version IN NUMBER ,
1672: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
1673: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
1674: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
1675: x_return_status OUT NOCOPY VARCHAR2 ,
1676: x_msg_count OUT NOCOPY NUMBER ,
1669: -- Calculates adjustments for Step 4
1670: PROCEDURE Calculate_Adjustment(
1671: p_api_version IN NUMBER ,
1672: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
1673: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
1674: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
1675: x_return_status OUT NOCOPY VARCHAR2 ,
1676: x_msg_count OUT NOCOPY NUMBER ,
1677: x_msg_data OUT NOCOPY VARCHAR2 ,
1670: PROCEDURE Calculate_Adjustment(
1671: p_api_version IN NUMBER ,
1672: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
1673: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
1674: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
1675: x_return_status OUT NOCOPY VARCHAR2 ,
1676: x_msg_count OUT NOCOPY NUMBER ,
1677: x_msg_data OUT NOCOPY VARCHAR2 ,
1678: x_errorcode OUT NOCOPY NUMBER ,
1713: -- p_api_version IN NUMBER (required)
1714: -- API Version of this procedure
1715: --
1716: -- p_init_msg_list IN VARCHAR2 (optional)
1717: -- DEFAULT = FND_API.G_FALSE,
1718: --
1719: -- p_commit IN VARCHAR2 (optional)
1720: -- DEFAULT = FND_API.G_FALSE
1721: --
1716: -- p_init_msg_list IN VARCHAR2 (optional)
1717: -- DEFAULT = FND_API.G_FALSE,
1718: --
1719: -- p_commit IN VARCHAR2 (optional)
1720: -- DEFAULT = FND_API.G_FALSE
1721: --
1722: -- p_validation_level IN NUMBER (optional)
1723: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
1724: --
1719: -- p_commit IN VARCHAR2 (optional)
1720: -- DEFAULT = FND_API.G_FALSE
1721: --
1722: -- p_validation_level IN NUMBER (optional)
1723: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
1724: --
1725: -- p_inventory_item_id IN NUMBER (required)
1726: -- ID OF the inventory item
1727: --
1793: -- Standard start of API savepoint
1794: SAVEPOINT Calculate_Adjustment;
1795: --
1796: -- Standard Call to check for call compatibility
1797: IF NOT FND_API.Compatible_API_Call(l_api_version
1798: , p_api_version
1799: , l_api_name
1800: , G_PKG_NAME) THEN
1801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1797: IF NOT FND_API.Compatible_API_Call(l_api_version
1798: , p_api_version
1799: , l_api_name
1800: , G_PKG_NAME) THEN
1801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1802: END IF;
1803: --
1804: -- Initialize message list if p_init_msg_list is set to true
1805: IF FND_API.to_Boolean(p_init_msg_list) THEN
1801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1802: END IF;
1803: --
1804: -- Initialize message list if p_init_msg_list is set to true
1805: IF FND_API.to_Boolean(p_init_msg_list) THEN
1806: FND_MSG_PUB.initialize;
1807: END IF;
1808: --
1809: -- Initialisize API return status to access
1806: FND_MSG_PUB.initialize;
1807: END IF;
1808: --
1809: -- Initialisize API return status to access
1810: x_return_status := FND_API.G_RET_STS_SUCCESS;
1811: x_errorcode := 0;
1812: MTL_CCEOI_VAR_PVT.G_SYSTEM_QUANTITY := 0;
1813: MTL_CCEOI_VAR_PVT.G_SECONDARY_SYSTEM_QUANTITY := 0; -- INVCONV
1814: --
1875: -- Looking for a quanitity for an item withing a specific container.
1876: MTL_INV_UTIL_GRP.Get_LPN_Item_SysQty
1877: (
1878: p_api_version => 0.9
1879: , p_init_msg_lst => fnd_api.g_true
1880: , p_commit => fnd_api.g_true
1881: , x_return_status => x_return_status
1882: , x_msg_count => x_msg_count
1883: , x_msg_data => x_msg_data
1876: MTL_INV_UTIL_GRP.Get_LPN_Item_SysQty
1877: (
1878: p_api_version => 0.9
1879: , p_init_msg_lst => fnd_api.g_true
1880: , p_commit => fnd_api.g_true
1881: , x_return_status => x_return_status
1882: , x_msg_count => x_msg_count
1883: , x_msg_data => x_msg_data
1884: , p_organization_id => p_organization_id
2105: --
2106: x_errorcode := 17;
2107: FND_MESSAGE.SET_NAME('INV', 'INV_CCEOI_ADJCALC_NO_SERIAL');
2108: FND_MSG_PUB.Add;
2109: RAISE FND_API.G_EXC_ERROR;
2110: --
2111: END IF;
2112: */
2113: --
2113: --
2114: --
2115: -- END of API body
2116: -- Standard check of p_commit
2117: IF FND_API.to_Boolean(p_commit) THEN
2118: COMMIT;
2119: END IF;
2120: -- Standard call to get message count and if count is 1, get message info
2121: FND_MSG_PUB.Count_And_Get
2121: FND_MSG_PUB.Count_And_Get
2122: (p_count => x_msg_count
2123: , p_data => x_msg_data);
2124: EXCEPTION
2125: WHEN FND_API.G_EXC_ERROR THEN
2126: --
2127: ROLLBACK TO Calculate_Adjustment;
2128: --
2129: x_return_status := FND_API.G_RET_STS_ERROR;
2125: WHEN FND_API.G_EXC_ERROR THEN
2126: --
2127: ROLLBACK TO Calculate_Adjustment;
2128: --
2129: x_return_status := FND_API.G_RET_STS_ERROR;
2130: --
2131: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
2132: , p_data => x_msg_data);
2133: --
2130: --
2131: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
2132: , p_data => x_msg_data);
2133: --
2134: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2135: --
2136: ROLLBACK TO Calculate_Adjustment;
2137: --
2138: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2134: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2135: --
2136: ROLLBACK TO Calculate_Adjustment;
2137: --
2138: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2139: --
2140: x_errorcode := -1;
2141: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
2142: , p_data => x_msg_data);
2145: --
2146: ROLLBACK TO Calculate_Adjustment;
2147: --
2148: x_errorcode := -1;
2149: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2150: --
2151: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2152: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2153: END IF;
2169: p_head_app_tol_neg IN NUMBER ,
2170: p_head_cost_tol_pos IN NUMBER ,
2171: p_head_cost_tol_neg IN NUMBER ,
2172: p_interface_rec IN MTL_CCEOI_VAR_PVT.INV_CCEOI_TYPE ,
2173: p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE)
2174: IS
2175: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
2176: BEGIN
2177: -- Start OF comments
2216: --
2217: -- p_head_cost_tol_neg IN NUMBER (required)
2218: -- MTL_CYCLE_COUNT_HEADERS.COST_TOLERANCE_NEGATIVE
2219: --
2220: -- p_simulate NUMBER (default = FND_API.G_FALSE)
2221: -- G_FALSE = allow changes to tables other than interface tables
2222: -- G_TRUE = no changes will be made to any outside tables
2223: -- OUT :
2224: --
2681: IF (l_debug = 1) THEN
2682: MDEBUG( 'Exception Error while Inserting..');
2683: MDEBUG( 'Error: ' || sqlerrm);
2684: END IF;
2685: raise fnd_api.g_exc_unexpected_error;
2686: END;
2687: END;
2688: --
2689: -- Insert the given record into MTL_CC_ENTRIES_INTERFACE
2713: IF (l_debug = 1) THEN
2714: MDEBUG( 'Insert_CCIEntry: Before creation of new seq id');
2715: END IF;
2716:
2717: X_return_status := FND_API.G_RET_STS_SUCCESS;
2718: --
2719:
2720: IF p_interface_rec.cc_entry_interface_id IS NULL THEN
2721: BEGIN
2729: WHEN OTHERS THEN
2730: IF (l_debug = 1) THEN
2731: mdebug('id creation failed failed');
2732: END IF;
2733: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2734: END;
2735: END IF;
2736: --
2737: BEGIN
3034: MTL_CCEOI_VAR_PVT.G_REC_IN_SYSTEM := TRUE;
3035: EXCEPTION
3036: WHEN OTHERS THEN
3037: if p_interface_rec.organization_id is null then
3038: x_return_status := fnd_api.g_ret_sts_error;
3039: else
3040: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3041: end if;
3042: IF (l_debug = 1) THEN
3036: WHEN OTHERS THEN
3037: if p_interface_rec.organization_id is null then
3038: x_return_status := fnd_api.g_ret_sts_error;
3039: else
3040: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3041: end if;
3042: IF (l_debug = 1) THEN
3043: mdebug('Insert_CCIEntry: ' || sqlerrm);
3044: END IF;
3146: p_lot_expiration IN date ,
3147: p_revision IN VARCHAR2 ,
3148: p_transaction_reason_id IN NUMBER ,
3149: p_transaction_process_mode IN NUMBER DEFAULT 3,
3150: p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE)
3151: IS
3152: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
3153: BEGIN
3154: -- Start OF comments
3180: -- p_transaction_process_mode IN NUMBER (required-defaulted)
3181: -- default = 3 (Background processing)
3182: --
3183: -- p_simulate IN VARCHAR2 (defaulted)
3184: -- default = FND_API.G_FALSE - may update data in any tables
3185: -- FND_API.G_TRUE - may only update data in the interface tables
3186: -- OUT :
3187: -- Version: Current Version 0.9
3188: -- Changed : Nothing
3181: -- default = 3 (Background processing)
3182: --
3183: -- p_simulate IN VARCHAR2 (defaulted)
3184: -- default = FND_API.G_FALSE - may update data in any tables
3185: -- FND_API.G_TRUE - may only update data in the interface tables
3186: -- OUT :
3187: -- Version: Current Version 0.9
3188: -- Changed : Nothing
3189: -- No Previous Version 0.0
3293: --
3294: -- Set the export flag in the table MTL_CYCLE_COUNT_ENTRIES
3295: PROCEDURE Set_CCExport(
3296: p_api_version IN NUMBER ,
3297: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3298: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3299: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3300: x_return_status OUT NOCOPY VARCHAR2 ,
3301: x_msg_count OUT NOCOPY NUMBER ,
3294: -- Set the export flag in the table MTL_CYCLE_COUNT_ENTRIES
3295: PROCEDURE Set_CCExport(
3296: p_api_version IN NUMBER ,
3297: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3298: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3299: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3300: x_return_status OUT NOCOPY VARCHAR2 ,
3301: x_msg_count OUT NOCOPY NUMBER ,
3302: x_msg_data OUT NOCOPY VARCHAR2 ,
3295: PROCEDURE Set_CCExport(
3296: p_api_version IN NUMBER ,
3297: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3298: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3299: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3300: x_return_status OUT NOCOPY VARCHAR2 ,
3301: x_msg_count OUT NOCOPY NUMBER ,
3302: x_msg_data OUT NOCOPY VARCHAR2 ,
3303: p_cycle_count_entry_id IN NUMBER ,
3316: -- p_api_version IN NUMBER (required)
3317: -- API Version of this procedure
3318: --
3319: -- p_init_msg_list IN VARCHAR2 (optional)
3320: -- DEFAULT = FND_API.G_FALSE,
3321: --
3322: -- p_commit IN VARCHAR2 (optional)
3323: -- DEFAULT = FND_API.G_FALSE,
3324: --
3319: -- p_init_msg_list IN VARCHAR2 (optional)
3320: -- DEFAULT = FND_API.G_FALSE,
3321: --
3322: -- p_commit IN VARCHAR2 (optional)
3323: -- DEFAULT = FND_API.G_FALSE,
3324: --
3325: -- p_validation_level IN NUMBER (optional)
3326: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
3327: --
3322: -- p_commit IN VARCHAR2 (optional)
3323: -- DEFAULT = FND_API.G_FALSE,
3324: --
3325: -- p_validation_level IN NUMBER (optional)
3326: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
3327: --
3328: -- p_cycle_count_entry_id IN NUMBER (required)
3329: -- cycle COUNT entry id
3330: --
3355: -- Standard Call to check for call compatibility
3356: IF (l_debug = 1) THEN
3357: MDEBUG( 'SetCCExport : Before API');
3358: END IF;
3359: IF NOT FND_API.Compatible_API_Call(
3360: l_api_version, p_api_version
3361: , l_api_name
3362: , G_PKG_NAME) THEN
3363: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3359: IF NOT FND_API.Compatible_API_Call(
3360: l_api_version, p_api_version
3361: , l_api_name
3362: , G_PKG_NAME) THEN
3363: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3364: END IF;
3365: IF (l_debug = 1) THEN
3366: MDEBUG( 'SetCCExport : After API');
3367: END IF;
3366: MDEBUG( 'SetCCExport : After API');
3367: END IF;
3368: --
3369: -- Initialize message list if p_init_msg_list is set to true
3370: IF FND_API.to_Boolean(p_init_msg_list) THEN
3371: FND_MSG_PUB.initialize;
3372: END IF;
3373: --
3374: IF (l_debug = 1) THEN
3374: IF (l_debug = 1) THEN
3375: MDEBUG( 'SetCCExport : After Init');
3376: END IF;
3377: -- Initialisize API return status to access
3378: x_return_status := FND_API.G_RET_STS_SUCCESS;
3379: --
3380: -- API body
3381: --
3382: IF (l_debug = 1) THEN
3407: MDEBUG( 'SetCCExport : Error Update');
3408: END IF;
3409: FND_MESSAGE.SET_NAME('INV', 'INV_CCEOI_COULD_NOT_LOCK');
3410: FND_MSG_PUB.Add;
3411: RAISE FND_API.G_EXC_ERROR;
3412: END IF;
3413: --
3414: -- END of API body
3415: -- Standard check of p_commit
3412: END IF;
3413: --
3414: -- END of API body
3415: -- Standard check of p_commit
3416: IF FND_API.to_Boolean(p_commit) THEN
3417: COMMIT;
3418: END IF;
3419: -- --
3420: -- Standard call to get message count and if count is 1, get message info
3421: FND_MSG_PUB.Count_And_Get
3422: (p_count => x_msg_count
3423: , p_data => x_msg_data);
3424: EXCEPTION
3425: WHEN FND_API.G_EXC_ERROR THEN
3426: --
3427: ROLLBACK TO Set_CCExport;
3428: --
3429: x_return_status := FND_API.G_RET_STS_ERROR;
3425: WHEN FND_API.G_EXC_ERROR THEN
3426: --
3427: ROLLBACK TO Set_CCExport;
3428: --
3429: x_return_status := FND_API.G_RET_STS_ERROR;
3430: --
3431: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3432: , p_data => x_msg_data);
3433: --
3430: --
3431: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3432: , p_data => x_msg_data);
3433: --
3434: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3435: --
3436: ROLLBACK TO Set_CCExport;
3437: --
3438: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3434: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3435: --
3436: ROLLBACK TO Set_CCExport;
3437: --
3438: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3439: --
3440: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3441: , p_data => x_msg_data);
3442: --
3443: WHEN OTHERS THEN
3444: --
3445: ROLLBACK TO Set_CCExport;
3446: --
3447: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3448: --
3449: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3450: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
3451: END IF;
3457: --
3458: -- Set the Flags in the interface table.
3459: PROCEDURE Set_CCEOIFlags(
3460: p_api_version IN NUMBER ,
3461: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3462: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3463: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3464: x_return_status OUT NOCOPY VARCHAR2 ,
3465: x_msg_count OUT NOCOPY NUMBER ,
3458: -- Set the Flags in the interface table.
3459: PROCEDURE Set_CCEOIFlags(
3460: p_api_version IN NUMBER ,
3461: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3462: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3463: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3464: x_return_status OUT NOCOPY VARCHAR2 ,
3465: x_msg_count OUT NOCOPY NUMBER ,
3466: x_msg_data OUT NOCOPY VARCHAR2 ,
3459: PROCEDURE Set_CCEOIFlags(
3460: p_api_version IN NUMBER ,
3461: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3462: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3463: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3464: x_return_status OUT NOCOPY VARCHAR2 ,
3465: x_msg_count OUT NOCOPY NUMBER ,
3466: x_msg_data OUT NOCOPY VARCHAR2 ,
3467: p_cc_entry_interface_id IN NUMBER ,
3481: -- p_api_version IN NUMBER (required)
3482: -- API Version of this procedure
3483: --
3484: -- p_init_msg_list IN VARCHAR2 (optional)
3485: -- DEFAULT = FND_API.G_FALSE,
3486: --
3487: -- p_commit IN VARCHAR2 (optional)
3488: -- DEFAULT = FND_API.G_FALSE,
3489: --
3484: -- p_init_msg_list IN VARCHAR2 (optional)
3485: -- DEFAULT = FND_API.G_FALSE,
3486: --
3487: -- p_commit IN VARCHAR2 (optional)
3488: -- DEFAULT = FND_API.G_FALSE,
3489: --
3490: -- p_validation_level IN NUMBER (optional)
3491: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
3492: --
3487: -- p_commit IN VARCHAR2 (optional)
3488: -- DEFAULT = FND_API.G_FALSE,
3489: --
3490: -- p_validation_level IN NUMBER (optional)
3491: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
3492: --
3493: -- p_cc_entry_interface_id IN NUMBER (required)
3494: -- cycle COUNT entry interface id
3495: --
3526: -- Standard start of API savepoint
3527: SAVEPOINT SET_CCEOIVALID;
3528: --
3529: -- Standard Call to check for call compatibility
3530: IF NOT FND_API.Compatible_API_Call(
3531: l_api_version, p_api_version
3532: , l_api_name
3533: , G_PKG_NAME) THEN
3534: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3530: IF NOT FND_API.Compatible_API_Call(
3531: l_api_version, p_api_version
3532: , l_api_name
3533: , G_PKG_NAME) THEN
3534: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3535: END IF;
3536:
3537: --
3538: -- Initialize message list if p_init_msg_list is set to true
3535: END IF;
3536:
3537: --
3538: -- Initialize message list if p_init_msg_list is set to true
3539: IF FND_API.to_Boolean(p_init_msg_list) THEN
3540: FND_MSG_PUB.initialize;
3541: END IF;
3542:
3543: --
3541: END IF;
3542:
3543: --
3544: -- Initialisize API return status to access
3545: x_return_status := FND_API.G_RET_STS_SUCCESS;
3546: --
3547: -- API body
3548: --
3549: -- UPDATE the flags according to the parameter
3575: --
3576: IF SQL%ROWCOUNT <> 1 THEN
3577: FND_MESSAGE.SET_NAME('INV', 'INV_CCEOI_COULD_NOT_LOCK');
3578: FND_MSG_PUB.Add;
3579: RAISE FND_API.G_EXC_ERROR;
3580: END IF;
3581: --
3582: -- END of API body
3583: -- Standard check of p_commit
3580: END IF;
3581: --
3582: -- END of API body
3583: -- Standard check of p_commit
3584: IF FND_API.to_Boolean(p_commit) THEN
3585: COMMIT;
3586: END IF;
3587: -- --
3588: -- Standard call to get message count and if count is 1, get message info
3589: FND_MSG_PUB.Count_And_Get
3590: (p_count => x_msg_count
3591: , p_data => x_msg_data);
3592: EXCEPTION
3593: WHEN FND_API.G_EXC_ERROR THEN
3594: --
3595: IF (l_debug = 1) THEN
3596: mdebug('Error in Set_CCEOIFlags');
3597: END IF;
3596: mdebug('Error in Set_CCEOIFlags');
3597: END IF;
3598: ROLLBACK TO Set_CCEOIValid;
3599: --
3600: x_return_status := FND_API.G_RET_STS_ERROR;
3601: --
3602: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3603: , p_data => x_msg_data);
3604: --
3601: --
3602: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3603: , p_data => x_msg_data);
3604: --
3605: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3606: --
3607: IF (l_debug = 1) THEN
3608: mdebug('Unexpected Error in Set_CCEOIFlags');
3609: END IF;
3608: mdebug('Unexpected Error in Set_CCEOIFlags');
3609: END IF;
3610: ROLLBACK TO Set_CCEOIValid;
3611: --
3612: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3613: --
3614: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3615: , p_data => x_msg_data);
3616: --
3623: IF (l_debug = 1) THEN
3624: mdebug('After Rollback for Other Error in Set_CCEOIFlags');
3625: END IF;
3626: --
3627: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3628: --
3629: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3630: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
3631: END IF;
3637: --
3638: -- Validates the cycle count header
3639: PROCEDURE Validate_CHeader(
3640: p_api_version IN NUMBER ,
3641: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3642: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3643: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3644: x_return_status OUT NOCOPY VARCHAR2 ,
3645: x_msg_count OUT NOCOPY NUMBER ,
3638: -- Validates the cycle count header
3639: PROCEDURE Validate_CHeader(
3640: p_api_version IN NUMBER ,
3641: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3642: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3643: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3644: x_return_status OUT NOCOPY VARCHAR2 ,
3645: x_msg_count OUT NOCOPY NUMBER ,
3646: x_msg_data OUT NOCOPY VARCHAR2 ,
3639: PROCEDURE Validate_CHeader(
3640: p_api_version IN NUMBER ,
3641: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3642: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3643: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3644: x_return_status OUT NOCOPY VARCHAR2 ,
3645: x_msg_count OUT NOCOPY NUMBER ,
3646: x_msg_data OUT NOCOPY VARCHAR2 ,
3647: x_errorcode OUT NOCOPY NUMBER ,
3661: -- p_api_version IN NUMBER (required)
3662: -- API Version of this procedure
3663: --
3664: -- p_init_msg_list IN VARCHAR2 (optional)
3665: -- DEFAULT = FND_API.G_FALSE,
3666: --
3667: -- p_commit IN VARCHAR2 (optional)
3668: -- DEFAULT = FND_API.G_FALSE
3669: --
3664: -- p_init_msg_list IN VARCHAR2 (optional)
3665: -- DEFAULT = FND_API.G_FALSE,
3666: --
3667: -- p_commit IN VARCHAR2 (optional)
3668: -- DEFAULT = FND_API.G_FALSE
3669: --
3670: -- p_validation_level IN NUMBER (optional)
3671: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
3672: --
3667: -- p_commit IN VARCHAR2 (optional)
3668: -- DEFAULT = FND_API.G_FALSE
3669: --
3670: -- p_validation_level IN NUMBER (optional)
3671: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
3672: --
3673: -- p_cycle_count_header_id IN NUMBER default NULL (required - defaulted NULL)
3674: -- Cycle COUNT header ID
3675: --
3700: -- Standard start of API savepoint
3701: SAVEPOINT Validate_CHeader;
3702: --
3703: -- Standard Call to check for call compatibility
3704: IF NOT FND_API.Compatible_API_Call(l_api_version
3705: , p_api_version
3706: , l_api_name
3707: , G_PKG_NAME) THEN
3708: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3704: IF NOT FND_API.Compatible_API_Call(l_api_version
3705: , p_api_version
3706: , l_api_name
3707: , G_PKG_NAME) THEN
3708: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3709: END IF;
3710: --
3711: -- Initialize message list if p_init_msg_list is set to true
3712: IF FND_API.to_Boolean(p_init_msg_list) THEN
3708: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3709: END IF;
3710: --
3711: -- Initialize message list if p_init_msg_list is set to true
3712: IF FND_API.to_Boolean(p_init_msg_list) THEN
3713: FND_MSG_PUB.initialize;
3714: END IF;
3715: --
3716: -- Initialisize API return status to access
3713: FND_MSG_PUB.initialize;
3714: END IF;
3715: --
3716: -- Initialisize API return status to access
3717: x_return_status := FND_API.G_RET_STS_SUCCESS;
3718: --
3719: -- API body
3720: IF (l_debug = 1) THEN
3721: mdebug('Process: In Validate_CHeader ' || to_char(p_cycle_count_header_id));
3775: END IF;
3776: --
3777: -- END of API body
3778: -- Standard check of p_commit
3779: IF FND_API.to_Boolean(p_commit) THEN
3780: COMMIT;
3781: END IF;
3782: -- Standard call to get message count and if count is 1, get message info
3783: FND_MSG_PUB.Count_And_Get
3783: FND_MSG_PUB.Count_And_Get
3784: (p_count => x_msg_count
3785: , p_data => x_msg_data);
3786: EXCEPTION
3787: WHEN FND_API.G_EXC_ERROR THEN
3788: --
3789: --
3790: x_return_status := FND_API.G_RET_STS_ERROR;
3791: --
3786: EXCEPTION
3787: WHEN FND_API.G_EXC_ERROR THEN
3788: --
3789: --
3790: x_return_status := FND_API.G_RET_STS_ERROR;
3791: --
3792: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3793: , p_data => x_msg_data);
3794: --
3791: --
3792: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3793: , p_data => x_msg_data);
3794: --
3795: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3796: --
3797: --
3798: x_errorcode := -1;
3799: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3795: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3796: --
3797: --
3798: x_errorcode := -1;
3799: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3800: --
3801: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3802: , p_data => x_msg_data);
3803: --
3804: WHEN OTHERS THEN
3805: --
3806: --
3807: x_errorcode := -1;
3808: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3809: --
3810: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3811: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
3812: END IF;
3818: --
3819: -- Validate the count list sequence of the cycle count entry
3820: PROCEDURE Validate_CountListSeq(
3821: p_api_version IN NUMBER ,
3822: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3823: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3824: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3825: x_return_status OUT NOCOPY VARCHAR2 ,
3826: x_msg_count OUT NOCOPY NUMBER ,
3819: -- Validate the count list sequence of the cycle count entry
3820: PROCEDURE Validate_CountListSeq(
3821: p_api_version IN NUMBER ,
3822: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3823: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3824: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3825: x_return_status OUT NOCOPY VARCHAR2 ,
3826: x_msg_count OUT NOCOPY NUMBER ,
3827: x_msg_data OUT NOCOPY VARCHAR2 ,
3820: PROCEDURE Validate_CountListSeq(
3821: p_api_version IN NUMBER ,
3822: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3823: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
3824: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
3825: x_return_status OUT NOCOPY VARCHAR2 ,
3826: x_msg_count OUT NOCOPY NUMBER ,
3827: x_msg_data OUT NOCOPY VARCHAR2 ,
3828: x_errorcode OUT NOCOPY NUMBER ,
3845: -- p_api_version IN NUMBER (required)
3846: -- API Version of this procedure
3847: --
3848: -- p_init_msg_list IN VARCHAR2 (optional)
3849: -- DEFAULT = FND_API.G_FALSE,
3850: --
3851: -- p_commit IN VARCHAR2 (optional)
3852: -- DEFAULT = FND_API.G_FALSE
3853: --
3848: -- p_init_msg_list IN VARCHAR2 (optional)
3849: -- DEFAULT = FND_API.G_FALSE,
3850: --
3851: -- p_commit IN VARCHAR2 (optional)
3852: -- DEFAULT = FND_API.G_FALSE
3853: --
3854: -- p_validation_level IN NUMBER (optional)
3855: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
3856: -- 0 = FOR Export validation
3851: -- p_commit IN VARCHAR2 (optional)
3852: -- DEFAULT = FND_API.G_FALSE
3853: --
3854: -- p_validation_level IN NUMBER (optional)
3855: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
3856: -- 0 = FOR Export validation
3857: --
3858: -- p_cycle_count_header_id IN NUMBER (required -)
3859: -- Cycle COUNT header ID
3886: -- Standard start of API savepoint
3887: SAVEPOINT Validate_CountListSeq;
3888: --
3889: -- Standard Call to check for call compatibility
3890: IF NOT FND_API.Compatible_API_Call(l_api_version
3891: , p_api_version
3892: , l_api_name
3893: , G_PKG_NAME) THEN
3894: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3890: IF NOT FND_API.Compatible_API_Call(l_api_version
3891: , p_api_version
3892: , l_api_name
3893: , G_PKG_NAME) THEN
3894: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3895: END IF;
3896: --
3897: -- Initialize message list if p_init_msg_list is set to true
3898: IF FND_API.to_Boolean(p_init_msg_list) THEN
3894: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3895: END IF;
3896: --
3897: -- Initialize message list if p_init_msg_list is set to true
3898: IF FND_API.to_Boolean(p_init_msg_list) THEN
3899: FND_MSG_PUB.initialize;
3900: END IF;
3901: --
3902: -- Initialisize API return status to access
3899: FND_MSG_PUB.initialize;
3900: END IF;
3901: --
3902: -- Initialisize API return status to access
3903: x_return_status := FND_API.G_RET_STS_SUCCESS;
3904: --
3905: -- API body
3906: --
3907: IF (l_debug = 1) THEN
3929: , p_error_column_name => 'CYCLE_COUNT_HEADER_ID'
3930: , p_error_table_name => 'MTL_CYCLE_COUNT_HEADERS'
3931: , p_message_name => 'INV_CCEOI_UNMATCH_LISTSEQ'
3932: );
3933: RAISE FND_API.G_EXC_ERROR;
3934: ELSIF x_errorcode in (65,66) THEN
3935: IF (l_debug = 1) THEN
3936: MDEBUG( 'Validate Seq for Unsch.'||to_char(x_errorcode));
3937: END IF;
3946: , p_error_column_name => 'CYCLE_COUNT_HEADER_ID'
3947: , p_error_table_name => 'MTL_CYCLE_COUNT_HEADERS'
3948: , p_message_name => 'INV_CCEOI_MULT_MATCH_REQ'
3949: );
3950: RAISE FND_API.G_EXC_ERROR;
3951: ELSIF
3952: x_errorcode = 0 THEN
3953: IF (l_debug = 1) THEN
3954: mdebug('Process: In Validate_CountListSequence Derive ItemSKU');
3960: --
3961: --
3962: -- END of API body
3963: -- Standard check of p_commit
3964: IF FND_API.to_Boolean(p_commit) THEN
3965: COMMIT;
3966: END IF;
3967: -- Standard call to get message count and if count is 1, get message info
3968: FND_MSG_PUB.Count_And_Get
3968: FND_MSG_PUB.Count_And_Get
3969: (p_count => x_msg_count
3970: , p_data => x_msg_data);
3971: EXCEPTION
3972: WHEN FND_API.G_EXC_ERROR THEN
3973: --
3974: --
3975: x_return_status := FND_API.G_RET_STS_ERROR;
3976: --
3971: EXCEPTION
3972: WHEN FND_API.G_EXC_ERROR THEN
3973: --
3974: --
3975: x_return_status := FND_API.G_RET_STS_ERROR;
3976: --
3977: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3978: , p_data => x_msg_data);
3979: --
3976: --
3977: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3978: , p_data => x_msg_data);
3979: --
3980: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3981: --
3982: --
3983: x_errorcode := -1;
3984: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3980: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3981: --
3982: --
3983: x_errorcode := -1;
3984: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3985: --
3986: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
3987: , p_data => x_msg_data);
3988: --
3989: WHEN OTHERS THEN
3990: --
3991: --
3992: x_errorcode := -1;
3993: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3994: --
3995: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3996: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
3997: END IF;
4003: --
4004: -- validate item and sku information
4005: PROCEDURE Validate_ItemSKU(
4006: p_api_version IN NUMBER ,
4007: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4008: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4009: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
4010: x_return_status OUT NOCOPY VARCHAR2 ,
4011: x_msg_count OUT NOCOPY NUMBER ,
4004: -- validate item and sku information
4005: PROCEDURE Validate_ItemSKU(
4006: p_api_version IN NUMBER ,
4007: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4008: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4009: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
4010: x_return_status OUT NOCOPY VARCHAR2 ,
4011: x_msg_count OUT NOCOPY NUMBER ,
4012: x_msg_data OUT NOCOPY VARCHAR2 ,
4005: PROCEDURE Validate_ItemSKU(
4006: p_api_version IN NUMBER ,
4007: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4008: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4009: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
4010: x_return_status OUT NOCOPY VARCHAR2 ,
4011: x_msg_count OUT NOCOPY NUMBER ,
4012: x_msg_data OUT NOCOPY VARCHAR2 ,
4013: x_errorcode OUT NOCOPY NUMBER ,
4016: p_sku_rec IN MTL_CCEOI_VAR_PVT.Inv_SKU_Rec_Type ,
4017: p_subinventory IN VARCHAR2 ,
4018: p_locator_rec IN MTL_CCEOI_VAR_PVT.INV_LOCATOR_REC_TYPE ,
4019: p_organization_id IN number,
4020: p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE )
4021: IS
4022: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
4023: BEGIN
4024: -- Start OF comments
4032: -- p_api_version IN NUMBER (required)
4033: -- API Version of this procedure
4034: --
4035: -- p_init_msg_list IN VARCHAR2 (optional)
4036: -- DEFAULT = FND_API.G_FALSE,
4037: --
4038: -- p_commit IN VARCHAR2 (optional)
4039: -- DEFAULT = FND_API.G_FALSE
4040: --
4035: -- p_init_msg_list IN VARCHAR2 (optional)
4036: -- DEFAULT = FND_API.G_FALSE,
4037: --
4038: -- p_commit IN VARCHAR2 (optional)
4039: -- DEFAULT = FND_API.G_FALSE
4040: --
4041: -- p_validation_level IN NUMBER (optional)
4042: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
4043: --
4038: -- p_commit IN VARCHAR2 (optional)
4039: -- DEFAULT = FND_API.G_FALSE
4040: --
4041: -- p_validation_level IN NUMBER (optional)
4042: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
4043: --
4044: -- p_cycle_count_header_id IN NUMBER (required)
4045: -- Cycle COUNT header id
4046: --
4129: -- Standard start of API savepoint
4130: SAVEPOINT Validate_ItemSKU;
4131: --
4132: -- Standard Call to check for call compatibility
4133: IF NOT FND_API.Compatible_API_Call(l_api_version
4134: , p_api_version
4135: , l_api_name
4136: , G_PKG_NAME) THEN
4137: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4133: IF NOT FND_API.Compatible_API_Call(l_api_version
4134: , p_api_version
4135: , l_api_name
4136: , G_PKG_NAME) THEN
4137: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4138: END IF;
4139: --
4140: -- Initialize message list if p_init_msg_list is set to true
4141: IF FND_API.to_Boolean(p_init_msg_list) THEN
4137: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4138: END IF;
4139: --
4140: -- Initialize message list if p_init_msg_list is set to true
4141: IF FND_API.to_Boolean(p_init_msg_list) THEN
4142: FND_MSG_PUB.initialize;
4143: END IF;
4144: --
4145: -- Initialisize API return status to access
4142: FND_MSG_PUB.initialize;
4143: END IF;
4144: --
4145: -- Initialisize API return status to access
4146: x_return_status := FND_API.G_RET_STS_SUCCESS;
4147: --
4148: -- API body
4149: IF (l_debug = 1) THEN
4150: mdebug('Process: In Validate_ItemSKU');
4186: , p_error_table_name => L_table_name
4187: , p_message_name => L_message_name
4188: );
4189: --
4190: RAISE FND_API.G_EXC_ERROR;
4191: ELSIF
4192: x_errorcode < 0 THEN
4193: -- Write INTO interface error TABLE
4194: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
4196: , p_error_column_name => 'unexpected error'
4197: , p_error_table_name => 'unexpected error'
4198: , p_message_name => 'unexpected error'
4199: );
4200: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4201: END IF;
4202: --
4203: IF (l_debug = 1) THEN
4204: mdebug('Process: In Validate_ItemSKU call Subinv ');
4247: , p_error_table_name => L_table_name
4248: , p_message_name => L_message_name
4249: );
4250: --
4251: RAISE FND_API.G_EXC_ERROR;
4252: ELSIF
4253: x_errorcode < 0 THEN
4254: -- Write INTO interface error TABLE
4255: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
4257: , p_error_column_name => 'unexpected error'
4258: , p_error_table_name => 'unexpected error'
4259: , p_message_name => 'unexpected error'
4260: );
4261: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4262: END IF;
4263: --
4264: -- IS item under locator control
4265: IF (l_debug = 1) THEN
4328: , p_error_table_name => L_table_name
4329: , p_message_name => L_message_name
4330: );
4331: --
4332: RAISE FND_API.G_EXC_ERROR;
4333: ELSIF
4334: x_errorcode < 0 THEN
4335: -- Write INTO interface error TABLE
4336: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
4338: , p_error_column_name => 'unexpected error'
4339: , p_error_table_name => 'unexpected error'
4340: , p_message_name => 'unexpected error'
4341: );
4342: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4343: END IF;
4344: --
4345:
4346: -- XXX big mess here (locator check should be based on a control level
4395: , p_error_column_name => L_column_name
4396: , p_error_table_name => L_table_name
4397: , p_message_name => L_message_name
4398: );
4399: RAISE FND_API.G_EXC_ERROR;
4400: ELSIF
4401: x_errorcode < 0 THEN
4402: --
4403: -- Write INTO interface error TABLE
4406: , p_error_column_name => 'unexpected error'
4407: , p_error_table_name => 'unexpected error'
4408: , p_message_name => 'unexpected error'
4409: );
4410: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4411: END IF;
4412: -- location contorl code is either no locator control, determined at
4413: -- subinv level or determined at item level
4414: ELSE
4455: , p_error_column_name => L_column_name
4456: , p_error_table_name => L_table_name
4457: , p_message_name => L_message_name
4458: );
4459: RAISE FND_API.G_EXC_ERROR;
4460: ELSIF
4461: x_errorcode < 0 THEN
4462: --
4463: -- Write INTO interface error TABLE
4466: , p_error_column_name => 'unexpected error'
4467: , p_error_table_name => 'unexpected error'
4468: , p_message_name => 'unexpected error'
4469: );
4470: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4471: END IF;
4472: END IF;
4473: --
4474: -- IS the item under lot control
4537: , p_error_column_name => L_column_name
4538: , p_error_table_name => L_table_name
4539: , p_message_name => L_message_name
4540: );
4541: RAISE FND_API.G_EXC_ERROR;
4542: ELSIF
4543: x_errorcode < 0 THEN
4544: --
4545: IF (l_debug = 1) THEN
4551: , p_error_column_name => 'unexpected error'
4552: , p_error_table_name => 'unexpected error'
4553: , p_message_name => 'unexpected error'
4554: );
4555: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4556: END IF;
4557: END IF;
4558: --
4559: -- IS the item under serial control
4649: , p_error_column_name => L_column_name
4650: , p_error_table_name => L_table_name
4651: , p_message_name => L_message_name
4652: );
4653: RAISE FND_API.G_EXC_ERROR;
4654: ELSIF
4655: x_errorcode < 0 THEN
4656: --
4657: -- Write INTO interface error TABLE
4660: , p_error_column_name => 'unexpected error'
4661: , p_error_table_name => 'unexpected error'
4662: , p_message_name => 'unexpected error'
4663: );
4664: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4665: END IF;
4666: IF (l_debug = 1) THEN
4667: MDEBUG( 'After call Validate_Serial Error Routine');
4668: END IF;
4757: , p_error_column_name => '*'
4758: , p_error_table_name => 'MTL_CYCLE_COUNT_ENTRIES'
4759: , p_message_name => 'INV_CCEOI_NO_CCENTRY'
4760: );
4761: RAISE FND_API.G_EXC_ERROR;
4762: ELSIF
4763: L_counter > 1 OR (L_counter = 1 AND l_is_Unscheduled_Request) THEN
4764: -- XXX it is impossible to have multiple open
4765: -- requests existing for the same item/location
4778: , p_error_column_name => '*'
4779: , p_error_table_name => 'MTL_CYCLE_COUNT_ENTRIES'
4780: , p_message_name => 'INV_CCEOI_MULT_REQUESTS'
4781: );
4782: RAISE FND_API.G_EXC_ERROR;
4783: END IF;
4784: --
4785: IF (l_debug = 1) THEN
4786: MDEBUG( 'Process: In Validate_ItemSKU call-5 ');
4786: MDEBUG( 'Process: In Validate_ItemSKU call-5 ');
4787: END IF;
4788: -- END of API body
4789: -- Standard check of p_commit
4790: IF FND_API.to_Boolean(p_commit) THEN
4791: COMMIT;
4792: END IF;
4793: IF (l_debug = 1) THEN
4794: MDEBUG( 'Process: In Validate_ItemSKU call-6 ');
4800: IF (l_debug = 1) THEN
4801: MDEBUG( 'Process: In Validate_ItemSKU call-7 ');
4802: END IF;
4803: EXCEPTION
4804: WHEN FND_API.G_EXC_ERROR THEN
4805: --
4806: x_return_status := FND_API.G_RET_STS_ERROR;
4807: --
4808: IF (l_debug = 1) THEN
4802: END IF;
4803: EXCEPTION
4804: WHEN FND_API.G_EXC_ERROR THEN
4805: --
4806: x_return_status := FND_API.G_RET_STS_ERROR;
4807: --
4808: IF (l_debug = 1) THEN
4809: MDEBUG( 'ItemSKU-Error');
4810: END IF;
4810: END IF;
4811: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
4812: , p_data => x_msg_data);
4813: --
4814: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4815: --
4816: x_errorcode := -1;
4817: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4818: IF (l_debug = 1) THEN
4813: --
4814: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4815: --
4816: x_errorcode := -1;
4817: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4818: IF (l_debug = 1) THEN
4819: MDEBUG( 'ItemSKU-Unexp Error');
4820: END IF;
4821: --
4824: --
4825: WHEN OTHERS THEN
4826: --
4827: x_errorcode := -1;
4828: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4829: IF (l_debug = 1) THEN
4830: MDEBUG( 'ItemSKU-Others Error');
4831: END IF;
4832: --
4841: --
4842: -- Validate the UOM and quantity information
4843: PROCEDURE Validate_UOMQuantity(
4844: p_api_version IN NUMBER ,
4845: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4846: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4847: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
4848: x_return_status OUT NOCOPY VARCHAR2 ,
4849: x_msg_count OUT NOCOPY NUMBER ,
4842: -- Validate the UOM and quantity information
4843: PROCEDURE Validate_UOMQuantity(
4844: p_api_version IN NUMBER ,
4845: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4846: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4847: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
4848: x_return_status OUT NOCOPY VARCHAR2 ,
4849: x_msg_count OUT NOCOPY NUMBER ,
4850: x_msg_data OUT NOCOPY VARCHAR2 ,
4843: PROCEDURE Validate_UOMQuantity(
4844: p_api_version IN NUMBER ,
4845: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4846: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
4847: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
4848: x_return_status OUT NOCOPY VARCHAR2 ,
4849: x_msg_count OUT NOCOPY NUMBER ,
4850: x_msg_data OUT NOCOPY VARCHAR2 ,
4851: x_errorcode OUT NOCOPY NUMBER ,
4876: -- p_api_version IN NUMBER (required)
4877: -- API Version of this procedure
4878: --
4879: -- p_init_msg_list IN VARCHAR2 (optional)
4880: -- DEFAULT = FND_API.G_FALSE,
4881: --
4882: -- p_commit IN VARCHAR2 (optional)
4883: -- DEFAULT = FND_API.G_FALSE
4884: --
4879: -- p_init_msg_list IN VARCHAR2 (optional)
4880: -- DEFAULT = FND_API.G_FALSE,
4881: --
4882: -- p_commit IN VARCHAR2 (optional)
4883: -- DEFAULT = FND_API.G_FALSE
4884: --
4885: -- p_validation_level IN NUMBER (optional)
4886: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
4887: --
4882: -- p_commit IN VARCHAR2 (optional)
4883: -- DEFAULT = FND_API.G_FALSE
4884: --
4885: -- p_validation_level IN NUMBER (optional)
4886: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
4887: --
4888: -- p_primary_uom_quantity IN NUMBER (required - default)
4889: -- default NULL
4890: -- Quantity within the primary unit OF measure OF the item
4957: -- Standard start of API savepoint
4958: SAVEPOINT Validate_UOMQuantity;
4959: --
4960: -- Standard Call to check for call compatibility
4961: IF NOT FND_API.Compatible_API_Call(l_api_version
4962: , p_api_version
4963: , l_api_name
4964: , G_PKG_NAME) THEN
4965: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4961: IF NOT FND_API.Compatible_API_Call(l_api_version
4962: , p_api_version
4963: , l_api_name
4964: , G_PKG_NAME) THEN
4965: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4966: END IF;
4967: --
4968: -- Initialize message list if p_init_msg_list is set to true
4969: IF FND_API.to_Boolean(p_init_msg_list) THEN
4965: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4966: END IF;
4967: --
4968: -- Initialize message list if p_init_msg_list is set to true
4969: IF FND_API.to_Boolean(p_init_msg_list) THEN
4970: FND_MSG_PUB.initialize;
4971: END IF;
4972: --
4973: -- Initialisize API return status to access
4970: FND_MSG_PUB.initialize;
4971: END IF;
4972: --
4973: -- Initialisize API return status to access
4974: x_return_status := FND_API.G_RET_STS_SUCCESS;
4975: x_errorcode := 0;
4976: --
4977: -- API body
4978: --
5024: MTL_CCEOI_VAR_PVT.G_CC_ENTRY_INTERFACE_ID
5025: , p_error_column_name => 'unexpected error'
5026: , p_error_table_name => 'unexpected error'
5027: , p_message_name => 'unexpected error');
5028: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5029:
5030: ELSIF x_errorcode = 22 THEN
5031: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5032: p_cc_entry_interface_id =>
5033: MTL_CCEOI_VAR_PVT.G_CC_ENTRY_INTERFACE_ID
5034: , p_error_column_name => 'COUNT_QUANTITY'
5035: , p_error_table_name => 'MTL_CYCLE_COUNT_ENTRIES'
5036: , p_message_name => 'INV_CCEOI_NEG_QTY');
5037: RAISE FND_API.G_EXC_ERROR;
5038:
5039: ELSIF x_errorcode = 60 THEN
5040: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5041: p_cc_entry_interface_id =>
5042: MTL_CCEOI_VAR_PVT.G_CC_ENTRY_INTERFACE_ID
5043: , p_error_column_name => 'COUNT_QUANTITY'
5044: , p_error_table_name => 'MTL_CYCLE_COUNT_ENTRIES'
5045: , p_message_name => 'INV_SERIAL_QTY_MUST_BE_1');
5046: RAISE FND_API.G_EXC_ERROR;
5047:
5048: ELSIF x_errorcode = 61 THEN
5049: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5050: p_cc_entry_interface_id =>
5051: MTL_CCEOI_VAR_PVT.G_CC_ENTRY_INTERFACE_ID
5052: , p_error_column_name => 'COUNT_QUANTITY'
5053: , p_error_table_name => 'MTL_CYCLE_COUNT_ENTRIES'
5054: , p_message_name => 'INV_GREATER_EQUAL_ZERO');
5055: RAISE FND_API.G_EXC_ERROR;
5056:
5057: --
5058: -- primary uom quantity IS NOT populated, THEN validate COUNT uom
5059: ELSIF x_errorcode = 19 THEN
5085: 'UOM_CODE/UNIT_OF_MEASURE'
5086: , p_error_table_name => 'MTL_ITEM_UOMS_VIEW'
5087: , p_message_name => 'INV_CCEOI_NO_UOM'
5088: );
5089: RAISE FND_API.G_EXC_ERROR;
5090:
5091: ELSIF x_errorcode = 20 THEN
5092: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5093: p_cc_entry_interface_id =>
5096: 'UOM_CODE/UNIT_OF_MEASURE'
5097: , p_error_table_name => 'MTL_ITEM_UOMS_VIEW'
5098: , p_message_name => 'INV_CCEOI_INVALID_UOM'
5099: );
5100: RAISE FND_API.G_EXC_ERROR;
5101:
5102: ELSIF x_errorcode < 0 THEN
5103:
5104: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5106: MTL_CCEOI_VAR_PVT.G_CC_ENTRY_INTERFACE_ID
5107: , p_error_column_name => 'unexpected error'
5108: , p_error_table_name => 'unexpected error'
5109: , p_message_name => 'unexpected error');
5110: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5111:
5112: END IF;
5113:
5114: --mdebug('Process: In Validate_UOMQuantity call Validate_CountQty ');
5133: , p_error_column_name => 'COUNT_QUANTITY'
5134: , p_error_table_name => 'MTL_CYCLE_COUNT_ENTRIES'
5135: , p_message_name => 'INV_CCEOI_NEG_QTY');
5136:
5137: RAISE FND_API.G_EXC_ERROR;
5138: ELSIF x_errorcode = 60 THEN
5139:
5140: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5141: p_cc_entry_interface_id =>
5143: , p_error_column_name => 'COUNT_QUANTITY'
5144: , p_error_table_name => 'MTL_CC_ENTRIES_INTERFACE'
5145: , p_message_name => 'INV_SERIAL_QTY_MUST_BE_1');
5146:
5147: RAISE FND_API.G_EXC_ERROR;
5148: ELSIF x_errorcode = 61 THEN
5149:
5150: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5151: p_cc_entry_interface_id =>
5153: , p_error_column_name => 'COUNT_QUANTITY'
5154: , p_error_table_name => 'MTL_CC_ENTRIES_INTERFACE'
5155: , p_message_name => 'INV_GREATER_EQUAL_ZERO');
5156:
5157: RAISE FND_API.G_EXC_ERROR;
5158:
5159: ELSIF x_errorcode < 0 THEN
5160: -- Write INTO interface error TABLE
5161: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5164: , p_error_column_name => 'unexpected error'
5165: , p_error_table_name => 'unexpected error'
5166: , p_message_name => 'unexpected error');
5167:
5168: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5169: END IF;
5170:
5171: END IF;
5172:
5208: , p_error_table_name => 'MTL_ONHAND_QUANTITIES'
5209: , p_message_name => 'INV_CCEOI_ADJCALC_NO_SERIAL'
5210: );
5211: --
5212: RAISE FND_API.G_EXC_ERROR;
5213: ELSIF
5214: x_errorcode < 0 THEN
5215: -- Write INTO interface error TABLE
5216: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5218: , p_error_column_name => 'unexpected error'
5219: , p_error_table_name => 'unexpected error'
5220: , p_message_name => 'unexpected error'
5221: );
5222: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5223: END IF;
5224:
5225: ELSE -- XXX this is just a precaution (should never happen)
5226: IF (l_debug = 1) THEN
5231: , p_error_column_name => 'unexpected error'
5232: , p_error_table_name => 'unexpected error'
5233: , p_message_name => 'unexpected error'
5234: );
5235: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5236: END IF;
5237: --
5238: -- END of API body
5239: -- Standard check of p_commit
5236: END IF;
5237: --
5238: -- END of API body
5239: -- Standard check of p_commit
5240: IF FND_API.to_Boolean(p_commit) THEN
5241: COMMIT;
5242: END IF;
5243: -- Standard call to get message count and if count is 1, get message info
5244: FND_MSG_PUB.Count_And_Get
5244: FND_MSG_PUB.Count_And_Get
5245: (p_count => x_msg_count
5246: , p_data => x_msg_data);
5247: EXCEPTION
5248: WHEN FND_API.G_EXC_ERROR THEN
5249: --
5250: x_return_status := FND_API.G_RET_STS_ERROR;
5251: --
5252: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
5246: , p_data => x_msg_data);
5247: EXCEPTION
5248: WHEN FND_API.G_EXC_ERROR THEN
5249: --
5250: x_return_status := FND_API.G_RET_STS_ERROR;
5251: --
5252: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
5253: , p_data => x_msg_data);
5254: --
5251: --
5252: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
5253: , p_data => x_msg_data);
5254: --
5255: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5256: --
5257: x_errorcode := -1;
5258: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5259: --
5254: --
5255: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5256: --
5257: x_errorcode := -1;
5258: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5259: --
5260: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
5261: , p_data => x_msg_data);
5262: --
5262: --
5263: WHEN OTHERS THEN
5264: --
5265: x_errorcode := -1;
5266: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5267: --
5268: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
5269: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
5270: END IF;
5276: --
5277: -- Validate count date and counter
5278: PROCEDURE Validate_CDate_Counter(
5279: p_api_version IN NUMBER ,
5280: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5281: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5282: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
5283: x_return_status OUT NOCOPY VARCHAR2 ,
5284: x_msg_count OUT NOCOPY NUMBER ,
5277: -- Validate count date and counter
5278: PROCEDURE Validate_CDate_Counter(
5279: p_api_version IN NUMBER ,
5280: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5281: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5282: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
5283: x_return_status OUT NOCOPY VARCHAR2 ,
5284: x_msg_count OUT NOCOPY NUMBER ,
5285: x_msg_data OUT NOCOPY VARCHAR2 ,
5278: PROCEDURE Validate_CDate_Counter(
5279: p_api_version IN NUMBER ,
5280: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5281: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5282: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
5283: x_return_status OUT NOCOPY VARCHAR2 ,
5284: x_msg_count OUT NOCOPY NUMBER ,
5285: x_msg_data OUT NOCOPY VARCHAR2 ,
5286: x_errorcode OUT NOCOPY NUMBER ,
5300: -- p_api_version IN NUMBER (required)
5301: -- API Version of this procedure
5302: --
5303: -- p_init_msg_list IN VARCHAR2 (optional)
5304: -- DEFAULT = FND_API.G_FALSE,
5305: --
5306: -- p_commit IN VARCHAR2 (optional)
5307: -- DEFAULT = FND_API.G_FALSE
5308: --
5303: -- p_init_msg_list IN VARCHAR2 (optional)
5304: -- DEFAULT = FND_API.G_FALSE,
5305: --
5306: -- p_commit IN VARCHAR2 (optional)
5307: -- DEFAULT = FND_API.G_FALSE
5308: --
5309: -- p_validation_level IN NUMBER (optional)
5310: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
5311: --
5306: -- p_commit IN VARCHAR2 (optional)
5307: -- DEFAULT = FND_API.G_FALSE
5308: --
5309: -- p_validation_level IN NUMBER (optional)
5310: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL,
5311: --
5312: -- p_employee_id IN NUMBER (required)
5313: -- EmployeeID OF the counter
5314: --
5348: -- Standard start of API savepoint
5349: SAVEPOINT Validate_CDate_Counter;
5350: --
5351: -- Standard Call to check for call compatibility
5352: IF NOT FND_API.Compatible_API_Call(l_api_version
5353: , p_api_version
5354: , l_api_name
5355: , G_PKG_NAME) THEN
5356: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5352: IF NOT FND_API.Compatible_API_Call(l_api_version
5353: , p_api_version
5354: , l_api_name
5355: , G_PKG_NAME) THEN
5356: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5357: END IF;
5358: --
5359: -- Initialize message list if p_init_msg_list is set to true
5360: IF FND_API.to_Boolean(p_init_msg_list) THEN
5356: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5357: END IF;
5358: --
5359: -- Initialize message list if p_init_msg_list is set to true
5360: IF FND_API.to_Boolean(p_init_msg_list) THEN
5361: FND_MSG_PUB.initialize;
5362: END IF;
5363: --
5364: -- Initialisize API return status to access
5361: FND_MSG_PUB.initialize;
5362: END IF;
5363: --
5364: -- Initialisize API return status to access
5365: x_return_status := FND_API.G_RET_STS_SUCCESS;
5366: x_errorcode := 0;
5367: --
5368: -- API body
5369: --
5391: , p_error_table_name => 'MTL_CYCLE_COUNT_HEADERS'
5392: , p_message_name => 'INV_CCEOI_COUNT_DATE_FUTURE'
5393: );
5394: --
5395: RAISE FND_API.G_EXC_ERROR;
5396: --
5397: ELSIF x_errorcode = 59 THEN -- New errorcode ( existing one )
5398: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5399: p_cc_entry_interface_id => MTL_CCEOI_VAR_PVT.G_CC_ENTRY_INTERFACE_ID
5401: , p_error_table_name => 'MTL_CYCLE_COUNT_HEADERS'
5402: , p_message_name => 'INV_COUNT_DATE_FUTURE'
5403: );
5404: --
5405: RAISE FND_API.G_EXC_ERROR;
5406: ELSIF x_errorcode = 24 THEN
5407: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5408: p_cc_entry_interface_id => MTL_CCEOI_VAR_PVT.G_CC_ENTRY_INTERFACE_ID
5409: , p_error_column_name => 'COUNT_DATE'
5410: , p_error_table_name => 'MTL_CYCLE_COUNT_HEADERS'
5411: , p_message_name => 'INV_CCEOI_NO_OPEN_ADJ_PRD'
5412: );
5413: --
5414: RAISE FND_API.G_EXC_ERROR;
5415:
5416: ELSIF
5417: x_errorcode < 0 THEN
5418: -- Write INTO interface error TABLE
5421: , p_error_column_name => 'unexpected error'
5422: , p_error_table_name => 'unexpected error'
5423: , p_message_name => 'unexpected error'
5424: );
5425: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5426: END IF;
5427: --
5428: IF (l_debug = 1) THEN
5429: mdebug('Process: In Validate_CDate_Counter call Validate_Employee');
5470: , p_error_table_name => 'MTL_EMPLOYEES_CURRENT_VIEW'
5471: , p_message_name => L_message_name
5472: );
5473: --
5474: RAISE FND_API.G_EXC_ERROR;
5475: ELSIF
5476: x_errorcode < 0 THEN
5477: -- Write INTO interface error TABLE
5478: MTL_CCEOI_PROCESS_PVT.Insert_CCEOIError(
5480: , p_error_column_name => 'unexpected error'
5481: , p_error_table_name => 'unexpected error'
5482: , p_message_name => 'unexpected error'
5483: );
5484: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5485: END IF;
5486: --
5487: -- END of API body
5488: -- Standard check of p_commit
5485: END IF;
5486: --
5487: -- END of API body
5488: -- Standard check of p_commit
5489: IF FND_API.to_Boolean(p_commit) THEN
5490: COMMIT;
5491: END IF;
5492: -- Standard call to get message count and if count is 1, get message info
5493: FND_MSG_PUB.Count_And_Get
5493: FND_MSG_PUB.Count_And_Get
5494: (p_count => x_msg_count
5495: , p_data => x_msg_data);
5496: EXCEPTION
5497: WHEN FND_API.G_EXC_ERROR THEN
5498: --
5499: x_return_status := FND_API.G_RET_STS_ERROR;
5500: --
5501: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
5495: , p_data => x_msg_data);
5496: EXCEPTION
5497: WHEN FND_API.G_EXC_ERROR THEN
5498: --
5499: x_return_status := FND_API.G_RET_STS_ERROR;
5500: --
5501: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
5502: , p_data => x_msg_data);
5503: --
5500: --
5501: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
5502: , p_data => x_msg_data);
5503: --
5504: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5505: --
5506: x_errorcode := -1;
5507: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5508: --
5503: --
5504: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5505: --
5506: x_errorcode := -1;
5507: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5508: --
5509: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
5510: , p_data => x_msg_data);
5511: --
5511: --
5512: WHEN OTHERS THEN
5513: --
5514: x_errorcode := -1;
5515: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5516: --
5517: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
5518: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
5519: END IF;
5697: -- The logic which handles serial numbers is copied from INVATCEN.pld
5698: -- and will need further review/rewrite
5699: PROCEDURE Process_Data(
5700: p_api_version IN NUMBER ,
5701: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5702: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5703: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
5704: x_return_status OUT NOCOPY VARCHAR2 ,
5705: x_msg_count OUT NOCOPY NUMBER ,
5698: -- and will need further review/rewrite
5699: PROCEDURE Process_Data(
5700: p_api_version IN NUMBER ,
5701: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5702: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5703: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
5704: x_return_status OUT NOCOPY VARCHAR2 ,
5705: x_msg_count OUT NOCOPY NUMBER ,
5706: x_msg_data OUT NOCOPY VARCHAR2 ,
5699: PROCEDURE Process_Data(
5700: p_api_version IN NUMBER ,
5701: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5702: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5703: p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL,
5704: x_return_status OUT NOCOPY VARCHAR2 ,
5705: x_msg_count OUT NOCOPY NUMBER ,
5706: x_msg_data OUT NOCOPY VARCHAR2 ,
5707: x_errorcode OUT NOCOPY NUMBER ,
5704: x_return_status OUT NOCOPY VARCHAR2 ,
5705: x_msg_count OUT NOCOPY NUMBER ,
5706: x_msg_data OUT NOCOPY VARCHAR2 ,
5707: x_errorcode OUT NOCOPY NUMBER ,
5708: p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE,
5709: p_interface_rec IN MTL_CCEOI_VAR_PVT.INV_CCEOI_TYPE )
5710: IS
5711: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
5712: BEGIN
5723: -- p_api_version IN NUMBER (required)
5724: -- API Version of this procedure
5725: --
5726: -- p_init_msg_list IN VARCHAR2 (optional)
5727: -- DEFAULT = FND_API.G_FALSE,
5728: --
5729: -- p_commit IN VARCHAR2 (optional)
5730: --
5731: -- DEFAULT = FND_API.G_FALSE
5727: -- DEFAULT = FND_API.G_FALSE,
5728: --
5729: -- p_commit IN VARCHAR2 (optional)
5730: --
5731: -- DEFAULT = FND_API.G_FALSE
5732: -- p_validation_level IN NUMBER (optional)
5733: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL
5734: -- currently unused
5735: --
5729: -- p_commit IN VARCHAR2 (optional)
5730: --
5731: -- DEFAULT = FND_API.G_FALSE
5732: -- p_validation_level IN NUMBER (optional)
5733: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL
5734: -- currently unused
5735: --
5736: -- p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE
5737: -- G_TRUE - skip any updates/inserts to any non-cc-interface tables
5732: -- p_validation_level IN NUMBER (optional)
5733: -- DEFAULT = FND_API.G_VALID_LEVEL_FULL
5734: -- currently unused
5735: --
5736: -- p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE
5737: -- G_TRUE - skip any updates/inserts to any non-cc-interface tables
5738: -- G_FALSE - update any tables necessary
5739: --
5740: -- p_interface_rec MTL_CC_ENTRIES_INTERFACE%rowtype (required)
5793: -- Standard start of API savepoint
5794: SAVEPOINT Process_Data;
5795: --
5796: -- Standard Call to check for call compatibility
5797: IF NOT FND_API.Compatible_API_Call(l_api_version
5798: , p_api_version
5799: , l_api_name
5800: , G_PKG_NAME) THEN
5801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5797: IF NOT FND_API.Compatible_API_Call(l_api_version
5798: , p_api_version
5799: , l_api_name
5800: , G_PKG_NAME) THEN
5801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5802: END IF;
5803: --
5804: -- Initialize message list if p_init_msg_list is set to true
5805: IF FND_API.to_Boolean(p_init_msg_list) THEN
5801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5802: END IF;
5803: --
5804: -- Initialize message list if p_init_msg_list is set to true
5805: IF FND_API.to_Boolean(p_init_msg_list) THEN
5806: FND_MSG_PUB.initialize;
5807: END IF;
5808: --
5809: -- Initialisize API return status to access
5806: FND_MSG_PUB.initialize;
5807: END IF;
5808: --
5809: -- Initialisize API return status to access
5810: x_return_status := FND_API.G_RET_STS_SUCCESS;
5811: x_errorcode := 0;
5812: --
5813: -- API body
5814: IF (l_debug = 1) THEN
5901: MDEBUG( 'Process Data: Not equal sys and count qties');
5902: MDEBUG( 'Process Data: level '||to_char(p_validation_level));
5903: END IF;
5904: --
5905: IF NOT FND_API.to_Boolean(p_simulate) THEN
5906: --
5907: IF (l_debug = 1) THEN
5908: MDEBUG( 'Process Data: mark RECORD as locked ');
5909: MDEBUG( 'Process Data: Sl# '||p_interface_rec.serial_number);
5934: p_interface_rec.serial_number);
5935: FND_MSG_PUB.Add;
5936: --x_errorcode := -1;
5937: x_errorcode := 70;
5938: --RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5939: RAISE FND_API.G_EXC_ERROR;
5940: --
5941: END IF;
5942: END IF;
5935: FND_MSG_PUB.Add;
5936: --x_errorcode := -1;
5937: x_errorcode := 70;
5938: --RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5939: RAISE FND_API.G_EXC_ERROR;
5940: --
5941: END IF;
5942: END IF;
5943: --
5974: mdebug('Process: In Process_Data with serial one per request Completed');
5975: END IF;
5976:
5977: -- if p_validation_level = 1 THEN
5978: if p_simulate = FND_API.G_FALSE THEN
5979: serial_check.inv_unmark_serial(
5980: from_serial_number => p_interface_rec.serial_number
5981: , to_serial_number => p_interface_rec.serial_number
5982: , serial_code => MTL_CCEOI_VAR_PVT.G_SKU_REC.SERIAL_NUMBER_CONTROL_CODE
5993: END IF;
5994: --
5995: -- END of API body
5996: -- Standard check of p_commit
5997: IF FND_API.to_Boolean(p_commit) THEN
5998: COMMIT;
5999: END IF;
6000: -- Standard call to get message count and if count is 1, get message info
6001: FND_MSG_PUB.Count_And_Get
6001: FND_MSG_PUB.Count_And_Get
6002: (p_count => x_msg_count
6003: , p_data => x_msg_data);
6004: EXCEPTION
6005: WHEN FND_API.G_EXC_ERROR THEN
6006: --
6007: ROLLBACK TO Process_Data;
6008: --
6009: x_return_status := FND_API.G_RET_STS_ERROR;
6005: WHEN FND_API.G_EXC_ERROR THEN
6006: --
6007: ROLLBACK TO Process_Data;
6008: --
6009: x_return_status := FND_API.G_RET_STS_ERROR;
6010: --
6011: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
6012: , p_data => x_msg_data);
6013: --
6010: --
6011: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
6012: , p_data => x_msg_data);
6013: --
6014: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6015: --
6016: ROLLBACK TO Process_Data;
6017: --
6018: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
6014: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6015: --
6016: ROLLBACK TO Process_Data;
6017: --
6018: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
6019: --
6020: x_errorcode := -1;
6021: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
6022: , p_data => x_msg_data);
6025: --
6026: ROLLBACK TO Process_Data;
6027: --
6028: x_errorcode := -1;
6029: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
6030: --
6031: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
6032: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
6033: END IF;
6073: DECLARE
6074: dummy integer;
6075:
6076: BEGIN
6077: X_return_status := FND_API.G_RET_STS_SUCCESS;
6078: -- update RECORD to be successful
6079: --
6080: BEGIN
6081: --
6259: --
6260: END IF;
6261: EXCEPTION
6262: WHEN OTHERS THEN
6263: X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
6264: END;
6265: END;
6266: END;
6267:
6280: -- post:
6281: --
6282: FUNCTION check_serial_location(
6283: P_issue_receipt IN VARCHAR2,
6284: p_simulate IN VARCHAR2 DEFAULT FND_API.G_FALSE )
6285: return BOOLEAN
6286: IS
6287: l_return_status VARCHAR2(1);
6288: l_errorcode NUMBER;
6322: p_receipt_issue_flag => p_issue_receipt,
6323: p_simulate => p_simulate);
6324:
6325:
6326: if (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
6327: return (FALSE);
6328: end if;
6329:
6330:
6370: v_msn_revision varchar2(3);
6371: v_current_status number;
6372: --
6373: P_api_version NUMBER := 0.9;
6374: P_INIT_MSG_LIST VARCHAR2(30) DEFAULT FND_API.G_FALSE;
6375: P_COMMIT VARCHAR2(30) DEFAULT FND_API.G_FALSE;
6376: P_VALIDATION_LEVEL NUMBER := 1;
6377: -- P_VALIDATION_LEVEL NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL;
6378: X_RETURN_STATUS VARCHAR2(90);
6371: v_current_status number;
6372: --
6373: P_api_version NUMBER := 0.9;
6374: P_INIT_MSG_LIST VARCHAR2(30) DEFAULT FND_API.G_FALSE;
6375: P_COMMIT VARCHAR2(30) DEFAULT FND_API.G_FALSE;
6376: P_VALIDATION_LEVEL NUMBER := 1;
6377: -- P_VALIDATION_LEVEL NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL;
6378: X_RETURN_STATUS VARCHAR2(90);
6379: X_MSG_COUNT NUMBER;
6373: P_api_version NUMBER := 0.9;
6374: P_INIT_MSG_LIST VARCHAR2(30) DEFAULT FND_API.G_FALSE;
6375: P_COMMIT VARCHAR2(30) DEFAULT FND_API.G_FALSE;
6376: P_VALIDATION_LEVEL NUMBER := 1;
6377: -- P_VALIDATION_LEVEL NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL;
6378: X_RETURN_STATUS VARCHAR2(90);
6379: X_MSG_COUNT NUMBER;
6380: X_MSG_DATA VARCHAR2(90);
6381: X_ERRORCODE NUMBER;
6548:
6549: -- BEGIN INVCONV
6550: PROCEDURE validate_secondaryuomqty (
6551: p_api_version IN NUMBER
6552: , p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false
6553: , p_commit IN VARCHAR2 DEFAULT fnd_api.g_false
6554: , p_validation_level IN NUMBER DEFAULT fnd_api.g_valid_level_full
6555: , x_return_status OUT NOCOPY VARCHAR2
6556: , x_msg_count OUT NOCOPY NUMBER
6549: -- BEGIN INVCONV
6550: PROCEDURE validate_secondaryuomqty (
6551: p_api_version IN NUMBER
6552: , p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false
6553: , p_commit IN VARCHAR2 DEFAULT fnd_api.g_false
6554: , p_validation_level IN NUMBER DEFAULT fnd_api.g_valid_level_full
6555: , x_return_status OUT NOCOPY VARCHAR2
6556: , x_msg_count OUT NOCOPY NUMBER
6557: , x_msg_data OUT NOCOPY VARCHAR2
6550: PROCEDURE validate_secondaryuomqty (
6551: p_api_version IN NUMBER
6552: , p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false
6553: , p_commit IN VARCHAR2 DEFAULT fnd_api.g_false
6554: , p_validation_level IN NUMBER DEFAULT fnd_api.g_valid_level_full
6555: , x_return_status OUT NOCOPY VARCHAR2
6556: , x_msg_count OUT NOCOPY NUMBER
6557: , x_msg_data OUT NOCOPY VARCHAR2
6558: , x_errorcode OUT NOCOPY NUMBER
6580: -- Standard start of API savepoint
6581: SAVEPOINT validate_uomquantity;
6582:
6583: -- Standard Call to check for call compatibility
6584: IF NOT fnd_api.compatible_api_call (l_api_version
6585: , p_api_version
6586: , l_api_name
6587: , g_pkg_name) THEN
6588: RAISE fnd_api.g_exc_unexpected_error;
6584: IF NOT fnd_api.compatible_api_call (l_api_version
6585: , p_api_version
6586: , l_api_name
6587: , g_pkg_name) THEN
6588: RAISE fnd_api.g_exc_unexpected_error;
6589: END IF;
6590:
6591: -- Initialize message list if p_init_msg_list is set to true
6592: IF fnd_api.to_boolean (p_init_msg_list) THEN
6588: RAISE fnd_api.g_exc_unexpected_error;
6589: END IF;
6590:
6591: -- Initialize message list if p_init_msg_list is set to true
6592: IF fnd_api.to_boolean (p_init_msg_list) THEN
6593: fnd_msg_pub.initialize;
6594: END IF;
6595:
6596: -- Initialisize API return status to success
6593: fnd_msg_pub.initialize;
6594: END IF;
6595:
6596: -- Initialisize API return status to success
6597: x_return_status := fnd_api.g_ret_sts_success;
6598: x_errorcode := 0;
6599:
6600: --
6601: IF (l_debug = 1) THEN
6643: (p_cc_entry_interface_id => mtl_cceoi_var_pvt.g_cc_entry_interface_id
6644: , p_error_column_name => 'SECONDARY_UOM_CODE'
6645: , p_error_table_name => 'MTL_SYSTEM_ITEMS'
6646: , p_message_name => 'INV_INCORRECT_SECONDARY_UOM');
6647: RAISE fnd_api.g_exc_error;
6648: END IF;
6649:
6650: IF (l_debug = 1) THEN
6651: mdebug ( 'Process: In Validate_SecondaryUOMQty call Validate_SecondaryCountQty: '
6682: (p_cc_entry_interface_id => mtl_cceoi_var_pvt.g_cc_entry_interface_id
6683: , p_error_column_name => 'SECONDARY_COUNT_QUANTITY'
6684: , p_error_table_name => 'MTL_CC_ENTRIES_INTERFACE'
6685: , p_message_name => 'INV_NO_CONVERSION_ERR');
6686: RAISE fnd_api.g_exc_error;
6687: ELSIF x_errorcode = 51 THEN
6688: -- Write INTO interface error TABLE
6689: mtl_cceoi_process_pvt.insert_cceoierror
6690: (p_cc_entry_interface_id => mtl_cceoi_var_pvt.g_cc_entry_interface_id
6690: (p_cc_entry_interface_id => mtl_cceoi_var_pvt.g_cc_entry_interface_id
6691: , p_error_column_name => 'SECONDARY_COUNT_QUANTITY'
6692: , p_error_table_name => 'MTL_CC_ENTRIES_INTERFACE'
6693: , p_message_name => 'INV_DEVIATION_CHECK_ERR');
6694: RAISE fnd_api.g_exc_error;
6695: ELSIF x_errorcode = 52 THEN
6696: -- Write INTO interface error TABLE
6697: mtl_cceoi_process_pvt.insert_cceoierror
6698: (p_cc_entry_interface_id => mtl_cceoi_var_pvt.g_cc_entry_interface_id
6698: (p_cc_entry_interface_id => mtl_cceoi_var_pvt.g_cc_entry_interface_id
6699: , p_error_column_name => 'SECONDARY_COUNT_QUANTITY'
6700: , p_error_table_name => 'MTL_CC_ENTRIES_INTERFACE'
6701: , p_message_name => 'INV_CCEOI_NEG_QTY');
6702: RAISE fnd_api.g_exc_error;
6703: END IF;
6704:
6705: -- Calculate secondary adjustment quantity
6706: MTL_CCEOI_VAR_PVT.g_sec_adjustment_quantity :=
6715: (p_cc_entry_interface_id => mtl_cceoi_var_pvt.g_cc_entry_interface_id
6716: , p_error_column_name => 'unexpected error'
6717: , p_error_table_name => 'unexpected error'
6718: , p_message_name => 'unexpected error');
6719: RAISE fnd_api.g_exc_unexpected_error;
6720: END IF; -- count type code
6721:
6722: -- Standard check of p_commit
6723: IF fnd_api.to_boolean (p_commit) THEN
6719: RAISE fnd_api.g_exc_unexpected_error;
6720: END IF; -- count type code
6721:
6722: -- Standard check of p_commit
6723: IF fnd_api.to_boolean (p_commit) THEN
6724: COMMIT;
6725: END IF;
6726:
6727: -- Standard call to get message count and if count is 1, get message info
6726:
6727: -- Standard call to get message count and if count is 1, get message info
6728: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
6729: EXCEPTION
6730: WHEN fnd_api.g_exc_error THEN
6731: ROLLBACK TO validate_secondarycountuom;
6732: x_return_status := fnd_api.g_ret_sts_error;
6733: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
6734: WHEN fnd_api.g_exc_unexpected_error THEN
6728: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
6729: EXCEPTION
6730: WHEN fnd_api.g_exc_error THEN
6731: ROLLBACK TO validate_secondarycountuom;
6732: x_return_status := fnd_api.g_ret_sts_error;
6733: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
6734: WHEN fnd_api.g_exc_unexpected_error THEN
6735: ROLLBACK TO validate_secondarycountuom;
6736: x_return_status := fnd_api.g_ret_sts_unexp_error;
6730: WHEN fnd_api.g_exc_error THEN
6731: ROLLBACK TO validate_secondarycountuom;
6732: x_return_status := fnd_api.g_ret_sts_error;
6733: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
6734: WHEN fnd_api.g_exc_unexpected_error THEN
6735: ROLLBACK TO validate_secondarycountuom;
6736: x_return_status := fnd_api.g_ret_sts_unexp_error;
6737: x_errorcode := -1;
6738: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
6732: x_return_status := fnd_api.g_ret_sts_error;
6733: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
6734: WHEN fnd_api.g_exc_unexpected_error THEN
6735: ROLLBACK TO validate_secondarycountuom;
6736: x_return_status := fnd_api.g_ret_sts_unexp_error;
6737: x_errorcode := -1;
6738: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
6739: WHEN OTHERS THEN
6740: ROLLBACK TO validate_secondarycountuom;
6738: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
6739: WHEN OTHERS THEN
6740: ROLLBACK TO validate_secondarycountuom;
6741: x_errorcode := -1;
6742: x_return_status := fnd_api.g_ret_sts_unexp_error;
6743:
6744: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
6745: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
6746: END IF;