2: /* $Header: AHLVFCMB.pls 120.13.12020000.2 2012/12/14 08:52:36 shnatu ship $ */
3:
4: G_PKG_NAME VARCHAR2(30):='AHL_FMP_COMMON_PVT';
5: G_APPLN_USAGE VARCHAR2(30):=LTRIM(RTRIM(FND_PROFILE.VALUE('AHL_APPLN_USAGE')));
6: G_DEBUG VARCHAR2(1):=AHL_DEBUG_PUB.is_log_enabled;
7:
8: -- local procedures
9:
10: -- Check to see whether a VARCHAR2 contains only numeric values
1314: l_mr_status_code varchar2(30);
1315: BEGIN
1316: x_return_status := FND_API.G_RET_STS_SUCCESS;
1317: IF ( G_DEBUG = 'Y' ) THEN
1318: AHL_DEBUG_PUB.enable_debug;
1319: AHL_DEBUG_PUB.debug('Step A' );
1320: END IF;
1321:
1322: IF ( p_mr_header_id IS NULL OR
1315: BEGIN
1316: x_return_status := FND_API.G_RET_STS_SUCCESS;
1317: IF ( G_DEBUG = 'Y' ) THEN
1318: AHL_DEBUG_PUB.enable_debug;
1319: AHL_DEBUG_PUB.debug('Step A' );
1320: END IF;
1321:
1322: IF ( p_mr_header_id IS NULL OR
1323: p_mr_header_id = FND_API.G_MISS_NUM ) THEN
1324: x_return_status := FND_API.G_RET_STS_ERROR;
1325: x_msg_data := 'AHL_FMP_MR_HEADER_ID_INVALID';
1326: RETURN;
1327: END IF;
1328: AHL_DEBUG_PUB.debug('Step A3' );
1329: OPEN check_mr_status( p_mr_header_id );
1330:
1331: FETCH check_mr_status INTO l_mr_status_code;
1332:
1335: x_msg_data := 'AHL_FMP_INVALID_MR';
1336: CLOSE check_mr_status;
1337: RETURN;
1338: END IF;
1339: AHL_DEBUG_PUB.debug('Step A6' );
1340: IF ( l_mr_status_code <> 'DRAFT' AND
1341: l_mr_status_code <> 'APPROVAL_REJECTED' ) THEN
1342: x_return_status := FND_API.G_RET_STS_ERROR;
1343: AHL_DEBUG_PUB.debug('Step 1' );
1339: AHL_DEBUG_PUB.debug('Step A6' );
1340: IF ( l_mr_status_code <> 'DRAFT' AND
1341: l_mr_status_code <> 'APPROVAL_REJECTED' ) THEN
1342: x_return_status := FND_API.G_RET_STS_ERROR;
1343: AHL_DEBUG_PUB.debug('Step 1' );
1344: x_msg_data := 'AHL_FMP_INVALID_MR_STATUS';
1345: AHL_DEBUG_PUB.debug('Step 2' );
1346: CLOSE check_mr_status;
1347: RETURN;
1341: l_mr_status_code <> 'APPROVAL_REJECTED' ) THEN
1342: x_return_status := FND_API.G_RET_STS_ERROR;
1343: AHL_DEBUG_PUB.debug('Step 1' );
1344: x_msg_data := 'AHL_FMP_INVALID_MR_STATUS';
1345: AHL_DEBUG_PUB.debug('Step 2' );
1346: CLOSE check_mr_status;
1347: RETURN;
1348: END IF;
1349: