61:
62: -- Initialize API message list if necessary
63: IF FND_API.To_Boolean(p_init_msg_list)
64: THEN
65: FND_MSG_PUB.Initialize;
66: END IF;
67:
68: -- Check for message level threshold
69: l_msg_level_threshold := FND_PROFILE.Value('FND_AS_MSG_LEVEL_THRESHOLD');
71:
72: -- Check for the value of p_commit
73: IF NOT FND_API.To_Boolean(p_commit)
74: THEN
75: FND_MSG_PUB.Add_Exc_Msg(
76: p_pkg_name => G_PKG_NAME,
77: p_procedure_name => l_api_name,
78: p_error_text => 'This API should not be called with p_commit set to false'
79: );
79: );
80: RAISE FND_API.G_EXC_ERROR;
81: END IF;
82:
83: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH
84: THEN
85: FND_MSG_PUB.Add_Exc_Msg(
86: p_pkg_name => G_PKG_NAME,
87: p_procedure_name => l_api_name,
81: END IF;
82:
83: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH
84: THEN
85: FND_MSG_PUB.Add_Exc_Msg(
86: p_pkg_name => G_PKG_NAME,
87: p_procedure_name => l_api_name,
88: p_error_text => SUBSTR(
89: l_stmt_num||':'||
252: END IF;
253:
254:
255: l_stmt_num := 80;
256: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_SUCCESS
257: THEN
258: FND_MSG_PUB.Add_Exc_Msg(
259: p_pkg_name => G_PKG_NAME,
260: p_procedure_name => l_api_name,
254:
255: l_stmt_num := 80;
256: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_SUCCESS
257: THEN
258: FND_MSG_PUB.Add_Exc_Msg(
259: p_pkg_name => G_PKG_NAME,
260: p_procedure_name => l_api_name,
261: p_error_text => l_stmt_num||': Finished calculating inventory value'
262: );
271: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
272: WHEN OTHERS THEN
273: ROLLBACK TO Calculate_InventoryValue_PUB;
274: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
275: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
276: THEN
277: FND_MSG_PUB.Add_Exc_Msg(
278: p_pkg_name => G_PKG_NAME,
279: p_procedure_name => l_api_name,
273: ROLLBACK TO Calculate_InventoryValue_PUB;
274: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
275: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
276: THEN
277: FND_MSG_PUB.Add_Exc_Msg(
278: p_pkg_name => G_PKG_NAME,
279: p_procedure_name => l_api_name,
280: p_error_text => SUBSTR(l_stmt_num||SQLERRM,1,240)
281: );