114: END IF;
115:
116: -- start_date_active default to sysdate
117: IF p_style_fmt_variation_rec.start_date_active is null OR
118: p_style_fmt_variation_rec.start_date_active = FND_API.G_MISS_DATE
119: THEN
120: p_style_fmt_variation_rec.start_date_active := sysdate;
121: END IF;
122:
127: l_rowid,
128: x_return_status
129: );
130:
131: IF x_return_status = fnd_api.g_ret_sts_error THEN
132: RAISE fnd_api.g_exc_error;
133: END IF;
134:
135: -- Debug info.
128: x_return_status
129: );
130:
131: IF x_return_status = fnd_api.g_ret_sts_error THEN
132: RAISE fnd_api.g_exc_error;
133: END IF;
134:
135: -- Debug info.
136: IF fnd_log.level_procedure>=fnd_log.g_current_runtime_level THEN
216: THEN
217: FND_MESSAGE.SET_NAME('AR', 'HZ_API_RECORD_CHANGED');
218: FND_MESSAGE.SET_TOKEN('TABLE', 'hz_style_fmt_variations');
219: FND_MSG_PUB.ADD;
220: RAISE FND_API.G_EXC_ERROR;
221: END IF;
222:
223: p_object_version_number := nvl(l_object_version_number, 1) + 1;
224:
227: FND_MESSAGE.SET_TOKEN('RECORD', 'style format variation');
228: FND_MESSAGE.SET_TOKEN('VALUE', NVL(( p_style_fmt_variation_rec.style_format_code || ',' ||
229: p_style_fmt_variation_rec.variation_number ), 'null'));
230: FND_MSG_PUB.ADD;
231: RAISE FND_API.G_EXC_ERROR;
232: END;
233:
234: -- validate style format variation record
235: HZ_NAME_ADDRESS_FMT_VALIDATE.validate_style_fmt_variation(
237: p_style_fmt_variation_rec,
238: l_rowid,
239: x_return_status);
240:
241: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
242: RAISE FND_API.G_EXC_ERROR;
243: END IF;
244:
245: -- Debug info.
238: l_rowid,
239: x_return_status);
240:
241: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
242: RAISE FND_API.G_EXC_ERROR;
243: END IF;
244:
245: -- Debug info.
246: IF fnd_log.level_procedure>=fnd_log.g_current_runtime_level THEN
267: p_msg_level=>fnd_log.level_procedure);
268: END IF;
269:
270: IF p_style_fmt_variation_rec.end_date_active is not null AND
271: p_style_fmt_variation_rec.end_date_active <> fnd_api.g_miss_date THEN
272:
273: update hz_style_fmt_layouts_b
274: set end_date_active = p_style_fmt_variation_rec.end_date_active
275: where style_format_code=l_style_format_code AND
300: *
301: * ARGUMENTS
302: * IN:
303: * p_init_msg_list Initialize message stack if it is set to
304: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
305: * p_style_fmt_variation_rec Style record.
306: * IN/OUT:
307: * OUT:
308: * p_style_fmt_variation_id style_fmt_variation id
306: * IN/OUT:
307: * OUT:
308: * p_style_fmt_variation_id style_fmt_variation id
309: * x_return_status Return status after the call. The status can
310: * be FND_API.G_RET_STS_SUCCESS (success),
311: * FND_API.G_RET_STS_ERROR (error),
312: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
313: * x_msg_count Number of messages in message stack.
314: * x_msg_data Message text if x_msg_count is 1.
307: * OUT:
308: * p_style_fmt_variation_id style_fmt_variation id
309: * x_return_status Return status after the call. The status can
310: * be FND_API.G_RET_STS_SUCCESS (success),
311: * FND_API.G_RET_STS_ERROR (error),
312: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
313: * x_msg_count Number of messages in message stack.
314: * x_msg_data Message text if x_msg_count is 1.
315: *
308: * p_style_fmt_variation_id style_fmt_variation id
309: * x_return_status Return status after the call. The status can
310: * be FND_API.G_RET_STS_SUCCESS (success),
311: * FND_API.G_RET_STS_ERROR (error),
312: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
313: * x_msg_count Number of messages in message stack.
314: * x_msg_data Message text if x_msg_count is 1.
315: *
316: * NOTES
321: *
322: */
323:
324: PROCEDURE create_style_fmt_variation (
325: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
326: p_style_fmt_variation_rec IN STYLE_FMT_VARIATION_REC_TYPE,
327: x_return_status OUT NOCOPY VARCHAR2,
328: x_msg_count OUT NOCOPY NUMBER,
329: x_msg_data OUT NOCOPY VARCHAR2
346: p_msg_level=>fnd_log.level_procedure);
347: END IF;
348:
349: -- initialize message list if p_init_msg_list is set to TRUE.
350: IF FND_API.to_Boolean(p_init_msg_list) THEN
351: FND_MSG_PUB.initialize;
352: END IF;
353:
354: -- initialize API return status to success.
351: FND_MSG_PUB.initialize;
352: END IF;
353:
354: -- initialize API return status to success.
355: x_return_status := FND_API.G_RET_STS_SUCCESS;
356:
357: -- call to business logic.
358: do_create_style_fmt_variation(
359: l_style_fmt_variation_rec,
360: x_return_status);
361:
362: -- standard call to get message count and if count is 1, get message info.
363: FND_MSG_PUB.Count_And_Get(
364: p_encoded => FND_API.G_FALSE,
365: p_count => x_msg_count,
366: p_data => x_msg_data);
367: -- Debug info.
368: IF fnd_log.level_exception>=fnd_log.g_current_runtime_level THEN
380: -- Check if API is called in debug mode. If yes, disable debug.
381: --disable_debug;
382:
383: EXCEPTION
384: WHEN FND_API.G_EXC_ERROR THEN
385: ROLLBACK TO create_style_fmt_variation;
386: x_return_status := FND_API.G_RET_STS_ERROR;
387: FND_MSG_PUB.Count_And_Get(
388: p_encoded => FND_API.G_FALSE,
382:
383: EXCEPTION
384: WHEN FND_API.G_EXC_ERROR THEN
385: ROLLBACK TO create_style_fmt_variation;
386: x_return_status := FND_API.G_RET_STS_ERROR;
387: FND_MSG_PUB.Count_And_Get(
388: p_encoded => FND_API.G_FALSE,
389: p_count => x_msg_count,
390: p_data => x_msg_data);
384: WHEN FND_API.G_EXC_ERROR THEN
385: ROLLBACK TO create_style_fmt_variation;
386: x_return_status := FND_API.G_RET_STS_ERROR;
387: FND_MSG_PUB.Count_And_Get(
388: p_encoded => FND_API.G_FALSE,
389: p_count => x_msg_count,
390: p_data => x_msg_data);
391:
392: -- Debug info.
404:
405: -- Check if API is called in debug mode. If yes, disable debug.
406: --disable_debug;
407:
408: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
409: ROLLBACK TO create_style_fmt_variation;
410: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
411: FND_MSG_PUB.Count_And_Get(
412: p_encoded => FND_API.G_FALSE,
406: --disable_debug;
407:
408: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
409: ROLLBACK TO create_style_fmt_variation;
410: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
411: FND_MSG_PUB.Count_And_Get(
412: p_encoded => FND_API.G_FALSE,
413: p_count => x_msg_count,
414: p_data => x_msg_data);
408: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
409: ROLLBACK TO create_style_fmt_variation;
410: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
411: FND_MSG_PUB.Count_And_Get(
412: p_encoded => FND_API.G_FALSE,
413: p_count => x_msg_count,
414: p_data => x_msg_data);
415:
416: -- Debug info.
430: --disable_debug;
431:
432: WHEN OTHERS THEN
433: ROLLBACK TO create_style_fmt_variation;
434: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
435:
436: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
437: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
438: FND_MSG_PUB.ADD;
437: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
438: FND_MSG_PUB.ADD;
439:
440: FND_MSG_PUB.Count_And_Get(
441: p_encoded => FND_API.G_FALSE,
442: p_count => x_msg_count,
443: p_data => x_msg_data);
444:
445: -- Debug info.
472: *
473: * ARGUMENTS
474: * IN:
475: * p_init_msg_list Initialize message stack if it is set to
476: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
477: * p_style_fmt_variation_rec Style format variation record.
478: * IN/OUT:
479: * p_object_version_number Used for locking the being updated record.
480: * OUT:
478: * IN/OUT:
479: * p_object_version_number Used for locking the being updated record.
480: * OUT:
481: * x_return_status Return status after the call. The status can
482: * be FND_API.G_RET_STS_SUCCESS (success),
483: * FND_API.G_RET_STS_ERROR (error),
484: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
485: * x_msg_count Number of messages in message stack.
486: * x_msg_data Message text if x_msg_count is 1.
479: * p_object_version_number Used for locking the being updated record.
480: * OUT:
481: * x_return_status Return status after the call. The status can
482: * be FND_API.G_RET_STS_SUCCESS (success),
483: * FND_API.G_RET_STS_ERROR (error),
484: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
485: * x_msg_count Number of messages in message stack.
486: * x_msg_data Message text if x_msg_count is 1.
487: *
480: * OUT:
481: * x_return_status Return status after the call. The status can
482: * be FND_API.G_RET_STS_SUCCESS (success),
483: * FND_API.G_RET_STS_ERROR (error),
484: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
485: * x_msg_count Number of messages in message stack.
486: * x_msg_data Message text if x_msg_count is 1.
487: *
488: * NOTES
493: *
494: */
495:
496: PROCEDURE update_style_fmt_variation (
497: p_init_msg_list IN VARCHAR2 :=FND_API.G_FALSE,
498: p_style_fmt_variation_rec IN STYLE_FMT_VARIATION_REC_TYPE,
499: p_object_version_number IN OUT NOCOPY NUMBER,
500: x_return_status OUT NOCOPY VARCHAR2,
501: x_msg_count OUT NOCOPY NUMBER,
521: p_msg_level=>fnd_log.level_procedure);
522: END IF;
523:
524: -- initialize message list if p_init_msg_list is set to TRUE.
525: IF FND_API.to_Boolean(p_init_msg_list) THEN
526: FND_MSG_PUB.initialize;
527: END IF;
528:
529: -- initialize API return status to success.
526: FND_MSG_PUB.initialize;
527: END IF;
528:
529: -- initialize API return status to success.
530: x_return_status := FND_API.G_RET_STS_SUCCESS;
531:
532: -- call to business logic.
533: do_update_style_fmt_variation(
534: l_style_fmt_variation_rec,
536: x_return_status);
537:
538: -- standard call to get message count and if count is 1, get message info.
539: FND_MSG_PUB.Count_And_Get(
540: p_encoded => FND_API.G_FALSE,
541: p_count => x_msg_count,
542: p_data => x_msg_data);
543:
544: -- Debug info.
557: -- Check if API is called in debug mode. If yes, disable debug.
558: --disable_debug;
559:
560: EXCEPTION
561: WHEN FND_API.G_EXC_ERROR THEN
562: ROLLBACK TO update_style_fmt_variation;
563: x_return_status := FND_API.G_RET_STS_ERROR;
564: FND_MSG_PUB.Count_And_Get(
565: p_encoded => FND_API.G_FALSE,
559:
560: EXCEPTION
561: WHEN FND_API.G_EXC_ERROR THEN
562: ROLLBACK TO update_style_fmt_variation;
563: x_return_status := FND_API.G_RET_STS_ERROR;
564: FND_MSG_PUB.Count_And_Get(
565: p_encoded => FND_API.G_FALSE,
566: p_count => x_msg_count,
567: p_data => x_msg_data);
561: WHEN FND_API.G_EXC_ERROR THEN
562: ROLLBACK TO update_style_fmt_variation;
563: x_return_status := FND_API.G_RET_STS_ERROR;
564: FND_MSG_PUB.Count_And_Get(
565: p_encoded => FND_API.G_FALSE,
566: p_count => x_msg_count,
567: p_data => x_msg_data);
568:
569: -- Debug info.
581:
582: -- Check if API is called in debug mode. If yes, disable debug.
583: --disable_debug;
584:
585: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
586: ROLLBACK TO update_style_fmt_variation;
587: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
588: FND_MSG_PUB.Count_And_Get(
589: p_encoded => FND_API.G_FALSE,
583: --disable_debug;
584:
585: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
586: ROLLBACK TO update_style_fmt_variation;
587: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
588: FND_MSG_PUB.Count_And_Get(
589: p_encoded => FND_API.G_FALSE,
590: p_count => x_msg_count,
591: p_data => x_msg_data);
585: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
586: ROLLBACK TO update_style_fmt_variation;
587: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
588: FND_MSG_PUB.Count_And_Get(
589: p_encoded => FND_API.G_FALSE,
590: p_count => x_msg_count,
591: p_data => x_msg_data);
592:
593: -- Debug info.
607: --disable_debug;
608:
609: WHEN OTHERS THEN
610: ROLLBACK TO update_style_fmt_variation;
611: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
612:
613: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
614: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
615: FND_MSG_PUB.ADD;
614: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
615: FND_MSG_PUB.ADD;
616:
617: FND_MSG_PUB.Count_And_Get(
618: p_encoded => FND_API.G_FALSE,
619: p_count => x_msg_count,
620: p_data => x_msg_data);
621:
622: -- Debug info.
649: *
650: * ARGUMENTS
651: * IN:
652: * p_init_msg_list Initialize message stack if it is set to
653: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
654: * p_style_fmt_variation_code Style Code.
655: * IN/OUT:
656: * OUT:
657: * x_style_fmt_variation_rec Style record.
655: * IN/OUT:
656: * OUT:
657: * x_style_fmt_variation_rec Style record.
658: * x_return_status Return status after the call. The status can
659: * be FND_API.G_RET_STS_SUCCESS (success),
660: * FND_API.G_RET_STS_ERROR (error),
661: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
662: * x_msg_count Number of messages in message stack.
663: * x_msg_data Message text if x_msg_count is 1.
656: * OUT:
657: * x_style_fmt_variation_rec Style record.
658: * x_return_status Return status after the call. The status can
659: * be FND_API.G_RET_STS_SUCCESS (success),
660: * FND_API.G_RET_STS_ERROR (error),
661: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
662: * x_msg_count Number of messages in message stack.
663: * x_msg_data Message text if x_msg_count is 1.
664: *
657: * x_style_fmt_variation_rec Style record.
658: * x_return_status Return status after the call. The status can
659: * be FND_API.G_RET_STS_SUCCESS (success),
660: * FND_API.G_RET_STS_ERROR (error),
661: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
662: * x_msg_count Number of messages in message stack.
663: * x_msg_data Message text if x_msg_count is 1.
664: *
665: * NOTES
670: *
671: */
672:
673: PROCEDURE get_style_fmt_variation_rec (
674: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
675: p_style_format_code IN VARCHAR2,
676: p_variation_number IN NUMBER,
677: x_style_fmt_variation_rec OUT NOCOPY STYLE_FMT_VARIATION_REC_TYPE,
678: x_return_status OUT NOCOPY VARCHAR2,
691: p_msg_level=>fnd_log.level_procedure);
692: END IF;
693:
694: -- Initialize message list if p_init_msg_list is set to TRUE.
695: IF fnd_api.to_boolean(p_init_msg_list) THEN
696: fnd_msg_pub.initialize;
697: END IF;
698:
699: -- Initialize API return status to success.
696: fnd_msg_pub.initialize;
697: END IF;
698:
699: -- Initialize API return status to success.
700: x_return_status := fnd_api.g_ret_sts_success;
701:
702: -- Check whether primary key has been passed in.
703: IF p_style_format_code IS NULL OR
704: p_style_format_code = fnd_api.g_miss_char OR
700: x_return_status := fnd_api.g_ret_sts_success;
701:
702: -- Check whether primary key has been passed in.
703: IF p_style_format_code IS NULL OR
704: p_style_format_code = fnd_api.g_miss_char OR
705: p_variation_number IS NULL OR
706: p_variation_number = fnd_api.g_miss_num THEN
707: fnd_message.set_name('AR', 'HZ_API_MISSING_COLUMN');
708: fnd_message.set_token('COLUMN', 'p_style_format_code and p_variation_number');
702: -- Check whether primary key has been passed in.
703: IF p_style_format_code IS NULL OR
704: p_style_format_code = fnd_api.g_miss_char OR
705: p_variation_number IS NULL OR
706: p_variation_number = fnd_api.g_miss_num THEN
707: fnd_message.set_name('AR', 'HZ_API_MISSING_COLUMN');
708: fnd_message.set_token('COLUMN', 'p_style_format_code and p_variation_number');
709: fnd_msg_pub.add;
710: RAISE fnd_api.g_exc_error;
706: p_variation_number = fnd_api.g_miss_num THEN
707: fnd_message.set_name('AR', 'HZ_API_MISSING_COLUMN');
708: fnd_message.set_token('COLUMN', 'p_style_format_code and p_variation_number');
709: fnd_msg_pub.add;
710: RAISE fnd_api.g_exc_error;
711: END IF;
712:
713: x_style_fmt_variation_rec.style_format_code := p_style_format_code;
714: x_style_fmt_variation_rec.variation_number := p_variation_number;
737: END IF;
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:
758:
759: -- Check if API is called in debug mode. If yes, disable debug.
760: --disable_debug;
761: EXCEPTION
762: WHEN fnd_api.g_exc_error THEN
763: x_return_status := fnd_api.g_ret_sts_error;
764: fnd_msg_pub.count_and_get(
765: p_encoded => fnd_api.g_false,
766: p_count => x_msg_count,
759: -- Check if API is called in debug mode. If yes, disable debug.
760: --disable_debug;
761: EXCEPTION
762: WHEN fnd_api.g_exc_error THEN
763: x_return_status := fnd_api.g_ret_sts_error;
764: fnd_msg_pub.count_and_get(
765: p_encoded => fnd_api.g_false,
766: p_count => x_msg_count,
767: p_data => x_msg_data
761: EXCEPTION
762: WHEN fnd_api.g_exc_error THEN
763: x_return_status := fnd_api.g_ret_sts_error;
764: fnd_msg_pub.count_and_get(
765: p_encoded => fnd_api.g_false,
766: p_count => x_msg_count,
767: p_data => x_msg_data
768: );
769:
782:
783: -- Check if API is called in debug mode. If yes, disable debug.
784: --disable_debug;
785:
786: WHEN fnd_api.g_exc_unexpected_error THEN
787: x_return_status := fnd_api.g_ret_sts_unexp_error;
788:
789: fnd_msg_pub.count_and_get(
790: p_encoded => fnd_api.g_false,
783: -- Check if API is called in debug mode. If yes, disable debug.
784: --disable_debug;
785:
786: WHEN fnd_api.g_exc_unexpected_error THEN
787: x_return_status := fnd_api.g_ret_sts_unexp_error;
788:
789: fnd_msg_pub.count_and_get(
790: p_encoded => fnd_api.g_false,
791: p_count => x_msg_count,
786: WHEN fnd_api.g_exc_unexpected_error THEN
787: x_return_status := fnd_api.g_ret_sts_unexp_error;
788:
789: fnd_msg_pub.count_and_get(
790: p_encoded => fnd_api.g_false,
791: p_count => x_msg_count,
792: p_data => x_msg_data
793: );
794:
808: -- Check if API is called in debug mode. If yes, disable debug.
809: --disable_debug;
810:
811: WHEN OTHERS THEN
812: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
813:
814: fnd_message.set_name('AR', 'HZ_API_OTHERS_EXCEP');
815: fnd_message.set_token('ERROR' ,SQLERRM);
816: fnd_msg_pub.add;
815: fnd_message.set_token('ERROR' ,SQLERRM);
816: fnd_msg_pub.add;
817:
818: fnd_msg_pub.count_and_get(
819: p_encoded => fnd_api.g_false,
820: p_count => x_msg_count,
821: p_data => x_msg_data
822: );
823: