66: END IF;
67:
68: -- Initialize message list IF p_init_msg_list is set to TRUE.
69: IF FND_API.to_Boolean(p_init_msg_list) THEN
70: FND_MSG_PUB.initialize;
71: END IF;
72:
73: -- Initialize API return status to SUCCESS
74: x_return_status := FND_API.G_RET_STS_SUCCESS;
349: logMessage(FND_LOG.LEVEL_ERROR, G_PKG_NAME, l_api_name || ': ' || ' - missing loan_id');
350:
351: --throw exception
352: FND_MESSAGE.SET_NAME('LNS', 'LNS_INVALID_LOAN_ID');
353: FND_MSG_PUB.Add;
354: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
355: RAISE FND_API.G_EXC_ERROR;
356: end if;
357:
350:
351: --throw exception
352: FND_MESSAGE.SET_NAME('LNS', 'LNS_INVALID_LOAN_ID');
353: FND_MSG_PUB.Add;
354: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
355: RAISE FND_API.G_EXC_ERROR;
356: end if;
357:
358: --Initialize the local variables
378: logMessage(FND_LOG.LEVEL_ERROR, G_PKG_NAME, l_api_name || ': ' || ' - loan lines already exist for this loan_id');
379:
380: --throw exception
381: FND_MESSAGE.SET_NAME('LNS', 'LNS_LOAN_LINES_EXIST');
382: FND_MSG_PUB.Add;
383: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
384: RAISE FND_API.G_EXC_ERROR;
385:
386: end if;
379:
380: --throw exception
381: FND_MESSAGE.SET_NAME('LNS', 'LNS_LOAN_LINES_EXIST');
382: FND_MSG_PUB.Add;
383: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
384: RAISE FND_API.G_EXC_ERROR;
385:
386: end if;
387:
397: logMessage(FND_LOG.LEVEL_ERROR, G_PKG_NAME, l_api_name || ': ' || ' - invalid parameters');
398:
399: --throw exception
400: FND_MESSAGE.SET_NAME('LNS', 'LNS_SOME_REQ_FIELDS_EMPTY');
401: FND_MSG_PUB.Add;
402: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
403: RAISE FND_API.G_EXC_ERROR;
404:
405: end if;
398:
399: --throw exception
400: FND_MESSAGE.SET_NAME('LNS', 'LNS_SOME_REQ_FIELDS_EMPTY');
401: FND_MSG_PUB.Add;
402: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
403: RAISE FND_API.G_EXC_ERROR;
404:
405: end if;
406:
417: --throw exception
418: FND_MESSAGE.SET_NAME('LNS', 'LNS_INVALID_VALUE');
419: FND_MESSAGE.SET_TOKEN('PARAMETER', 'p_loan_product_id');
420: FND_MESSAGE.SET_TOKEN('VALUE', l_loan_product_id);
421: FND_MSG_PUB.Add;
422: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
423: RAISE FND_API.G_EXC_ERROR;
424:
425: end if;
418: FND_MESSAGE.SET_NAME('LNS', 'LNS_INVALID_VALUE');
419: FND_MESSAGE.SET_TOKEN('PARAMETER', 'p_loan_product_id');
420: FND_MESSAGE.SET_TOKEN('VALUE', l_loan_product_id);
421: FND_MSG_PUB.Add;
422: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
423: RAISE FND_API.G_EXC_ERROR;
424:
425: end if;
426:
565: IF (l_pmt_sch_id_tbl.count <= 0) THEN
566: --No open receivable found for derivation.
567: --throw exception
568: FND_MESSAGE.SET_NAME('LNS', 'LNS_NO_REC_FOUND');
569: FND_MSG_PUB.Add;
570: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
571: RAISE FND_API.G_EXC_ERROR;
572: END IF;
573:
566: --No open receivable found for derivation.
567: --throw exception
568: FND_MESSAGE.SET_NAME('LNS', 'LNS_NO_REC_FOUND');
569: FND_MSG_PUB.Add;
570: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
571: RAISE FND_API.G_EXC_ERROR;
572: END IF;
573:
574: l_last_api_called := 'Bulk insert into lns_loan_lines';
659: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, l_api_name || ' - after rollback');
660: logMessage(FND_LOG.LEVEL_ERROR, G_PKG_NAME, sqlerrm);
661: FND_MESSAGE.SET_NAME('LNS', 'LNS_API_OTHERS_EXCEP');
662: FND_MESSAGE.SET_TOKEN('ERROR' ,'Failed API call: ' || l_last_api_called || ' SQLERRM: ' || SQLERRM);
663: FND_MSG_PUB.ADD;
664: return 0;
665:
666: END GET_RULES_DERIVED_ERS_AMOUNT;
667: