65: l_rowid,
66: x_return_status
67: );
68:
69: IF x_return_status = fnd_api.g_ret_sts_error THEN
70: RAISE fnd_api.g_exc_error;
71: END IF;
72:
73: -- call to table-handler
66: x_return_status
67: );
68:
69: IF x_return_status = fnd_api.g_ret_sts_error THEN
70: RAISE fnd_api.g_exc_error;
71: END IF;
72:
73: -- call to table-handler
74: FUN_RULE_CRITERIA_PKG.Insert_Row (
139:
140: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_RECORD_CHANGED');
141: FND_MESSAGE.SET_TOKEN('TABLE', 'FUN_RULE_OBJECTS');
142: FND_MSG_PUB.ADD;
143: RAISE FND_API.G_EXC_ERROR;
144: END IF;
145:
146: p_object_version_number := nvl(l_object_version_number, 1) + 1;
147:
149: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_NO_RECORD');
150: FND_MESSAGE.SET_TOKEN('RECORD', 'FUN_RULE_OBJECTS');
151: FND_MESSAGE.SET_TOKEN('VALUE', 'rule_object_name');
152: FND_MSG_PUB.ADD;
153: RAISE FND_API.G_EXC_ERROR;
154: END;
155:
156:
157: -- call for validations.
161: l_rowid,
162: x_return_status
163: );
164:
165: IF x_return_status = fnd_api.g_ret_sts_error THEN
166: RAISE fnd_api.g_exc_error;
167: END IF;
168:
169: -- call to table-handler
162: x_return_status
163: );
164:
165: IF x_return_status = fnd_api.g_ret_sts_error THEN
166: RAISE fnd_api.g_exc_error;
167: END IF;
168:
169: -- call to table-handler
170: FUN_RULE_CRITERIA_PKG.Update_Row (
190: *
191: * ARGUMENTS
192: * IN:
193: * p_init_msg_list Initialize message stack if it is set to
194: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
195: * p_rule_criteria_rec Rule Criteria record.
196: * IN/OUT:
197: * OUT:
198: * x_return_status Return status after the call. The status can
195: * p_rule_criteria_rec Rule Criteria record.
196: * IN/OUT:
197: * OUT:
198: * x_return_status Return status after the call. The status can
199: * be FND_API.G_RET_STS_SUCCESS (success),
200: * FND_API.G_RET_STS_ERROR (error),
201: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
202: * x_msg_count Number of messages in message stack.
203: * x_msg_data Message text if x_msg_count is 1.
196: * IN/OUT:
197: * OUT:
198: * x_return_status Return status after the call. The status can
199: * be FND_API.G_RET_STS_SUCCESS (success),
200: * FND_API.G_RET_STS_ERROR (error),
201: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
202: * x_msg_count Number of messages in message stack.
203: * x_msg_data Message text if x_msg_count is 1.
204: *
197: * OUT:
198: * x_return_status Return status after the call. The status can
199: * be FND_API.G_RET_STS_SUCCESS (success),
200: * FND_API.G_RET_STS_ERROR (error),
201: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
202: * x_msg_count Number of messages in message stack.
203: * x_msg_data Message text if x_msg_count is 1.
204: *
205: * NOTES
210: *
211: */
212:
213: PROCEDURE create_rule_criteria(
214: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
215: p_rule_criteria_rec IN RULE_CRITERIA_REC_TYPE,
216: x_criteria_id OUT NOCOPY NUMBER,
217: x_return_status OUT NOCOPY VARCHAR2,
218: x_msg_count OUT NOCOPY NUMBER,
225: -- standard start of API savepoint
226: SAVEPOINT create_rule_criteria;
227:
228: -- initialize message list if p_init_msg_list is set to TRUE.
229: IF FND_API.to_Boolean(p_init_msg_list) THEN
230: FND_MSG_PUB.initialize;
231: END IF;
232:
233: -- initialize API return status to success.
230: FND_MSG_PUB.initialize;
231: END IF;
232:
233: -- initialize API return status to success.
234: x_return_status := FND_API.G_RET_STS_SUCCESS;
235:
236: -- call to business logic.
237: do_create_rule_criteria(
238: l_rule_criteria_rec,
240: x_return_status);
241:
242: -- standard call to get message count and if count is 1, get message info.
243: FND_MSG_PUB.Count_And_Get(
244: p_encoded => FND_API.G_FALSE,
245: p_count => x_msg_count,
246: p_data => x_msg_data);
247:
248: EXCEPTION
245: p_count => x_msg_count,
246: p_data => x_msg_data);
247:
248: EXCEPTION
249: WHEN FND_API.G_EXC_ERROR THEN
250: ROLLBACK TO create_rule_criteria;
251: x_return_status := FND_API.G_RET_STS_ERROR;
252: FND_MSG_PUB.Count_And_Get(
253: p_encoded => FND_API.G_FALSE,
247:
248: EXCEPTION
249: WHEN FND_API.G_EXC_ERROR THEN
250: ROLLBACK TO create_rule_criteria;
251: x_return_status := FND_API.G_RET_STS_ERROR;
252: FND_MSG_PUB.Count_And_Get(
253: p_encoded => FND_API.G_FALSE,
254: p_count => x_msg_count,
255: p_data => x_msg_data);
249: WHEN FND_API.G_EXC_ERROR THEN
250: ROLLBACK TO create_rule_criteria;
251: x_return_status := FND_API.G_RET_STS_ERROR;
252: FND_MSG_PUB.Count_And_Get(
253: p_encoded => FND_API.G_FALSE,
254: p_count => x_msg_count,
255: p_data => x_msg_data);
256:
257: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
253: p_encoded => FND_API.G_FALSE,
254: p_count => x_msg_count,
255: p_data => x_msg_data);
256:
257: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
258: ROLLBACK TO create_rule_criteria;
259: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
260: FND_MSG_PUB.Count_And_Get(
261: p_encoded => FND_API.G_FALSE,
255: p_data => x_msg_data);
256:
257: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
258: ROLLBACK TO create_rule_criteria;
259: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
260: FND_MSG_PUB.Count_And_Get(
261: p_encoded => FND_API.G_FALSE,
262: p_count => x_msg_count,
263: p_data => x_msg_data);
257: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
258: ROLLBACK TO create_rule_criteria;
259: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
260: FND_MSG_PUB.Count_And_Get(
261: p_encoded => FND_API.G_FALSE,
262: p_count => x_msg_count,
263: p_data => x_msg_data);
264:
265: WHEN OTHERS THEN
263: p_data => x_msg_data);
264:
265: WHEN OTHERS THEN
266: ROLLBACK TO create_rule_criteria;
267: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
268: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
269: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
270: FND_MSG_PUB.ADD;
271: FND_MSG_PUB.Count_And_Get(
268: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
269: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
270: FND_MSG_PUB.ADD;
271: FND_MSG_PUB.Count_And_Get(
272: p_encoded => FND_API.G_FALSE,
273: p_count => x_msg_count,
274: p_data => x_msg_data);
275: END create_rule_criteria;
276:
284: *
285: * ARGUMENTS
286: * IN:
287: * p_init_msg_list Initialize message stack if it is set to
288: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
289: * p_rule_criteria_rec Rule Criteria record.
290: * IN/OUT:
291: * p_object_version_number Used for locking the being updated record.
292: * OUT:
290: * IN/OUT:
291: * p_object_version_number Used for locking the being updated record.
292: * OUT:
293: * x_return_status Return status after the call. The status can
294: * be FND_API.G_RET_STS_SUCCESS (success),
295: * FND_API.G_RET_STS_ERROR (error),
296: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
297: * x_msg_count Number of messages in message stack.
298: * x_msg_data Message text if x_msg_count is 1.
291: * p_object_version_number Used for locking the being updated record.
292: * OUT:
293: * x_return_status Return status after the call. The status can
294: * be FND_API.G_RET_STS_SUCCESS (success),
295: * FND_API.G_RET_STS_ERROR (error),
296: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
297: * x_msg_count Number of messages in message stack.
298: * x_msg_data Message text if x_msg_count is 1.
299: *
292: * OUT:
293: * x_return_status Return status after the call. The status can
294: * be FND_API.G_RET_STS_SUCCESS (success),
295: * FND_API.G_RET_STS_ERROR (error),
296: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
297: * x_msg_count Number of messages in message stack.
298: * x_msg_data Message text if x_msg_count is 1.
299: *
300: * NOTES
305: *
306: */
307:
308: PROCEDURE update_rule_criteria (
309: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
310: p_rule_criteria_rec IN RULE_CRITERIA_REC_TYPE,
311: p_object_version_number IN OUT NOCOPY NUMBER,
312: x_return_status OUT NOCOPY VARCHAR2,
313: x_msg_count OUT NOCOPY NUMBER,
321: -- standard start of API savepoint
322: SAVEPOINT update_rule_criteria;
323:
324: -- initialize message list if p_init_msg_list is set to TRUE.
325: IF FND_API.to_Boolean(p_init_msg_list) THEN
326: FND_MSG_PUB.initialize;
327: END IF;
328: -- initialize API return status to success.
329: x_return_status := FND_API.G_RET_STS_SUCCESS;
325: IF FND_API.to_Boolean(p_init_msg_list) THEN
326: FND_MSG_PUB.initialize;
327: END IF;
328: -- initialize API return status to success.
329: x_return_status := FND_API.G_RET_STS_SUCCESS;
330:
331:
332: -- Get old records. Will be used by business event system.
333: get_rule_criteria_rec (
337: x_return_status => x_return_status,
338: x_msg_count => x_msg_count,
339: x_msg_data => x_msg_data );
340:
341: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
342: RAISE FND_API.G_EXC_ERROR;
343: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
344: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
345: END IF;
338: x_msg_count => x_msg_count,
339: x_msg_data => x_msg_data );
340:
341: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
342: RAISE FND_API.G_EXC_ERROR;
343: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
344: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
345: END IF;
346:
339: x_msg_data => x_msg_data );
340:
341: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
342: RAISE FND_API.G_EXC_ERROR;
343: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
344: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
345: END IF;
346:
347: -- call to business logic.
340:
341: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
342: RAISE FND_API.G_EXC_ERROR;
343: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
344: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
345: END IF;
346:
347: -- call to business logic.
348: do_update_rule_criteria(
349: l_rule_criteria_rec,
350: p_object_version_number,
351: x_return_status);
352:
353: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
354:
355: -- standard call to get message count and if count is 1, get message info.
356: FND_MSG_PUB.Count_And_Get(
357: p_encoded => FND_API.G_FALSE,
353: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
354:
355: -- standard call to get message count and if count is 1, get message info.
356: FND_MSG_PUB.Count_And_Get(
357: p_encoded => FND_API.G_FALSE,
358: p_count => x_msg_count,
359: p_data => x_msg_data);
360: END IF;
361:
359: p_data => x_msg_data);
360: END IF;
361:
362: EXCEPTION
363: WHEN FND_API.G_EXC_ERROR THEN
364: ROLLBACK TO update_rule_criteria;
365: x_return_status := FND_API.G_RET_STS_ERROR;
366: FND_MSG_PUB.Count_And_Get(
367: p_encoded => FND_API.G_FALSE,
361:
362: EXCEPTION
363: WHEN FND_API.G_EXC_ERROR THEN
364: ROLLBACK TO update_rule_criteria;
365: x_return_status := FND_API.G_RET_STS_ERROR;
366: FND_MSG_PUB.Count_And_Get(
367: p_encoded => FND_API.G_FALSE,
368: p_count => x_msg_count,
369: p_data => x_msg_data);
363: WHEN FND_API.G_EXC_ERROR THEN
364: ROLLBACK TO update_rule_criteria;
365: x_return_status := FND_API.G_RET_STS_ERROR;
366: FND_MSG_PUB.Count_And_Get(
367: p_encoded => FND_API.G_FALSE,
368: p_count => x_msg_count,
369: p_data => x_msg_data);
370:
371: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
367: p_encoded => FND_API.G_FALSE,
368: p_count => x_msg_count,
369: p_data => x_msg_data);
370:
371: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
372: ROLLBACK TO update_rule_criteria;
373: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
374: FND_MSG_PUB.Count_And_Get(
375: p_encoded => FND_API.G_FALSE,
369: p_data => x_msg_data);
370:
371: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
372: ROLLBACK TO update_rule_criteria;
373: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
374: FND_MSG_PUB.Count_And_Get(
375: p_encoded => FND_API.G_FALSE,
376: p_count => x_msg_count,
377: p_data => x_msg_data);
371: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
372: ROLLBACK TO update_rule_criteria;
373: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
374: FND_MSG_PUB.Count_And_Get(
375: p_encoded => FND_API.G_FALSE,
376: p_count => x_msg_count,
377: p_data => x_msg_data);
378:
379: WHEN OTHERS THEN
377: p_data => x_msg_data);
378:
379: WHEN OTHERS THEN
380: ROLLBACK TO update_rule_criteria;
381: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
382: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
383: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
384: FND_MSG_PUB.ADD;
385: FND_MSG_PUB.Count_And_Get(
382: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
383: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
384: FND_MSG_PUB.ADD;
385: FND_MSG_PUB.Count_And_Get(
386: p_encoded => FND_API.G_FALSE,
387: p_count => x_msg_count,
388: p_data => x_msg_data);
389: END update_rule_criteria;
390:
400: *
401: * ARGUMENTS
402: * IN:
403: * p_init_msg_list Initialize message stack if it is set to
404: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
405: * p_criteria_id Criteria Id
406: * p_RULE_DETAIL_ID Rule Id
407: * IN/OUT:
408: * OUT:
407: * IN/OUT:
408: * OUT:
409: * x_rule_criteria_rec Returned Rule Criteria record.
410: * x_return_status Return status after the call. The status can
411: * be FND_API.G_RET_STS_SUCCESS (success),
412: * FND_API.G_RET_STS_ERROR (error),
413: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
414: * x_msg_count Number of messages in message stack.
415: * x_msg_data Message text if x_msg_count is 1.
408: * OUT:
409: * x_rule_criteria_rec Returned Rule Criteria record.
410: * x_return_status Return status after the call. The status can
411: * be FND_API.G_RET_STS_SUCCESS (success),
412: * FND_API.G_RET_STS_ERROR (error),
413: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
414: * x_msg_count Number of messages in message stack.
415: * x_msg_data Message text if x_msg_count is 1.
416: *
409: * x_rule_criteria_rec Returned Rule Criteria record.
410: * x_return_status Return status after the call. The status can
411: * be FND_API.G_RET_STS_SUCCESS (success),
412: * FND_API.G_RET_STS_ERROR (error),
413: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
414: * x_msg_count Number of messages in message stack.
415: * x_msg_data Message text if x_msg_count is 1.
416: *
417: * NOTES
422: *
423: */
424:
425: PROCEDURE get_rule_criteria_rec (
426: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
427: p_criteria_id IN NUMBER,
428: p_rule_detail_id IN NUMBER,
429: x_rule_criteria_rec OUT NOCOPY RULE_CRITERIA_REC_TYPE,
430: x_return_status OUT NOCOPY VARCHAR2,
433: ) IS
434:
435: BEGIN
436: --Initialize message list if p_init_msg_list is set to TRUE.
437: IF FND_API.to_Boolean(p_init_msg_list) THEN
438: FND_MSG_PUB.initialize;
439: END IF;
440:
441: --Initialize API return status to success.
438: FND_MSG_PUB.initialize;
439: END IF;
440:
441: --Initialize API return status to success.
442: x_return_status := FND_API.G_RET_STS_SUCCESS;
443:
444: --Check whether primary key has been passed in.
445: IF p_criteria_id IS NULL OR
446: p_criteria_id = FND_API.G_MISS_NUM THEN
442: x_return_status := FND_API.G_RET_STS_SUCCESS;
443:
444: --Check whether primary key has been passed in.
445: IF p_criteria_id IS NULL OR
446: p_criteria_id = FND_API.G_MISS_NUM THEN
447: FND_MESSAGE.SET_NAME( 'FUN', 'FUN_RULE_API_MISSING_COLUMN' );
448: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'criteria_id' );
449: FND_MSG_PUB.ADD;
450: RAISE FND_API.G_EXC_ERROR;
446: p_criteria_id = FND_API.G_MISS_NUM THEN
447: FND_MESSAGE.SET_NAME( 'FUN', 'FUN_RULE_API_MISSING_COLUMN' );
448: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'criteria_id' );
449: FND_MSG_PUB.ADD;
450: RAISE FND_API.G_EXC_ERROR;
451: END IF;
452:
453: x_rule_criteria_rec.criteria_id := p_criteria_id;
454: x_rule_criteria_rec.rule_detail_id := p_rule_detail_id;
467:
468:
469: --Standard call to get message count and if count is 1, get message info.
470: FND_MSG_PUB.Count_And_Get(
471: p_encoded => FND_API.G_FALSE,
472: p_count => x_msg_count,
473: p_data => x_msg_data );
474:
475: EXCEPTION
472: p_count => x_msg_count,
473: p_data => x_msg_data );
474:
475: EXCEPTION
476: WHEN FND_API.G_EXC_ERROR THEN
477: x_return_status := FND_API.G_RET_STS_ERROR;
478:
479: FND_MSG_PUB.Count_And_Get(
480: p_encoded => FND_API.G_FALSE,
473: p_data => x_msg_data );
474:
475: EXCEPTION
476: WHEN FND_API.G_EXC_ERROR THEN
477: x_return_status := FND_API.G_RET_STS_ERROR;
478:
479: FND_MSG_PUB.Count_And_Get(
480: p_encoded => FND_API.G_FALSE,
481: p_count => x_msg_count,
476: WHEN FND_API.G_EXC_ERROR THEN
477: x_return_status := FND_API.G_RET_STS_ERROR;
478:
479: FND_MSG_PUB.Count_And_Get(
480: p_encoded => FND_API.G_FALSE,
481: p_count => x_msg_count,
482: p_data => x_msg_data );
483:
484: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
480: p_encoded => FND_API.G_FALSE,
481: p_count => x_msg_count,
482: p_data => x_msg_data );
483:
484: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
485: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
486: FND_MSG_PUB.Count_And_Get(
487: p_encoded => FND_API.G_FALSE,
488: p_count => x_msg_count,
481: p_count => x_msg_count,
482: p_data => x_msg_data );
483:
484: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
485: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
486: FND_MSG_PUB.Count_And_Get(
487: p_encoded => FND_API.G_FALSE,
488: p_count => x_msg_count,
489: p_data => x_msg_data );
483:
484: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
485: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
486: FND_MSG_PUB.Count_And_Get(
487: p_encoded => FND_API.G_FALSE,
488: p_count => x_msg_count,
489: p_data => x_msg_data );
490:
491: WHEN OTHERS THEN
488: p_count => x_msg_count,
489: p_data => x_msg_data );
490:
491: WHEN OTHERS THEN
492: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
493: FND_MESSAGE.SET_NAME( 'FUN', 'FUN_RULE_API_OTHERS_EXCEP' );
494: FND_MESSAGE.SET_TOKEN( 'ERROR' ,SQLERRM );
495: FND_MSG_PUB.ADD;
496:
494: FND_MESSAGE.SET_TOKEN( 'ERROR' ,SQLERRM );
495: FND_MSG_PUB.ADD;
496:
497: FND_MSG_PUB.Count_And_Get(
498: p_encoded => FND_API.G_FALSE,
499: p_count => x_msg_count,
500: p_data => x_msg_data );
501:
502: END get_rule_criteria_rec;
513: *
514: * ARGUMENTS
515: * IN:
516: * p_init_msg_list Initialize message stack if it is set to
517: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
518: * p_criteria_param_name Criteria Param Name.
519: * p_rule_detail_id Rule Detail Id
520: * IN/OUT:
521: * OUT:
519: * p_rule_detail_id Rule Detail Id
520: * IN/OUT:
521: * OUT:
522: * x_return_status Return status after the call. The status can
523: * be FND_API.G_RET_STS_SUCCESS (success),
524: * FND_API.G_RET_STS_ERROR (error),
525: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
526: * x_msg_count Number of messages in message stack.
527: * x_msg_data Message text if x_msg_count is 1.
520: * IN/OUT:
521: * OUT:
522: * x_return_status Return status after the call. The status can
523: * be FND_API.G_RET_STS_SUCCESS (success),
524: * FND_API.G_RET_STS_ERROR (error),
525: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
526: * x_msg_count Number of messages in message stack.
527: * x_msg_data Message text if x_msg_count is 1.
528: *
521: * OUT:
522: * x_return_status Return status after the call. The status can
523: * be FND_API.G_RET_STS_SUCCESS (success),
524: * FND_API.G_RET_STS_ERROR (error),
525: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
526: * x_msg_count Number of messages in message stack.
527: * x_msg_data Message text if x_msg_count is 1.
528: *
529: * NOTES
534: *
535: */
536:
537: PROCEDURE delete_rule_criteria(
538: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
539: p_criteria_id IN NUMBER,
540: x_return_status OUT NOCOPY VARCHAR2,
541: x_msg_count OUT NOCOPY NUMBER,
542: x_msg_data OUT NOCOPY VARCHAR2
548: -- standard start of API savepoint
549: SAVEPOINT delete_rule_criteria;
550:
551: -- initialize message list if p_init_msg_list is set to TRUE.
552: IF FND_API.to_Boolean(p_init_msg_list) THEN
553: FND_MSG_PUB.initialize;
554: END IF;
555:
556: -- initialize API return status to success.
553: FND_MSG_PUB.initialize;
554: END IF;
555:
556: -- initialize API return status to success.
557: x_return_status := FND_API.G_RET_STS_SUCCESS;
558:
559: -- call to table-handler.
560: FUN_RULE_CRITERIA_PKG.Delete_Row (
561: X_CRITERIA_ID =>p_criteria_id
563:
564:
565: -- standard call to get message count and if count is 1, get message info.
566: FND_MSG_PUB.Count_And_Get(
567: p_encoded => FND_API.G_FALSE,
568: p_count => x_msg_count,
569: p_data => x_msg_data);
570:
571:
569: p_data => x_msg_data);
570:
571:
572: EXCEPTION
573: WHEN FND_API.G_EXC_ERROR THEN
574: ROLLBACK TO delete_rule_criteria;
575: x_return_status := FND_API.G_RET_STS_ERROR;
576: FND_MSG_PUB.Count_And_Get(
577: p_encoded => FND_API.G_FALSE,
571:
572: EXCEPTION
573: WHEN FND_API.G_EXC_ERROR THEN
574: ROLLBACK TO delete_rule_criteria;
575: x_return_status := FND_API.G_RET_STS_ERROR;
576: FND_MSG_PUB.Count_And_Get(
577: p_encoded => FND_API.G_FALSE,
578: p_count => x_msg_count,
579: p_data => x_msg_data);
573: WHEN FND_API.G_EXC_ERROR THEN
574: ROLLBACK TO delete_rule_criteria;
575: x_return_status := FND_API.G_RET_STS_ERROR;
576: FND_MSG_PUB.Count_And_Get(
577: p_encoded => FND_API.G_FALSE,
578: p_count => x_msg_count,
579: p_data => x_msg_data);
580:
581: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
577: p_encoded => FND_API.G_FALSE,
578: p_count => x_msg_count,
579: p_data => x_msg_data);
580:
581: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
582: ROLLBACK TO delete_rule_criteria;
583: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
584: FND_MSG_PUB.Count_And_Get(
585: p_encoded => FND_API.G_FALSE,
579: p_data => x_msg_data);
580:
581: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
582: ROLLBACK TO delete_rule_criteria;
583: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
584: FND_MSG_PUB.Count_And_Get(
585: p_encoded => FND_API.G_FALSE,
586: p_count => x_msg_count,
587: p_data => x_msg_data);
581: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
582: ROLLBACK TO delete_rule_criteria;
583: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
584: FND_MSG_PUB.Count_And_Get(
585: p_encoded => FND_API.G_FALSE,
586: p_count => x_msg_count,
587: p_data => x_msg_data);
588:
589: WHEN OTHERS THEN
587: p_data => x_msg_data);
588:
589: WHEN OTHERS THEN
590: ROLLBACK TO delete_rule_criteria;
591: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
592: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
593: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
594: FND_MSG_PUB.ADD;
595: FND_MSG_PUB.Count_And_Get(
592: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
593: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
594: FND_MSG_PUB.ADD;
595: FND_MSG_PUB.Count_And_Get(
596: p_encoded => FND_API.G_FALSE,
597: p_count => x_msg_count,
598: p_data => x_msg_data);
599: END delete_rule_criteria;
600: