68: END IF;
69:
70: -- Initialize message list IF p_init_msg_list is set to TRUE.
71: IF FND_API.to_Boolean(p_init_msg_list) THEN
72: FND_MSG_PUB.initialize;
73: END IF;
74:
75: -- Initialize API return status to SUCCESS
76: x_return_status := FND_API.G_RET_STS_SUCCESS;
356: logMessage(FND_LOG.LEVEL_ERROR, G_PKG_NAME, l_api_name || ': ' || ' - missing loan_id');
357:
358: --throw exception
359: FND_MESSAGE.SET_NAME('LNS', 'LNS_INVALID_LOAN_ID');
360: FND_MSG_PUB.Add;
361: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
362: RAISE FND_API.G_EXC_ERROR;
363: end if;
364:
357:
358: --throw exception
359: FND_MESSAGE.SET_NAME('LNS', 'LNS_INVALID_LOAN_ID');
360: FND_MSG_PUB.Add;
361: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
362: RAISE FND_API.G_EXC_ERROR;
363: end if;
364:
365: --Initialize the local variables
385: logMessage(FND_LOG.LEVEL_ERROR, G_PKG_NAME, l_api_name || ': ' || ' - loan lines already exist for this loan_id');
386:
387: --throw exception
388: FND_MESSAGE.SET_NAME('LNS', 'LNS_LOAN_LINES_EXIST');
389: FND_MSG_PUB.Add;
390: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
391: RAISE FND_API.G_EXC_ERROR;
392:
393: end if;
386:
387: --throw exception
388: FND_MESSAGE.SET_NAME('LNS', 'LNS_LOAN_LINES_EXIST');
389: FND_MSG_PUB.Add;
390: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
391: RAISE FND_API.G_EXC_ERROR;
392:
393: end if;
394:
404: logMessage(FND_LOG.LEVEL_ERROR, G_PKG_NAME, l_api_name || ': ' || ' - invalid parameters');
405:
406: --throw exception
407: FND_MESSAGE.SET_NAME('LNS', 'LNS_SOME_REQ_FIELDS_EMPTY');
408: FND_MSG_PUB.Add;
409: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
410: RAISE FND_API.G_EXC_ERROR;
411:
412: end if;
405:
406: --throw exception
407: FND_MESSAGE.SET_NAME('LNS', 'LNS_SOME_REQ_FIELDS_EMPTY');
408: FND_MSG_PUB.Add;
409: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
410: RAISE FND_API.G_EXC_ERROR;
411:
412: end if;
413:
424: --throw exception
425: FND_MESSAGE.SET_NAME('LNS', 'LNS_INVALID_VALUE');
426: FND_MESSAGE.SET_TOKEN('PARAMETER', 'p_loan_product_id');
427: FND_MESSAGE.SET_TOKEN('VALUE', l_loan_product_id);
428: FND_MSG_PUB.Add;
429: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
430: RAISE FND_API.G_EXC_ERROR;
431:
432: end if;
425: FND_MESSAGE.SET_NAME('LNS', 'LNS_INVALID_VALUE');
426: FND_MESSAGE.SET_TOKEN('PARAMETER', 'p_loan_product_id');
427: FND_MESSAGE.SET_TOKEN('VALUE', l_loan_product_id);
428: FND_MSG_PUB.Add;
429: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
430: RAISE FND_API.G_EXC_ERROR;
431:
432: end if;
433:
572: IF (l_pmt_sch_id_tbl.count <= 0) THEN
573: --No open receivable found for derivation.
574: --throw exception
575: FND_MESSAGE.SET_NAME('LNS', 'LNS_NO_REC_FOUND');
576: FND_MSG_PUB.Add;
577: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
578: RAISE FND_API.G_EXC_ERROR;
579: END IF;
580:
573: --No open receivable found for derivation.
574: --throw exception
575: FND_MESSAGE.SET_NAME('LNS', 'LNS_NO_REC_FOUND');
576: FND_MSG_PUB.Add;
577: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
578: RAISE FND_API.G_EXC_ERROR;
579: END IF;
580:
581: l_last_api_called := 'Bulk insert into lns_loan_lines';
666: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, l_api_name || ' - after rollback');
667: logMessage(FND_LOG.LEVEL_ERROR, G_PKG_NAME, sqlerrm);
668: FND_MESSAGE.SET_NAME('LNS', 'LNS_API_OTHERS_EXCEP');
669: FND_MESSAGE.SET_TOKEN('ERROR' ,'Failed API call: ' || l_last_api_called || ' SQLERRM: ' || SQLERRM);
670: FND_MSG_PUB.ADD;
671: return 0;
672:
673: END GET_RULES_DERIVED_ERS_AMOUNT;
674: