122: l_rowid,
123: x_return_status
124: );
125:
126: IF x_return_status = fnd_api.g_ret_sts_error THEN
127: RAISE fnd_api.g_exc_error;
128: END IF;
129:
130: -- Debug info.
123: x_return_status
124: );
125:
126: IF x_return_status = fnd_api.g_ret_sts_error THEN
127: RAISE fnd_api.g_exc_error;
128: END IF;
129:
130: -- Debug info.
131: IF fnd_log.level_procedure>=fnd_log.g_current_runtime_level THEN
198: THEN
199: FND_MESSAGE.SET_NAME('AR', 'HZ_API_RECORD_CHANGED');
200: FND_MESSAGE.SET_TOKEN('TABLE', 'hz_styles');
201: FND_MSG_PUB.ADD;
202: RAISE FND_API.G_EXC_ERROR;
203: END IF;
204:
205: p_object_version_number := nvl(l_object_version_number, 1) + 1;
206:
208: FND_MESSAGE.SET_NAME('AR', 'HZ_API_NO_RECORD');
209: FND_MESSAGE.SET_TOKEN('RECORD', 'style');
210: FND_MESSAGE.SET_TOKEN('VALUE', NVL(( p_style_rec.style_code), 'null'));
211: FND_MSG_PUB.ADD;
212: RAISE FND_API.G_EXC_ERROR;
213: END;
214:
215: -- validate style record
216: HZ_NAME_ADDRESS_FMT_VALIDATE.validate_style(
218: p_style_rec,
219: l_rowid,
220: x_return_status);
221:
222: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
223: RAISE FND_API.G_EXC_ERROR;
224: END IF;
225:
226: -- Debug info.
219: l_rowid,
220: x_return_status);
221:
222: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
223: RAISE FND_API.G_EXC_ERROR;
224: END IF;
225:
226: -- Debug info.
227: IF fnd_log.level_procedure>=fnd_log.g_current_runtime_level THEN
270: *
271: * ARGUMENTS
272: * IN:
273: * p_init_msg_list Initialize message stack if it is set to
274: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
275: * p_style_rec Style record.
276: * IN/OUT:
277: * OUT:
278: * x_return_status Return status after the call. The status can
275: * p_style_rec Style record.
276: * IN/OUT:
277: * OUT:
278: * x_return_status Return status after the call. The status can
279: * be FND_API.G_RET_STS_SUCCESS (success),
280: * FND_API.G_RET_STS_ERROR (error),
281: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
282: * x_msg_count Number of messages in message stack.
283: * x_msg_data Message text if x_msg_count is 1.
276: * IN/OUT:
277: * OUT:
278: * x_return_status Return status after the call. The status can
279: * be FND_API.G_RET_STS_SUCCESS (success),
280: * FND_API.G_RET_STS_ERROR (error),
281: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
282: * x_msg_count Number of messages in message stack.
283: * x_msg_data Message text if x_msg_count is 1.
284: *
277: * OUT:
278: * x_return_status Return status after the call. The status can
279: * be FND_API.G_RET_STS_SUCCESS (success),
280: * FND_API.G_RET_STS_ERROR (error),
281: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
282: * x_msg_count Number of messages in message stack.
283: * x_msg_data Message text if x_msg_count is 1.
284: *
285: * NOTES
290: *
291: */
292:
293: PROCEDURE create_style (
294: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
295: p_style_rec IN STYLE_REC_TYPE,
296: x_return_status OUT NOCOPY VARCHAR2,
297: x_msg_count OUT NOCOPY NUMBER,
298: x_msg_data OUT NOCOPY VARCHAR2
315: p_msg_level=>fnd_log.level_procedure);
316: END IF;
317:
318: -- initialize message list if p_init_msg_list is set to TRUE.
319: IF FND_API.to_Boolean(p_init_msg_list) THEN
320: FND_MSG_PUB.initialize;
321: END IF;
322:
323: -- initialize API return status to success.
320: FND_MSG_PUB.initialize;
321: END IF;
322:
323: -- initialize API return status to success.
324: x_return_status := FND_API.G_RET_STS_SUCCESS;
325:
326: -- call to business logic.
327: do_create_style(
328: l_style_rec,
329: x_return_status);
330:
331: -- standard call to get message count and if count is 1, get message info.
332: FND_MSG_PUB.Count_And_Get(
333: p_encoded => FND_API.G_FALSE,
334: p_count => x_msg_count,
335: p_data => x_msg_data);
336: -- Debug info.
337: IF fnd_log.level_exception>=fnd_log.g_current_runtime_level THEN
349: -- Check if API is called in debug mode. If yes, disable debug.
350: --disable_debug;
351:
352: EXCEPTION
353: WHEN FND_API.G_EXC_ERROR THEN
354: ROLLBACK TO create_style;
355: x_return_status := FND_API.G_RET_STS_ERROR;
356: FND_MSG_PUB.Count_And_Get(
357: p_encoded => FND_API.G_FALSE,
351:
352: EXCEPTION
353: WHEN FND_API.G_EXC_ERROR THEN
354: ROLLBACK TO create_style;
355: x_return_status := FND_API.G_RET_STS_ERROR;
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);
353: WHEN FND_API.G_EXC_ERROR THEN
354: ROLLBACK TO create_style;
355: x_return_status := FND_API.G_RET_STS_ERROR;
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:
361: -- Debug info.
373:
374: -- Check if API is called in debug mode. If yes, disable debug.
375: --disable_debug;
376:
377: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
378: ROLLBACK TO create_style;
379: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
380: FND_MSG_PUB.Count_And_Get(
381: p_encoded => FND_API.G_FALSE,
375: --disable_debug;
376:
377: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
378: ROLLBACK TO create_style;
379: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
380: FND_MSG_PUB.Count_And_Get(
381: p_encoded => FND_API.G_FALSE,
382: p_count => x_msg_count,
383: p_data => x_msg_data);
377: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
378: ROLLBACK TO create_style;
379: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
380: FND_MSG_PUB.Count_And_Get(
381: p_encoded => FND_API.G_FALSE,
382: p_count => x_msg_count,
383: p_data => x_msg_data);
384:
385: -- Debug info.
399: --disable_debug;
400:
401: WHEN OTHERS THEN
402: ROLLBACK TO create_style;
403: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
404:
405: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
406: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
407: FND_MSG_PUB.ADD;
406: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
407: FND_MSG_PUB.ADD;
408:
409: FND_MSG_PUB.Count_And_Get(
410: p_encoded => FND_API.G_FALSE,
411: p_count => x_msg_count,
412: p_data => x_msg_data);
413:
414: -- Debug info.
440: *
441: * ARGUMENTS
442: * IN:
443: * p_init_msg_list Initialize message stack if it is set to
444: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
445: * p_style_rec Style record.
446: * IN/OUT:
447: * p_object_version_number Used for locking the being updated record.
448: * OUT:
446: * IN/OUT:
447: * p_object_version_number Used for locking the being updated record.
448: * OUT:
449: * x_return_status Return status after the call. The status can
450: * be FND_API.G_RET_STS_SUCCESS (success),
451: * FND_API.G_RET_STS_ERROR (error),
452: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
453: * x_msg_count Number of messages in message stack.
454: * x_msg_data Message text if x_msg_count is 1.
447: * p_object_version_number Used for locking the being updated record.
448: * OUT:
449: * x_return_status Return status after the call. The status can
450: * be FND_API.G_RET_STS_SUCCESS (success),
451: * FND_API.G_RET_STS_ERROR (error),
452: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
453: * x_msg_count Number of messages in message stack.
454: * x_msg_data Message text if x_msg_count is 1.
455: *
448: * OUT:
449: * x_return_status Return status after the call. The status can
450: * be FND_API.G_RET_STS_SUCCESS (success),
451: * FND_API.G_RET_STS_ERROR (error),
452: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
453: * x_msg_count Number of messages in message stack.
454: * x_msg_data Message text if x_msg_count is 1.
455: *
456: * NOTES
461: *
462: */
463:
464: PROCEDURE update_style (
465: p_init_msg_list IN VARCHAR2 :=FND_API.G_FALSE,
466: p_style_rec IN STYLE_REC_TYPE,
467: p_object_version_number IN OUT NOCOPY NUMBER,
468: x_return_status OUT NOCOPY VARCHAR2,
469: x_msg_count OUT NOCOPY NUMBER,
489: p_msg_level=>fnd_log.level_procedure);
490: END IF;
491:
492: -- initialize message list if p_init_msg_list is set to TRUE.
493: IF FND_API.to_Boolean(p_init_msg_list) THEN
494: FND_MSG_PUB.initialize;
495: END IF;
496:
497: -- initialize API return status to success.
494: FND_MSG_PUB.initialize;
495: END IF;
496:
497: -- initialize API return status to success.
498: x_return_status := FND_API.G_RET_STS_SUCCESS;
499:
500: -- call to business logic.
501: do_update_style(
502: l_style_rec,
504: x_return_status);
505:
506: -- standard call to get message count and if count is 1, get message info.
507: FND_MSG_PUB.Count_And_Get(
508: p_encoded => FND_API.G_FALSE,
509: p_count => x_msg_count,
510: p_data => x_msg_data);
511:
512: -- Debug info.
525: -- Check if API is called in debug mode. If yes, disable debug.
526: --disable_debug;
527:
528: EXCEPTION
529: WHEN FND_API.G_EXC_ERROR THEN
530: ROLLBACK TO update_style;
531: x_return_status := FND_API.G_RET_STS_ERROR;
532: FND_MSG_PUB.Count_And_Get(
533: p_encoded => FND_API.G_FALSE,
527:
528: EXCEPTION
529: WHEN FND_API.G_EXC_ERROR THEN
530: ROLLBACK TO update_style;
531: x_return_status := FND_API.G_RET_STS_ERROR;
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);
529: WHEN FND_API.G_EXC_ERROR THEN
530: ROLLBACK TO update_style;
531: x_return_status := FND_API.G_RET_STS_ERROR;
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: -- Debug info.
549:
550: -- Check if API is called in debug mode. If yes, disable debug.
551: --disable_debug;
552:
553: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
554: ROLLBACK TO update_style;
555: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
556: FND_MSG_PUB.Count_And_Get(
557: p_encoded => FND_API.G_FALSE,
551: --disable_debug;
552:
553: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
554: ROLLBACK TO update_style;
555: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
556: FND_MSG_PUB.Count_And_Get(
557: p_encoded => FND_API.G_FALSE,
558: p_count => x_msg_count,
559: p_data => x_msg_data);
553: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
554: ROLLBACK TO update_style;
555: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
556: FND_MSG_PUB.Count_And_Get(
557: p_encoded => FND_API.G_FALSE,
558: p_count => x_msg_count,
559: p_data => x_msg_data);
560:
561: -- Debug info.
575: --disable_debug;
576:
577: WHEN OTHERS THEN
578: ROLLBACK TO update_style;
579: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
580:
581: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
582: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
583: FND_MSG_PUB.ADD;
582: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
583: FND_MSG_PUB.ADD;
584:
585: FND_MSG_PUB.Count_And_Get(
586: p_encoded => FND_API.G_FALSE,
587: p_count => x_msg_count,
588: p_data => x_msg_data);
589:
590: -- Debug info.
616: *
617: * ARGUMENTS
618: * IN:
619: * p_init_msg_list Initialize message stack if it is set to
620: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
621: * p_style_code Style Code.
622: * IN/OUT:
623: * OUT:
624: * x_style_rec Style record.
622: * IN/OUT:
623: * OUT:
624: * x_style_rec Style record.
625: * x_return_status Return status after the call. The status can
626: * be FND_API.G_RET_STS_SUCCESS (success),
627: * FND_API.G_RET_STS_ERROR (error),
628: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
629: * x_msg_count Number of messages in message stack.
630: * x_msg_data Message text if x_msg_count is 1.
623: * OUT:
624: * x_style_rec Style record.
625: * x_return_status Return status after the call. The status can
626: * be FND_API.G_RET_STS_SUCCESS (success),
627: * FND_API.G_RET_STS_ERROR (error),
628: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
629: * x_msg_count Number of messages in message stack.
630: * x_msg_data Message text if x_msg_count is 1.
631: *
624: * x_style_rec Style record.
625: * x_return_status Return status after the call. The status can
626: * be FND_API.G_RET_STS_SUCCESS (success),
627: * FND_API.G_RET_STS_ERROR (error),
628: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
629: * x_msg_count Number of messages in message stack.
630: * x_msg_data Message text if x_msg_count is 1.
631: *
632: * NOTES
637: *
638: */
639:
640: PROCEDURE get_style_rec (
641: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
642: p_style_code IN VARCHAR2,
643: x_style_rec OUT NOCOPY STYLE_REC_TYPE,
644: x_return_status OUT NOCOPY VARCHAR2,
645: x_msg_count OUT NOCOPY NUMBER,
657: p_msg_level=>fnd_log.level_procedure);
658: END IF;
659:
660: -- Initialize message list if p_init_msg_list is set to TRUE.
661: IF fnd_api.to_boolean(p_init_msg_list) THEN
662: fnd_msg_pub.initialize;
663: END IF;
664:
665: -- Initialize API return status to success.
662: fnd_msg_pub.initialize;
663: END IF;
664:
665: -- Initialize API return status to success.
666: x_return_status := fnd_api.g_ret_sts_success;
667:
668: -- Check whether primary key has been passed in.
669: IF p_style_code IS NULL OR
670: p_style_code = fnd_api.g_miss_char THEN
666: x_return_status := fnd_api.g_ret_sts_success;
667:
668: -- Check whether primary key has been passed in.
669: IF p_style_code IS NULL OR
670: p_style_code = fnd_api.g_miss_char THEN
671: fnd_message.set_name('AR', 'HZ_API_MISSING_COLUMN');
672: fnd_message.set_token('COLUMN', 'style_code');
673: fnd_msg_pub.add;
674: RAISE fnd_api.g_exc_error;
670: p_style_code = fnd_api.g_miss_char THEN
671: fnd_message.set_name('AR', 'HZ_API_MISSING_COLUMN');
672: fnd_message.set_token('COLUMN', 'style_code');
673: fnd_msg_pub.add;
674: RAISE fnd_api.g_exc_error;
675: END IF;
676:
677: x_style_rec.style_code := p_style_code;
678:
698: END IF;
699:
700: --Standard call to get message count and if count is 1, get message info.
701: fnd_msg_pub.count_and_get(
702: p_encoded => fnd_api.g_false,
703: p_count => x_msg_count,
704: p_data => x_msg_data
705: );
706:
719:
720: -- Check if API is called in debug mode. If yes, disable debug.
721: --disable_debug;
722: EXCEPTION
723: WHEN fnd_api.g_exc_error THEN
724: x_return_status := fnd_api.g_ret_sts_error;
725: fnd_msg_pub.count_and_get(
726: p_encoded => fnd_api.g_false,
727: p_count => x_msg_count,
720: -- Check if API is called in debug mode. If yes, disable debug.
721: --disable_debug;
722: EXCEPTION
723: WHEN fnd_api.g_exc_error THEN
724: x_return_status := fnd_api.g_ret_sts_error;
725: fnd_msg_pub.count_and_get(
726: p_encoded => fnd_api.g_false,
727: p_count => x_msg_count,
728: p_data => x_msg_data
722: EXCEPTION
723: WHEN fnd_api.g_exc_error THEN
724: x_return_status := fnd_api.g_ret_sts_error;
725: fnd_msg_pub.count_and_get(
726: p_encoded => fnd_api.g_false,
727: p_count => x_msg_count,
728: p_data => x_msg_data
729: );
730:
743:
744: -- Check if API is called in debug mode. If yes, disable debug.
745: --disable_debug;
746:
747: WHEN fnd_api.g_exc_unexpected_error THEN
748: x_return_status := fnd_api.g_ret_sts_unexp_error;
749:
750: fnd_msg_pub.count_and_get(
751: p_encoded => fnd_api.g_false,
744: -- Check if API is called in debug mode. If yes, disable debug.
745: --disable_debug;
746:
747: WHEN fnd_api.g_exc_unexpected_error THEN
748: x_return_status := fnd_api.g_ret_sts_unexp_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_unexpected_error THEN
748: x_return_status := fnd_api.g_ret_sts_unexp_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:
769: -- Check if API is called in debug mode. If yes, disable debug.
770: --disable_debug;
771:
772: WHEN OTHERS THEN
773: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
774:
775: fnd_message.set_name('AR', 'HZ_API_OTHERS_EXCEP');
776: fnd_message.set_token('ERROR' ,SQLERRM);
777: fnd_msg_pub.add;
776: fnd_message.set_token('ERROR' ,SQLERRM);
777: fnd_msg_pub.add;
778:
779: fnd_msg_pub.count_and_get(
780: p_encoded => fnd_api.g_false,
781: p_count => x_msg_count,
782: p_data => x_msg_data
783: );
784: