72: x_return_status
73: );
74:
75:
76: IF x_return_status = fnd_api.g_ret_sts_error THEN
77: RAISE fnd_api.g_exc_error;
78: END IF;
79:
80:
73: );
74:
75:
76: IF x_return_status = fnd_api.g_ret_sts_error THEN
77: RAISE fnd_api.g_exc_error;
78: END IF;
79:
80:
81: FUN_RULE_CRIT_PARAMS_PKG.Insert_Row (
161: EXCEPTION
162: WHEN NO_DATA_FOUND THEN
163: fnd_message.set_name('FUN', 'FUN_RULE_INVALID_ROB');
164: fnd_msg_pub.add;
165: x_return_status := fnd_api.g_ret_sts_error;
166: END;
167:
168: FOR C_REC IN RULE_CRIT_PARAMS_VL_CUR LOOP
169: l_count := l_count + 1;
179:
180:
181:
182: create_rule_crit_param(
183: p_init_msg_list => FND_API.G_TRUE,
184: p_rule_crit_param_rec => l_rule_crit_param_rec,
185: x_criteria_param_id => x_criteria_param_id,
186: x_return_status => x_return_status,
187: x_msg_count => x_msg_count,
188: x_msg_data => x_msg_data);
189:
190:
191:
192: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
193: RAISE FND_API.G_EXC_ERROR;
194: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
195: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
196: END IF;
189:
190:
191:
192: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
193: RAISE FND_API.G_EXC_ERROR;
194: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
195: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
196: END IF;
197:
190:
191:
192: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
193: RAISE FND_API.G_EXC_ERROR;
194: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
195: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
196: END IF;
197:
198:
191:
192: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
193: RAISE FND_API.G_EXC_ERROR;
194: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
195: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
196: END IF;
197:
198:
199: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
195: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
196: END IF;
197:
198:
199: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
200:
201: -- standard call to get message count and if count is 1, get message info.
202: FND_MSG_PUB.Count_And_Get(
203: p_encoded => FND_API.G_FALSE,
199: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
200:
201: -- standard call to get message count and if count is 1, get message info.
202: FND_MSG_PUB.Count_And_Get(
203: p_encoded => FND_API.G_FALSE,
204: p_count => x_msg_count,
205: p_data => x_msg_data);
206: END IF;
207:
213:
214: EXCEPTION
215: WHEN NO_DATA_FOUND THEN
216:
217: x_return_status := FND_API.G_RET_STS_ERROR;
218: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_INVALID_ROB');
219: FND_MSG_PUB.ADD;
220: FND_MSG_PUB.Count_And_Get(
221: p_encoded => FND_API.G_FALSE,
217: x_return_status := FND_API.G_RET_STS_ERROR;
218: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_INVALID_ROB');
219: FND_MSG_PUB.ADD;
220: FND_MSG_PUB.Count_And_Get(
221: p_encoded => FND_API.G_FALSE,
222: p_count => x_msg_count,
223: p_data => x_msg_data);
224: RAISE FND_API.G_EXC_ERROR;
225:
220: FND_MSG_PUB.Count_And_Get(
221: p_encoded => FND_API.G_FALSE,
222: p_count => x_msg_count,
223: p_data => x_msg_data);
224: RAISE FND_API.G_EXC_ERROR;
225:
226: END;
227:
228: /*===========================================================================+
279: THEN
280: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_RECORD_CHANGED');
281: FND_MESSAGE.SET_TOKEN('TABLE', 'FUN_RULE_CRIT_PARAMS');
282: FND_MSG_PUB.ADD;
283: RAISE FND_API.G_EXC_ERROR;
284: END IF;
285:
286: p_object_version_number := nvl(l_object_version_number, 1) + 1;
287:
289: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_NO_RECORD');
290: FND_MESSAGE.SET_TOKEN('RECORD', 'FUN_RULE_CRIT_PARAMS');
291: FND_MESSAGE.SET_TOKEN('VALUE', 'param_name');
292: FND_MSG_PUB.ADD;
293: RAISE FND_API.G_EXC_ERROR;
294: END;
295:
296:
297: -- Validate for Rule Object Instance, never ever update the criteria parameters for a rule object instance.
308:
309: IF(l_dummy = 'N') THEN
310: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_NO_UPDATE_PARAM');
311: FND_MSG_PUB.ADD;
312: RAISE FND_API.G_EXC_ERROR;
313: END IF;
314:
315:
316: -- call for validations.
320: l_rowid,
321: x_return_status
322: );
323:
324: IF x_return_status = fnd_api.g_ret_sts_error THEN
325: RAISE fnd_api.g_exc_error;
326: END IF;
327:
328:
321: x_return_status
322: );
323:
324: IF x_return_status = fnd_api.g_ret_sts_error THEN
325: RAISE fnd_api.g_exc_error;
326: END IF;
327:
328:
329: -- call to table-handler.
352: *
353: * ARGUMENTS
354: * IN:
355: * p_init_msg_list Initialize message stack if it is set to
356: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
357: * p_rule_crit_param_rec Rules Criteria parameter record
358: * IN/OUT:
359: * OUT:
360: * x_return_status Return status after the call. The status can
357: * p_rule_crit_param_rec Rules Criteria parameter record
358: * IN/OUT:
359: * OUT:
360: * x_return_status Return status after the call. The status can
361: * be FND_API.G_RET_STS_SUCCESS (success),
362: * FND_API.G_RET_STS_ERROR (error),
363: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
364: * x_msg_count Number of messages in message stack.
365: * x_msg_data Message text if x_msg_count is 1.
358: * IN/OUT:
359: * OUT:
360: * x_return_status Return status after the call. The status can
361: * be FND_API.G_RET_STS_SUCCESS (success),
362: * FND_API.G_RET_STS_ERROR (error),
363: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
364: * x_msg_count Number of messages in message stack.
365: * x_msg_data Message text if x_msg_count is 1.
366: *
359: * OUT:
360: * x_return_status Return status after the call. The status can
361: * be FND_API.G_RET_STS_SUCCESS (success),
362: * FND_API.G_RET_STS_ERROR (error),
363: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
364: * x_msg_count Number of messages in message stack.
365: * x_msg_data Message text if x_msg_count is 1.
366: *
367: * NOTES
372: *
373: */
374:
375: PROCEDURE create_rule_crit_param(
376: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
377: p_rule_crit_param_rec IN RULE_CRIT_PARAMS_REC_TYPE,
378: x_criteria_param_id OUT NOCOPY NUMBER,
379: x_return_status OUT NOCOPY VARCHAR2,
380: x_msg_count OUT NOCOPY NUMBER,
388: -- standard start of API savepoint
389: SAVEPOINT create_rule_crit_param;
390:
391: -- initialize message list if p_init_msg_list is set to TRUE.
392: IF FND_API.to_Boolean(p_init_msg_list) THEN
393: FND_MSG_PUB.initialize;
394: END IF;
395:
396: -- initialize API return status to success.
393: FND_MSG_PUB.initialize;
394: END IF;
395:
396: -- initialize API return status to success.
397: x_return_status := FND_API.G_RET_STS_SUCCESS;
398:
399: --Derive the Datatype for ValuSet Based Criteria Param and internally overwrite the same.
400: IF(l_rule_crit_param_rec.flex_value_set_id IS NOT NULL) THEN
401: --Validate if the flex_calue_set_id is Valid or not.
401: --Validate if the flex_calue_set_id is Valid or not.
402: IF (NOT FUN_RULE_VALIDATE_PKG.validate_flex_value_set_id (l_rule_crit_param_rec.flex_value_set_id)) THEN
403: fnd_message.set_name('FUN', 'FUN_RULE_INVALID_VALUESET');
404: fnd_msg_pub.add;
405: x_return_status := fnd_api.g_ret_sts_error;
406: ELSE
407: l_rule_crit_param_rec.data_type := FUN_RULE_UTILITY_PKG.getValueSetDataType(l_rule_crit_param_rec.flex_value_set_id);
408: END IF;
409: END IF;
420: x_return_status);
421:
422: -- standard call to get message count and if count is 1, get message info.
423: FND_MSG_PUB.Count_And_Get(
424: p_encoded => FND_API.G_FALSE,
425: p_count => x_msg_count,
426: p_data => x_msg_data);
427:
428:
427:
428:
429:
430: EXCEPTION
431: WHEN FND_API.G_EXC_ERROR THEN
432: ROLLBACK TO create_rule_crit_param;
433: x_return_status := FND_API.G_RET_STS_ERROR;
434: FND_MSG_PUB.Count_And_Get(
435: p_encoded => FND_API.G_FALSE,
429:
430: EXCEPTION
431: WHEN FND_API.G_EXC_ERROR THEN
432: ROLLBACK TO create_rule_crit_param;
433: x_return_status := FND_API.G_RET_STS_ERROR;
434: FND_MSG_PUB.Count_And_Get(
435: p_encoded => FND_API.G_FALSE,
436: p_count => x_msg_count,
437: p_data => x_msg_data);
431: WHEN FND_API.G_EXC_ERROR THEN
432: ROLLBACK TO create_rule_crit_param;
433: x_return_status := FND_API.G_RET_STS_ERROR;
434: FND_MSG_PUB.Count_And_Get(
435: p_encoded => FND_API.G_FALSE,
436: p_count => x_msg_count,
437: p_data => x_msg_data);
438:
439: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
435: p_encoded => FND_API.G_FALSE,
436: p_count => x_msg_count,
437: p_data => x_msg_data);
438:
439: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
440: ROLLBACK TO create_rule_crit_param;
441: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
442: FND_MSG_PUB.Count_And_Get(
443: p_encoded => FND_API.G_FALSE,
437: p_data => x_msg_data);
438:
439: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
440: ROLLBACK TO create_rule_crit_param;
441: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
442: FND_MSG_PUB.Count_And_Get(
443: p_encoded => FND_API.G_FALSE,
444: p_count => x_msg_count,
445: p_data => x_msg_data);
439: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
440: ROLLBACK TO create_rule_crit_param;
441: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
442: FND_MSG_PUB.Count_And_Get(
443: p_encoded => FND_API.G_FALSE,
444: p_count => x_msg_count,
445: p_data => x_msg_data);
446:
447: WHEN OTHERS THEN
445: p_data => x_msg_data);
446:
447: WHEN OTHERS THEN
448: ROLLBACK TO create_rule_crit_param;
449: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
450: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
451: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
452: FND_MSG_PUB.ADD;
453: FND_MSG_PUB.Count_And_Get(
450: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
451: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
452: FND_MSG_PUB.ADD;
453: FND_MSG_PUB.Count_And_Get(
454: p_encoded => FND_API.G_FALSE,
455: p_count => x_msg_count,
456: p_data => x_msg_data);
457: END create_rule_crit_param;
458:
460: * Use this routine to create duplicate Criteria Parameters for a Rule Object and
461: * its related information.With this API you can create a record in the
462: * FUN_RULE_CRIT_PARAMS_* table.
463: *
464: * p_init_msg_list Initialize message stack if it is set to FND_API.G_TRUE. Default is FND_API.G_FALSE.
465: * p_from_rule_object_id Rule Object Id from which you need to create parameters.
466: * p_to_rule_object_id Rule Object Id For/To which you need to create parameters from p_from_rule_object_id.
467: * x_return_status Return status after the call.
468: * x_msg_count Number of messages in message stack.
471: * 27-Dec-2005 Amulya Mishra Created
472: */
473:
474: PROCEDURE create_dup_rule_crit_params(
475: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
476: p_from_rule_object_id IN NUMBER,
477: p_to_rule_object_id IN NUMBER,
478: x_return_status OUT NOCOPY VARCHAR2,
479: x_msg_count OUT NOCOPY NUMBER,
484: -- standard start of API savepoint
485: SAVEPOINT create_rule_dup_crit_param;
486:
487: -- initialize message list if p_init_msg_list is set to TRUE.
488: IF FND_API.to_Boolean(p_init_msg_list) THEN
489: FND_MSG_PUB.initialize;
490: END IF;
491:
492: -- initialize API return status to success.
489: FND_MSG_PUB.initialize;
490: END IF;
491:
492: -- initialize API return status to success.
493: x_return_status := FND_API.G_RET_STS_SUCCESS;
494:
495: -- call to business logic.
496: do_create_dup_rule_crit_param(
497: p_from_rule_object_id,
499: x_return_status);
500:
501: -- standard call to get message count and if count is 1, get message info.
502: FND_MSG_PUB.Count_And_Get(
503: p_encoded => FND_API.G_FALSE,
504: p_count => x_msg_count,
505: p_data => x_msg_data);
506:
507:
506:
507:
508:
509: EXCEPTION
510: WHEN FND_API.G_EXC_ERROR THEN
511: ROLLBACK TO create_rule_dup_crit_param;
512: x_return_status := FND_API.G_RET_STS_ERROR;
513: FND_MSG_PUB.Count_And_Get(
514: p_encoded => FND_API.G_FALSE,
508:
509: EXCEPTION
510: WHEN FND_API.G_EXC_ERROR THEN
511: ROLLBACK TO create_rule_dup_crit_param;
512: x_return_status := FND_API.G_RET_STS_ERROR;
513: FND_MSG_PUB.Count_And_Get(
514: p_encoded => FND_API.G_FALSE,
515: p_count => x_msg_count,
516: p_data => x_msg_data);
510: WHEN FND_API.G_EXC_ERROR THEN
511: ROLLBACK TO create_rule_dup_crit_param;
512: x_return_status := FND_API.G_RET_STS_ERROR;
513: FND_MSG_PUB.Count_And_Get(
514: p_encoded => FND_API.G_FALSE,
515: p_count => x_msg_count,
516: p_data => x_msg_data);
517:
518: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
514: p_encoded => FND_API.G_FALSE,
515: p_count => x_msg_count,
516: p_data => x_msg_data);
517:
518: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
519: ROLLBACK TO create_rule_dup_crit_param;
520: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
521: FND_MSG_PUB.Count_And_Get(
522: p_encoded => FND_API.G_FALSE,
516: p_data => x_msg_data);
517:
518: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
519: ROLLBACK TO create_rule_dup_crit_param;
520: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
521: FND_MSG_PUB.Count_And_Get(
522: p_encoded => FND_API.G_FALSE,
523: p_count => x_msg_count,
524: p_data => x_msg_data);
518: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
519: ROLLBACK TO create_rule_dup_crit_param;
520: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
521: FND_MSG_PUB.Count_And_Get(
522: p_encoded => FND_API.G_FALSE,
523: p_count => x_msg_count,
524: p_data => x_msg_data);
525:
526: WHEN OTHERS THEN
524: p_data => x_msg_data);
525:
526: WHEN OTHERS THEN
527: ROLLBACK TO create_rule_dup_crit_param;
528: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
529: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
530: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
531: FND_MSG_PUB.ADD;
532: FND_MSG_PUB.Count_And_Get(
529: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
530: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
531: FND_MSG_PUB.ADD;
532: FND_MSG_PUB.Count_And_Get(
533: p_encoded => FND_API.G_FALSE,
534: p_count => x_msg_count,
535: p_data => x_msg_data);
536:
537:
547: *
548: * ARGUMENTS
549: * IN:
550: * p_init_msg_list Initialize message stack if it is set to
551: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
552: * p_rule_crit_param_rec Rules Criteria parameter record.
553: * IN/OUT:
554: * p_object_version_number Used for locking the being updated record.
555: * OUT:
553: * IN/OUT:
554: * p_object_version_number Used for locking the being updated record.
555: * OUT:
556: * x_return_status Return status after the call. The status can
557: * be FND_API.G_RET_STS_SUCCESS (success),
558: * FND_API.G_RET_STS_ERROR (error),
559: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
560: * x_msg_count Number of messages in message stack.
561: * x_msg_data Message text if x_msg_count is 1.
554: * p_object_version_number Used for locking the being updated record.
555: * OUT:
556: * x_return_status Return status after the call. The status can
557: * be FND_API.G_RET_STS_SUCCESS (success),
558: * FND_API.G_RET_STS_ERROR (error),
559: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
560: * x_msg_count Number of messages in message stack.
561: * x_msg_data Message text if x_msg_count is 1.
562: *
555: * OUT:
556: * x_return_status Return status after the call. The status can
557: * be FND_API.G_RET_STS_SUCCESS (success),
558: * FND_API.G_RET_STS_ERROR (error),
559: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
560: * x_msg_count Number of messages in message stack.
561: * x_msg_data Message text if x_msg_count is 1.
562: *
563: * NOTES
568: *
569: */
570:
571: PROCEDURE update_rule_crit_param (
572: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
573: p_rule_crit_param_rec IN RULE_CRIT_PARAMS_REC_TYPE,
574: p_object_version_number IN OUT NOCOPY NUMBER,
575: x_return_status OUT NOCOPY VARCHAR2,
576: x_msg_count OUT NOCOPY NUMBER,
584: -- standard start of API savepoint
585: SAVEPOINT update_rule_crit_param;
586:
587: -- initialize message list if p_init_msg_list is set to TRUE.
588: IF FND_API.to_Boolean(p_init_msg_list) THEN
589: FND_MSG_PUB.initialize;
590: END IF;
591:
592: -- initialize API return status to success.
589: FND_MSG_PUB.initialize;
590: END IF;
591:
592: -- initialize API return status to success.
593: x_return_status := FND_API.G_RET_STS_SUCCESS;
594:
595: -- Get old records. Will be used by business event system.
596: get_rule_crit_param_rec (
597: p_rule_object_id => l_rule_crit_param_rec.rule_object_id,
600: x_return_status => x_return_status,
601: x_msg_count => x_msg_count,
602: x_msg_data => x_msg_data );
603:
604: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
605: RAISE FND_API.G_EXC_ERROR;
606: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
607: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
608: END IF;
601: x_msg_count => x_msg_count,
602: x_msg_data => x_msg_data );
603:
604: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
605: RAISE FND_API.G_EXC_ERROR;
606: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
607: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
608: END IF;
609:
602: x_msg_data => x_msg_data );
603:
604: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
605: RAISE FND_API.G_EXC_ERROR;
606: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
607: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
608: END IF;
609:
610: --Derive the Datatype for ValuSet Based Criteria Param and internally overwrite the same.
603:
604: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
605: RAISE FND_API.G_EXC_ERROR;
606: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
607: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
608: END IF;
609:
610: --Derive the Datatype for ValuSet Based Criteria Param and internally overwrite the same.
611: IF(l_rule_crit_param_rec.flex_value_set_id IS NOT NULL) THEN
622: l_rule_crit_param_rec,
623: p_object_version_number,
624: x_return_status);
625:
626: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
627:
628: -- standard call to get message count and if count is 1, get message info.
629: FND_MSG_PUB.Count_And_Get(
630: p_encoded => FND_API.G_FALSE,
626: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
627:
628: -- standard call to get message count and if count is 1, get message info.
629: FND_MSG_PUB.Count_And_Get(
630: p_encoded => FND_API.G_FALSE,
631: p_count => x_msg_count,
632: p_data => x_msg_data);
633: END IF;
634:
634:
635:
636:
637: EXCEPTION
638: WHEN FND_API.G_EXC_ERROR THEN
639: ROLLBACK TO update_rule_crit_param;
640: x_return_status := FND_API.G_RET_STS_ERROR;
641: FND_MSG_PUB.Count_And_Get(
642: p_encoded => FND_API.G_FALSE,
636:
637: EXCEPTION
638: WHEN FND_API.G_EXC_ERROR THEN
639: ROLLBACK TO update_rule_crit_param;
640: x_return_status := FND_API.G_RET_STS_ERROR;
641: FND_MSG_PUB.Count_And_Get(
642: p_encoded => FND_API.G_FALSE,
643: p_count => x_msg_count,
644: p_data => x_msg_data);
638: WHEN FND_API.G_EXC_ERROR THEN
639: ROLLBACK TO update_rule_crit_param;
640: x_return_status := FND_API.G_RET_STS_ERROR;
641: FND_MSG_PUB.Count_And_Get(
642: p_encoded => FND_API.G_FALSE,
643: p_count => x_msg_count,
644: p_data => x_msg_data);
645:
646: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
642: p_encoded => FND_API.G_FALSE,
643: p_count => x_msg_count,
644: p_data => x_msg_data);
645:
646: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
647: ROLLBACK TO update_rule_crit_param;
648: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
649: FND_MSG_PUB.Count_And_Get(
650: p_encoded => FND_API.G_FALSE,
644: p_data => x_msg_data);
645:
646: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
647: ROLLBACK TO update_rule_crit_param;
648: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
649: FND_MSG_PUB.Count_And_Get(
650: p_encoded => FND_API.G_FALSE,
651: p_count => x_msg_count,
652: p_data => x_msg_data);
646: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
647: ROLLBACK TO update_rule_crit_param;
648: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
649: FND_MSG_PUB.Count_And_Get(
650: p_encoded => FND_API.G_FALSE,
651: p_count => x_msg_count,
652: p_data => x_msg_data);
653:
654: WHEN OTHERS THEN
652: p_data => x_msg_data);
653:
654: WHEN OTHERS THEN
655: ROLLBACK TO update_rule_crit_param;
656: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
657: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
658: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
659: FND_MSG_PUB.ADD;
660: FND_MSG_PUB.Count_And_Get(
657: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
658: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
659: FND_MSG_PUB.ADD;
660: FND_MSG_PUB.Count_And_Get(
661: p_encoded => FND_API.G_FALSE,
662: p_count => x_msg_count,
663: p_data => x_msg_data);
664: END update_rule_crit_param;
665:
675: *
676: * ARGUMENTS
677: * IN:
678: * p_init_msg_list Initialize message stack if it is set to
679: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
680: * p_param_name Rule criteria object name..
681: * IN/OUT:
682: * OUT:
683: * x_rule_crit_param_rec Returned rule criteria param record.
681: * IN/OUT:
682: * OUT:
683: * x_rule_crit_param_rec Returned rule criteria param record.
684: * x_return_status Return status after the call. The status can
685: * be FND_API.G_RET_STS_SUCCESS (success),
686: * FND_API.G_RET_STS_ERROR (error),
687: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
688: * x_msg_count Number of messages in message stack.
689: * x_msg_data Message text if x_msg_count is 1.
682: * OUT:
683: * x_rule_crit_param_rec Returned rule criteria param record.
684: * x_return_status Return status after the call. The status can
685: * be FND_API.G_RET_STS_SUCCESS (success),
686: * FND_API.G_RET_STS_ERROR (error),
687: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
688: * x_msg_count Number of messages in message stack.
689: * x_msg_data Message text if x_msg_count is 1.
690: *
683: * x_rule_crit_param_rec Returned rule criteria param record.
684: * x_return_status Return status after the call. The status can
685: * be FND_API.G_RET_STS_SUCCESS (success),
686: * FND_API.G_RET_STS_ERROR (error),
687: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
688: * x_msg_count Number of messages in message stack.
689: * x_msg_data Message text if x_msg_count is 1.
690: *
691: * NOTES
696: *
697: */
698:
699: PROCEDURE get_rule_crit_param_rec (
700: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
701: p_rule_object_id IN NUMBER,
702: p_param_name IN VARCHAR2,
703: x_rule_crit_param_rec OUT NOCOPY RULE_CRIT_PARAMS_REC_TYPE,
704: x_return_status OUT NOCOPY VARCHAR2,
708: cpid number;
709: BEGIN
710:
711: --Initialize message list if p_init_msg_list is set to TRUE.
712: IF FND_API.to_Boolean(p_init_msg_list) THEN
713: FND_MSG_PUB.initialize;
714: END IF;
715:
716: --Initialize API return status to success.
713: FND_MSG_PUB.initialize;
714: END IF;
715:
716: --Initialize API return status to success.
717: x_return_status := FND_API.G_RET_STS_SUCCESS;
718:
719: SELECT cp.criteria_param_id
720: INTO cpid
721: FROM fun_rule_crit_params_b cp
737: );
738:
739: --Standard call to get message count and if count is 1, get message info.
740: FND_MSG_PUB.Count_And_Get(
741: p_encoded => FND_API.G_FALSE,
742: p_count => x_msg_count,
743: p_data => x_msg_data );
744:
745:
743: p_data => x_msg_data );
744:
745:
746: EXCEPTION
747: WHEN FND_API.G_EXC_ERROR THEN
748: x_return_status := FND_API.G_RET_STS_ERROR;
749:
750: FND_MSG_PUB.Count_And_Get(
751: p_encoded => FND_API.G_FALSE,
744:
745:
746: EXCEPTION
747: WHEN FND_API.G_EXC_ERROR THEN
748: x_return_status := FND_API.G_RET_STS_ERROR;
749:
750: FND_MSG_PUB.Count_And_Get(
751: p_encoded => FND_API.G_FALSE,
752: p_count => x_msg_count,
747: WHEN FND_API.G_EXC_ERROR THEN
748: x_return_status := FND_API.G_RET_STS_ERROR;
749:
750: FND_MSG_PUB.Count_And_Get(
751: p_encoded => FND_API.G_FALSE,
752: p_count => x_msg_count,
753: p_data => x_msg_data );
754:
755: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
751: p_encoded => FND_API.G_FALSE,
752: p_count => x_msg_count,
753: p_data => x_msg_data );
754:
755: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
756: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
757:
758: FND_MSG_PUB.Count_And_Get(
759: p_encoded => FND_API.G_FALSE,
752: p_count => x_msg_count,
753: p_data => x_msg_data );
754:
755: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
756: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
757:
758: FND_MSG_PUB.Count_And_Get(
759: p_encoded => FND_API.G_FALSE,
760: p_count => x_msg_count,
755: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
756: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
757:
758: FND_MSG_PUB.Count_And_Get(
759: p_encoded => FND_API.G_FALSE,
760: p_count => x_msg_count,
761: p_data => x_msg_data );
762:
763: WHEN OTHERS THEN
760: p_count => x_msg_count,
761: p_data => x_msg_data );
762:
763: WHEN OTHERS THEN
764: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
765:
766: FND_MESSAGE.SET_NAME( 'FUN', 'FUN_RULE_API_OTHERS_EXCEP' );
767: FND_MESSAGE.SET_TOKEN( 'ERROR' ,SQLERRM );
768: FND_MSG_PUB.ADD;
767: FND_MESSAGE.SET_TOKEN( 'ERROR' ,SQLERRM );
768: FND_MSG_PUB.ADD;
769:
770: FND_MSG_PUB.Count_And_Get(
771: p_encoded => FND_API.G_FALSE,
772: p_count => x_msg_count,
773: p_data => x_msg_data );
774:
775: END get_rule_crit_param_rec;
786: *
787: * ARGUMENTS
788: * IN:
789: * p_init_msg_list Initialize message stack if it is set to
790: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
791: * p_param_name Object Param Name.
792: * p_rule_object_id Rule Object Id
793: * IN/OUT:
794: * OUT:
792: * p_rule_object_id Rule Object Id
793: * IN/OUT:
794: * OUT:
795: * x_return_status Return status after the call. The status can
796: * be FND_API.G_RET_STS_SUCCESS (success),
797: * FND_API.G_RET_STS_ERROR (error),
798: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
799: * x_msg_count Number of messages in message stack.
800: * x_msg_data Message text if x_msg_count is 1.
793: * IN/OUT:
794: * OUT:
795: * x_return_status Return status after the call. The status can
796: * be FND_API.G_RET_STS_SUCCESS (success),
797: * FND_API.G_RET_STS_ERROR (error),
798: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
799: * x_msg_count Number of messages in message stack.
800: * x_msg_data Message text if x_msg_count is 1.
801: *
794: * OUT:
795: * x_return_status Return status after the call. The status can
796: * be FND_API.G_RET_STS_SUCCESS (success),
797: * FND_API.G_RET_STS_ERROR (error),
798: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
799: * x_msg_count Number of messages in message stack.
800: * x_msg_data Message text if x_msg_count is 1.
801: *
802: * NOTES
807: *
808: */
809:
810: PROCEDURE delete_rule_crit_param(
811: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
812: p_criteria_param_id IN NUMBER,
813: x_return_status OUT NOCOPY VARCHAR2,
814: x_msg_count OUT NOCOPY NUMBER,
815: x_msg_data OUT NOCOPY VARCHAR2
821: -- standard start of API savepoint
822: SAVEPOINT delete_rule_crit_param;
823:
824: -- initialize message list if p_init_msg_list is set to TRUE.
825: IF FND_API.to_Boolean(p_init_msg_list) THEN
826: FND_MSG_PUB.initialize;
827: END IF;
828:
829: -- initialize API return status to success.
826: FND_MSG_PUB.initialize;
827: END IF;
828:
829: -- initialize API return status to success.
830: x_return_status := FND_API.G_RET_STS_SUCCESS;
831:
832: -- call to table-handler.
833: FUN_RULE_CRIT_PARAMS_PKG.Delete_Row (
834: X_CRITERIA_PARAM_ID =>p_criteria_param_id
836:
837:
838: -- standard call to get message count and if count is 1, get message info.
839: FND_MSG_PUB.Count_And_Get(
840: p_encoded => FND_API.G_FALSE,
841: p_count => x_msg_count,
842: p_data => x_msg_data);
843:
844:
842: p_data => x_msg_data);
843:
844:
845: EXCEPTION
846: WHEN FND_API.G_EXC_ERROR THEN
847: ROLLBACK TO delete_rule_crit_param;
848: x_return_status := FND_API.G_RET_STS_ERROR;
849: FND_MSG_PUB.Count_And_Get(
850: p_encoded => FND_API.G_FALSE,
844:
845: EXCEPTION
846: WHEN FND_API.G_EXC_ERROR THEN
847: ROLLBACK TO delete_rule_crit_param;
848: x_return_status := FND_API.G_RET_STS_ERROR;
849: FND_MSG_PUB.Count_And_Get(
850: p_encoded => FND_API.G_FALSE,
851: p_count => x_msg_count,
852: p_data => x_msg_data);
846: WHEN FND_API.G_EXC_ERROR THEN
847: ROLLBACK TO delete_rule_crit_param;
848: x_return_status := FND_API.G_RET_STS_ERROR;
849: FND_MSG_PUB.Count_And_Get(
850: p_encoded => FND_API.G_FALSE,
851: p_count => x_msg_count,
852: p_data => x_msg_data);
853:
854: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
850: p_encoded => FND_API.G_FALSE,
851: p_count => x_msg_count,
852: p_data => x_msg_data);
853:
854: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
855: ROLLBACK TO delete_rule_crit_param;
856: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
857: FND_MSG_PUB.Count_And_Get(
858: p_encoded => FND_API.G_FALSE,
852: p_data => x_msg_data);
853:
854: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
855: ROLLBACK TO delete_rule_crit_param;
856: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
857: FND_MSG_PUB.Count_And_Get(
858: p_encoded => FND_API.G_FALSE,
859: p_count => x_msg_count,
860: p_data => x_msg_data);
854: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
855: ROLLBACK TO delete_rule_crit_param;
856: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
857: FND_MSG_PUB.Count_And_Get(
858: p_encoded => FND_API.G_FALSE,
859: p_count => x_msg_count,
860: p_data => x_msg_data);
861:
862: WHEN OTHERS THEN
860: p_data => x_msg_data);
861:
862: WHEN OTHERS THEN
863: ROLLBACK TO delete_rule_crit_param;
864: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
865: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
866: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
867: FND_MSG_PUB.ADD;
868: FND_MSG_PUB.Count_And_Get(
865: FND_MESSAGE.SET_NAME('FUN', 'FUN_RULE_API_OTHERS_EXCEP');
866: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
867: FND_MSG_PUB.ADD;
868: FND_MSG_PUB.Count_And_Get(
869: p_encoded => FND_API.G_FALSE,
870: p_count => x_msg_count,
871: p_data => x_msg_data);
872: END delete_rule_crit_param;
873: