25: END IF;
26:
27: -- Get created records
28:
29: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
30: WHILE i IS NOT NULL LOOP
31: if oe_order_util.g_old_line_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
32: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_tbl(i).line_id;
33: end if;
27: -- Get created records
28:
29: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
30: WHILE i IS NOT NULL LOOP
31: if oe_order_util.g_old_line_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
32: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_tbl(i).line_id;
33: end if;
34: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
35: END LOOP;
28:
29: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
30: WHILE i IS NOT NULL LOOP
31: if oe_order_util.g_old_line_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
32: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_tbl(i).line_id;
33: end if;
34: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
35: END LOOP;
36:
30: WHILE i IS NOT NULL LOOP
31: if oe_order_util.g_old_line_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
32: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_tbl(i).line_id;
33: end if;
34: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
35: END LOOP;
36:
37: if l_temp_table.count > 0 then
38: FORALL i in 1..l_temp_table.COUNT
40: WHERE line_id = l_temp_table(i);
41: l_temp_table.DELETE;
42: end if;
43:
44: i := oe_order_util.g_old_header_adj_tbl.FIRST;
45: WHILE i IS NOT NULL LOOP
46: if oe_order_util.g_old_header_adj_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
47: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id;
48: end if;
42: end if;
43:
44: i := oe_order_util.g_old_header_adj_tbl.FIRST;
45: WHILE i IS NOT NULL LOOP
46: if oe_order_util.g_old_header_adj_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
47: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id;
48: end if;
49: i := oe_order_util.g_old_header_adj_tbl.NEXT(i);
50: END LOOP;
43:
44: i := oe_order_util.g_old_header_adj_tbl.FIRST;
45: WHILE i IS NOT NULL LOOP
46: if oe_order_util.g_old_header_adj_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
47: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id;
48: end if;
49: i := oe_order_util.g_old_header_adj_tbl.NEXT(i);
50: END LOOP;
51:
45: WHILE i IS NOT NULL LOOP
46: if oe_order_util.g_old_header_adj_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
47: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id;
48: end if;
49: i := oe_order_util.g_old_header_adj_tbl.NEXT(i);
50: END LOOP;
51:
52: i := oe_order_util.g_old_line_adj_tbl.FIRST;
53: WHILE i IS NOT NULL LOOP
48: end if;
49: i := oe_order_util.g_old_header_adj_tbl.NEXT(i);
50: END LOOP;
51:
52: i := oe_order_util.g_old_line_adj_tbl.FIRST;
53: WHILE i IS NOT NULL LOOP
54: if oe_order_util.g_old_line_adj_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
55: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id;
56: end if;
50: END LOOP;
51:
52: i := oe_order_util.g_old_line_adj_tbl.FIRST;
53: WHILE i IS NOT NULL LOOP
54: if oe_order_util.g_old_line_adj_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
55: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id;
56: end if;
57: i := oe_order_util.g_old_line_adj_tbl.NEXT(i);
58: END LOOP;
51:
52: i := oe_order_util.g_old_line_adj_tbl.FIRST;
53: WHILE i IS NOT NULL LOOP
54: if oe_order_util.g_old_line_adj_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
55: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id;
56: end if;
57: i := oe_order_util.g_old_line_adj_tbl.NEXT(i);
58: END LOOP;
59:
53: WHILE i IS NOT NULL LOOP
54: if oe_order_util.g_old_line_adj_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
55: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id;
56: end if;
57: i := oe_order_util.g_old_line_adj_tbl.NEXT(i);
58: END LOOP;
59:
60: if l_temp_table.count > 0 then
61: FORALL i in 1..l_temp_table.COUNT
63: WHERE price_adjustment_id = l_temp_table(i);
64: l_temp_table.DELETE;
65: end if;
66:
67: i := oe_order_util.g_old_header_scredit_tbl.FIRST;
68: WHILE i IS NOT NULL LOOP
69: if oe_order_util.g_old_header_scredit_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
70: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id;
71: end if;
65: end if;
66:
67: i := oe_order_util.g_old_header_scredit_tbl.FIRST;
68: WHILE i IS NOT NULL LOOP
69: if oe_order_util.g_old_header_scredit_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
70: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id;
71: end if;
72: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i);
73: END LOOP;
66:
67: i := oe_order_util.g_old_header_scredit_tbl.FIRST;
68: WHILE i IS NOT NULL LOOP
69: if oe_order_util.g_old_header_scredit_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
70: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id;
71: end if;
72: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i);
73: END LOOP;
74:
68: WHILE i IS NOT NULL LOOP
69: if oe_order_util.g_old_header_scredit_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
70: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id;
71: end if;
72: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i);
73: END LOOP;
74:
75: i := oe_order_util.g_old_line_scredit_tbl.FIRST;
76: WHILE i IS NOT NULL LOOP
71: end if;
72: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i);
73: END LOOP;
74:
75: i := oe_order_util.g_old_line_scredit_tbl.FIRST;
76: WHILE i IS NOT NULL LOOP
77: if oe_order_util.g_old_line_scredit_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
78: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id;
79: end if;
73: END LOOP;
74:
75: i := oe_order_util.g_old_line_scredit_tbl.FIRST;
76: WHILE i IS NOT NULL LOOP
77: if oe_order_util.g_old_line_scredit_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
78: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id;
79: end if;
80: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i);
81: END LOOP;
74:
75: i := oe_order_util.g_old_line_scredit_tbl.FIRST;
76: WHILE i IS NOT NULL LOOP
77: if oe_order_util.g_old_line_scredit_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
78: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id;
79: end if;
80: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i);
81: END LOOP;
82:
76: WHILE i IS NOT NULL LOOP
77: if oe_order_util.g_old_line_scredit_tbl(i).operation = OE_GLOBALS.G_OPR_CREATE then
78: l_temp_table(l_temp_table.count + 1) := oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id;
79: end if;
80: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i);
81: END LOOP;
82:
83: if l_temp_table.count > 0 then
84: FORALL i in 1..l_temp_table.COUNT
141: OE_Contracts_Util.Version_Articles(
142: p_api_version => 1,
143: p_doc_type => OE_Contracts_Util.G_SO_DOC_TYPE,
144: p_doc_id => p_header_id,
145: -- p_version_number => OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER ,
146: p_version_number => G_VERSION_NUMBER,
147: x_return_status => l_return_status,
148: x_msg_data => x_msg_data,
149: x_msg_count => x_msg_count);
205: IF (OE_GLOBALS.G_ROLL_VERSION = 'PV') THEN
206: l_version_flag := 'Y';
207: l_phase_change_flag := 'Y';
208: IF (p_document_type <> 'BLANKETS') THEN
209: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
210: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
211: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
212: ELSE
213: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
206: l_version_flag := 'Y';
207: l_phase_change_flag := 'Y';
208: IF (p_document_type <> 'BLANKETS') THEN
209: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
210: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
211: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
212: ELSE
213: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
214: END IF;
209: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
210: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
211: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
212: ELSE
213: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
214: END IF;
215: END IF;
216: ELSIF (OE_GLOBALS.G_ROLL_VERSION = 'P') THEN
217: l_version_flag := 'N';
219: ELSE
220: l_phase_change_flag := 'N';
221: l_version_flag := 'Y';
222: IF (p_document_type <> 'BLANKETS') THEN
223: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
224: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
225: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
226: ELSE
227: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
220: l_phase_change_flag := 'N';
221: l_version_flag := 'Y';
222: IF (p_document_type <> 'BLANKETS') THEN
223: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
224: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
225: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
226: ELSE
227: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
228: END IF;
223: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
224: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
225: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
226: ELSE
227: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
228: END IF;
229: END IF;
230: END IF;
231:
311:
312:
313: -- Return if header is created in same operation
314: -- add g_header_created check to fix bug 3700341
315: IF OE_Order_Util.g_header_rec.operation = OE_GLOBALS.G_OPR_CREATE OR
316: OE_GLOBALS.G_HEADER_CREATED THEN
317: IF l_debug_level > 0 THEN
318: oe_debug_pub.add('Not versioning because header was also created',1);
319: END IF;
446: INTO l_lock_control
447: FROM OE_ORDER_HEADERS_ALL
448: WHERE HEADER_ID = p_header_id;
449:
450: IF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER
451: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER IS NULL
452: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM
453: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER IS NULL
454: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM THEN
447: FROM OE_ORDER_HEADERS_ALL
448: WHERE HEADER_ID = p_header_id;
449:
450: IF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER
451: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER IS NULL
452: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM
453: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER IS NULL
454: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM THEN
455: UPDATE OE_ORDER_HEADERS_ALL
448: WHERE HEADER_ID = p_header_id;
449:
450: IF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER
451: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER IS NULL
452: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM
453: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER IS NULL
454: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM THEN
455: UPDATE OE_ORDER_HEADERS_ALL
456: SET VERSION_NUMBER = l_version_number + 1,
449:
450: IF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER
451: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER IS NULL
452: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM
453: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER IS NULL
454: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM THEN
455: UPDATE OE_ORDER_HEADERS_ALL
456: SET VERSION_NUMBER = l_version_number + 1,
457: LOCK_CONTROL = l_lock_control + 1
450: IF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER
451: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER IS NULL
452: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM
453: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER IS NULL
454: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM THEN
455: UPDATE OE_ORDER_HEADERS_ALL
456: SET VERSION_NUMBER = l_version_number + 1,
457: LOCK_CONTROL = l_lock_control + 1
458: WHERE HEADER_ID = p_header_id;
465: OE_ORDER_CACHE.g_header_rec.version_number := l_version_number + 1;
466: OE_ORDER_CACHE.g_header_rec.lock_control := l_lock_control + 1;
467:
468: OE_GLOBALS.G_CASCADING_REQUEST_LOGGED := TRUE;
469: ELSIF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER < OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER THEN
470: FND_MESSAGE.SET_NAME('ONT','OE_BLKT_INVALID_REVISION_NUM');
471: OE_MSG_PUB.ADD;
472:
473: RAISE FND_API.G_EXC_ERROR;
476:
477: G_VERSION_NUMBER := l_version_number;
478: --added for bug5216912 start
479: if G_VERSION_NUMBER is null then
480: G_VERSION_NUMBER := OE_ORDER_UTIL.g_old_header_rec.version_number;
481: end if;
482: --added for bug5216912 end
483: -- added for 3679627
484: x_return_status := l_return_status;
523: BEGIN
524:
525: -- Get current header_id
526:
527: if oe_order_util.g_header_id <> FND_API.G_MISS_NUM then
528: RETURN oe_order_util.g_header_id;
529: elsif
530: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
531: RETURN oe_order_util.g_old_header_rec.header_id;
524:
525: -- Get current header_id
526:
527: if oe_order_util.g_header_id <> FND_API.G_MISS_NUM then
528: RETURN oe_order_util.g_header_id;
529: elsif
530: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
531: RETURN oe_order_util.g_old_header_rec.header_id;
532: elsif
526:
527: if oe_order_util.g_header_id <> FND_API.G_MISS_NUM then
528: RETURN oe_order_util.g_header_id;
529: elsif
530: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
531: RETURN oe_order_util.g_old_header_rec.header_id;
532: elsif
533: oe_order_util.g_header_rec.header_id <> FND_API.G_MISS_NUM then
534: RETURN oe_order_util.g_header_rec.header_id;
527: if oe_order_util.g_header_id <> FND_API.G_MISS_NUM then
528: RETURN oe_order_util.g_header_id;
529: elsif
530: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
531: RETURN oe_order_util.g_old_header_rec.header_id;
532: elsif
533: oe_order_util.g_header_rec.header_id <> FND_API.G_MISS_NUM then
534: RETURN oe_order_util.g_header_rec.header_id;
535: else
529: elsif
530: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
531: RETURN oe_order_util.g_old_header_rec.header_id;
532: elsif
533: oe_order_util.g_header_rec.header_id <> FND_API.G_MISS_NUM then
534: RETURN oe_order_util.g_header_rec.header_id;
535: else
536: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
537: WHILE i IS NOT NULL LOOP
530: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
531: RETURN oe_order_util.g_old_header_rec.header_id;
532: elsif
533: oe_order_util.g_header_rec.header_id <> FND_API.G_MISS_NUM then
534: RETURN oe_order_util.g_header_rec.header_id;
535: else
536: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
537: WHILE i IS NOT NULL LOOP
538: if oe_order_util.g_old_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
532: elsif
533: oe_order_util.g_header_rec.header_id <> FND_API.G_MISS_NUM then
534: RETURN oe_order_util.g_header_rec.header_id;
535: else
536: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
537: WHILE i IS NOT NULL LOOP
538: if oe_order_util.g_old_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
539: RETURN oe_order_util.g_old_line_tbl(i).header_id;
540: end if;
534: RETURN oe_order_util.g_header_rec.header_id;
535: else
536: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
537: WHILE i IS NOT NULL LOOP
538: if oe_order_util.g_old_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
539: RETURN oe_order_util.g_old_line_tbl(i).header_id;
540: end if;
541: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
542: END LOOP;
535: else
536: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
537: WHILE i IS NOT NULL LOOP
538: if oe_order_util.g_old_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
539: RETURN oe_order_util.g_old_line_tbl(i).header_id;
540: end if;
541: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
542: END LOOP;
543:
537: WHILE i IS NOT NULL LOOP
538: if oe_order_util.g_old_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
539: RETURN oe_order_util.g_old_line_tbl(i).header_id;
540: end if;
541: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
542: END LOOP;
543:
544: i := oe_order_util.g_line_tbl.FIRST; -- get subscript of first element
545: WHILE i IS NOT NULL LOOP
540: end if;
541: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
542: END LOOP;
543:
544: i := oe_order_util.g_line_tbl.FIRST; -- get subscript of first element
545: WHILE i IS NOT NULL LOOP
546: if oe_order_util.g_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
547: RETURN oe_order_util.g_line_tbl(i).header_id;
548: end if;
542: END LOOP;
543:
544: i := oe_order_util.g_line_tbl.FIRST; -- get subscript of first element
545: WHILE i IS NOT NULL LOOP
546: if oe_order_util.g_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
547: RETURN oe_order_util.g_line_tbl(i).header_id;
548: end if;
549: i := oe_order_util.g_line_tbl.NEXT(i); -- get subscript of next element
550: END LOOP;
543:
544: i := oe_order_util.g_line_tbl.FIRST; -- get subscript of first element
545: WHILE i IS NOT NULL LOOP
546: if oe_order_util.g_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
547: RETURN oe_order_util.g_line_tbl(i).header_id;
548: end if;
549: i := oe_order_util.g_line_tbl.NEXT(i); -- get subscript of next element
550: END LOOP;
551:
545: WHILE i IS NOT NULL LOOP
546: if oe_order_util.g_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
547: RETURN oe_order_util.g_line_tbl(i).header_id;
548: end if;
549: i := oe_order_util.g_line_tbl.NEXT(i); -- get subscript of next element
550: END LOOP;
551:
552: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
553: WHILE i IS NOT NULL LOOP
548: end if;
549: i := oe_order_util.g_line_tbl.NEXT(i); -- get subscript of next element
550: END LOOP;
551:
552: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
553: WHILE i IS NOT NULL LOOP
554: if oe_order_util.g_old_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
555: RETURN oe_order_util.g_old_header_adj_tbl(i).header_id;
556: end if;
550: END LOOP;
551:
552: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
553: WHILE i IS NOT NULL LOOP
554: if oe_order_util.g_old_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
555: RETURN oe_order_util.g_old_header_adj_tbl(i).header_id;
556: end if;
557: i := oe_order_util.g_old_header_adj_tbl.NEXT(i); -- get subscript of next element
558: END LOOP;
551:
552: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
553: WHILE i IS NOT NULL LOOP
554: if oe_order_util.g_old_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
555: RETURN oe_order_util.g_old_header_adj_tbl(i).header_id;
556: end if;
557: i := oe_order_util.g_old_header_adj_tbl.NEXT(i); -- get subscript of next element
558: END LOOP;
559:
553: WHILE i IS NOT NULL LOOP
554: if oe_order_util.g_old_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
555: RETURN oe_order_util.g_old_header_adj_tbl(i).header_id;
556: end if;
557: i := oe_order_util.g_old_header_adj_tbl.NEXT(i); -- get subscript of next element
558: END LOOP;
559:
560: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
561: WHILE i IS NOT NULL LOOP
556: end if;
557: i := oe_order_util.g_old_header_adj_tbl.NEXT(i); -- get subscript of next element
558: END LOOP;
559:
560: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
561: WHILE i IS NOT NULL LOOP
562: if oe_order_util.g_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
563: RETURN oe_order_util.g_header_adj_tbl(i).header_id;
564: end if;
558: END LOOP;
559:
560: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
561: WHILE i IS NOT NULL LOOP
562: if oe_order_util.g_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
563: RETURN oe_order_util.g_header_adj_tbl(i).header_id;
564: end if;
565: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
566: END LOOP;
559:
560: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
561: WHILE i IS NOT NULL LOOP
562: if oe_order_util.g_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
563: RETURN oe_order_util.g_header_adj_tbl(i).header_id;
564: end if;
565: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
566: END LOOP;
567:
561: WHILE i IS NOT NULL LOOP
562: if oe_order_util.g_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
563: RETURN oe_order_util.g_header_adj_tbl(i).header_id;
564: end if;
565: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
566: END LOOP;
567:
568: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
569: WHILE i IS NOT NULL LOOP
564: end if;
565: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
566: END LOOP;
567:
568: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
569: WHILE i IS NOT NULL LOOP
570: if oe_order_util.g_old_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
571: RETURN oe_order_util.g_old_line_adj_tbl(i).header_id;
572: end if;
566: END LOOP;
567:
568: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
569: WHILE i IS NOT NULL LOOP
570: if oe_order_util.g_old_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
571: RETURN oe_order_util.g_old_line_adj_tbl(i).header_id;
572: end if;
573: i := oe_order_util.g_old_line_adj_tbl.NEXT(i); -- get subscript of next element
574: END LOOP;
567:
568: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
569: WHILE i IS NOT NULL LOOP
570: if oe_order_util.g_old_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
571: RETURN oe_order_util.g_old_line_adj_tbl(i).header_id;
572: end if;
573: i := oe_order_util.g_old_line_adj_tbl.NEXT(i); -- get subscript of next element
574: END LOOP;
575:
569: WHILE i IS NOT NULL LOOP
570: if oe_order_util.g_old_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
571: RETURN oe_order_util.g_old_line_adj_tbl(i).header_id;
572: end if;
573: i := oe_order_util.g_old_line_adj_tbl.NEXT(i); -- get subscript of next element
574: END LOOP;
575:
576: i := oe_order_util.g_line_adj_tbl.FIRST; -- get subscript of first element
577: WHILE i IS NOT NULL LOOP
572: end if;
573: i := oe_order_util.g_old_line_adj_tbl.NEXT(i); -- get subscript of next element
574: END LOOP;
575:
576: i := oe_order_util.g_line_adj_tbl.FIRST; -- get subscript of first element
577: WHILE i IS NOT NULL LOOP
578: if oe_order_util.g_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
579: RETURN oe_order_util.g_line_adj_tbl(i).header_id;
580: end if;
574: END LOOP;
575:
576: i := oe_order_util.g_line_adj_tbl.FIRST; -- get subscript of first element
577: WHILE i IS NOT NULL LOOP
578: if oe_order_util.g_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
579: RETURN oe_order_util.g_line_adj_tbl(i).header_id;
580: end if;
581: i := oe_order_util.g_line_adj_tbl.NEXT(i); -- get subscript of next element
582: END LOOP;
575:
576: i := oe_order_util.g_line_adj_tbl.FIRST; -- get subscript of first element
577: WHILE i IS NOT NULL LOOP
578: if oe_order_util.g_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
579: RETURN oe_order_util.g_line_adj_tbl(i).header_id;
580: end if;
581: i := oe_order_util.g_line_adj_tbl.NEXT(i); -- get subscript of next element
582: END LOOP;
583:
577: WHILE i IS NOT NULL LOOP
578: if oe_order_util.g_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
579: RETURN oe_order_util.g_line_adj_tbl(i).header_id;
580: end if;
581: i := oe_order_util.g_line_adj_tbl.NEXT(i); -- get subscript of next element
582: END LOOP;
583:
584: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
585: WHILE i IS NOT NULL LOOP
580: end if;
581: i := oe_order_util.g_line_adj_tbl.NEXT(i); -- get subscript of next element
582: END LOOP;
583:
584: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
585: WHILE i IS NOT NULL LOOP
586: if oe_order_util.g_old_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
587: RETURN oe_order_util.g_old_header_scredit_tbl(i).header_id;
588: end if;
582: END LOOP;
583:
584: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
585: WHILE i IS NOT NULL LOOP
586: if oe_order_util.g_old_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
587: RETURN oe_order_util.g_old_header_scredit_tbl(i).header_id;
588: end if;
589: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i); -- get subscript of next element
590: END LOOP;
583:
584: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
585: WHILE i IS NOT NULL LOOP
586: if oe_order_util.g_old_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
587: RETURN oe_order_util.g_old_header_scredit_tbl(i).header_id;
588: end if;
589: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i); -- get subscript of next element
590: END LOOP;
591:
585: WHILE i IS NOT NULL LOOP
586: if oe_order_util.g_old_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
587: RETURN oe_order_util.g_old_header_scredit_tbl(i).header_id;
588: end if;
589: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i); -- get subscript of next element
590: END LOOP;
591:
592: i := oe_order_util.g_header_scredit_tbl.FIRST; -- get subscript of first element
593: WHILE i IS NOT NULL LOOP
588: end if;
589: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i); -- get subscript of next element
590: END LOOP;
591:
592: i := oe_order_util.g_header_scredit_tbl.FIRST; -- get subscript of first element
593: WHILE i IS NOT NULL LOOP
594: if oe_order_util.g_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
595: RETURN oe_order_util.g_header_scredit_tbl(i).header_id;
596: end if;
590: END LOOP;
591:
592: i := oe_order_util.g_header_scredit_tbl.FIRST; -- get subscript of first element
593: WHILE i IS NOT NULL LOOP
594: if oe_order_util.g_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
595: RETURN oe_order_util.g_header_scredit_tbl(i).header_id;
596: end if;
597: i := oe_order_util.g_header_scredit_tbl.NEXT(i); -- get subscript of next element
598: END LOOP;
591:
592: i := oe_order_util.g_header_scredit_tbl.FIRST; -- get subscript of first element
593: WHILE i IS NOT NULL LOOP
594: if oe_order_util.g_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
595: RETURN oe_order_util.g_header_scredit_tbl(i).header_id;
596: end if;
597: i := oe_order_util.g_header_scredit_tbl.NEXT(i); -- get subscript of next element
598: END LOOP;
599:
593: WHILE i IS NOT NULL LOOP
594: if oe_order_util.g_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
595: RETURN oe_order_util.g_header_scredit_tbl(i).header_id;
596: end if;
597: i := oe_order_util.g_header_scredit_tbl.NEXT(i); -- get subscript of next element
598: END LOOP;
599:
600: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
601: WHILE i IS NOT NULL LOOP
596: end if;
597: i := oe_order_util.g_header_scredit_tbl.NEXT(i); -- get subscript of next element
598: END LOOP;
599:
600: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
601: WHILE i IS NOT NULL LOOP
602: if oe_order_util.g_old_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
603: RETURN oe_order_util.g_old_line_scredit_tbl(i).header_id;
604: end if;
598: END LOOP;
599:
600: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
601: WHILE i IS NOT NULL LOOP
602: if oe_order_util.g_old_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
603: RETURN oe_order_util.g_old_line_scredit_tbl(i).header_id;
604: end if;
605: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i); -- get subscript of next element
606: END LOOP;
599:
600: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
601: WHILE i IS NOT NULL LOOP
602: if oe_order_util.g_old_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
603: RETURN oe_order_util.g_old_line_scredit_tbl(i).header_id;
604: end if;
605: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i); -- get subscript of next element
606: END LOOP;
607:
601: WHILE i IS NOT NULL LOOP
602: if oe_order_util.g_old_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
603: RETURN oe_order_util.g_old_line_scredit_tbl(i).header_id;
604: end if;
605: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i); -- get subscript of next element
606: END LOOP;
607:
608: i := oe_order_util.g_line_scredit_tbl.FIRST; -- get subscript of first element
609: WHILE i IS NOT NULL LOOP
604: end if;
605: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i); -- get subscript of next element
606: END LOOP;
607:
608: i := oe_order_util.g_line_scredit_tbl.FIRST; -- get subscript of first element
609: WHILE i IS NOT NULL LOOP
610: if oe_order_util.g_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
611: RETURN oe_order_util.g_line_scredit_tbl(i).header_id;
612: end if;
606: END LOOP;
607:
608: i := oe_order_util.g_line_scredit_tbl.FIRST; -- get subscript of first element
609: WHILE i IS NOT NULL LOOP
610: if oe_order_util.g_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
611: RETURN oe_order_util.g_line_scredit_tbl(i).header_id;
612: end if;
613: i := oe_order_util.g_line_scredit_tbl.NEXT(i); -- get subscript of next element
614: END LOOP;
607:
608: i := oe_order_util.g_line_scredit_tbl.FIRST; -- get subscript of first element
609: WHILE i IS NOT NULL LOOP
610: if oe_order_util.g_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
611: RETURN oe_order_util.g_line_scredit_tbl(i).header_id;
612: end if;
613: i := oe_order_util.g_line_scredit_tbl.NEXT(i); -- get subscript of next element
614: END LOOP;
615:
609: WHILE i IS NOT NULL LOOP
610: if oe_order_util.g_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
611: RETURN oe_order_util.g_line_scredit_tbl(i).header_id;
612: end if;
613: i := oe_order_util.g_line_scredit_tbl.NEXT(i); -- get subscript of next element
614: END LOOP;
615:
616: end if;
617:
651: IF l_debug_level > 0 THEN
652: oe_debug_pub.add('OE_Versioning_Util header_id: ' || l_header_id,1);
653: END IF;
654:
655: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
656: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
657: select version_number into l_version_number from oe_order_headers_all where header_id = l_header_id;
658: ELSE
659: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
652: oe_debug_pub.add('OE_Versioning_Util header_id: ' || l_header_id,1);
653: END IF;
654:
655: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
656: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
657: select version_number into l_version_number from oe_order_headers_all where header_id = l_header_id;
658: ELSE
659: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
660: END IF;
655: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
656: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
657: select version_number into l_version_number from oe_order_headers_all where header_id = l_header_id;
658: ELSE
659: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
660: END IF;
661:
662: IF l_debug_level > 0 THEN
663: oe_debug_pub.add('Before updating history ',1);
663: oe_debug_pub.add('Before updating history ',1);
664: END IF;
665:
666: --Update history with audit flag information gathered in global picture
667: IF OE_Order_Util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM THEN
668: IF NOT OE_GLOBALS.Equal(OE_Order_Util.g_old_header_rec.operation, OE_GLOBALS.G_OPR_CREATE) AND
669: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
670: g_audit_header_hist_code IS NOT NULL) THEN
671:
664: END IF;
665:
666: --Update history with audit flag information gathered in global picture
667: IF OE_Order_Util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM THEN
668: IF NOT OE_GLOBALS.Equal(OE_Order_Util.g_old_header_rec.operation, OE_GLOBALS.G_OPR_CREATE) AND
669: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
670: g_audit_header_hist_code IS NOT NULL) THEN
671:
672: IF g_audit_header_hist_code IS NOT NULL THEN
680: if g_audit_header_reason_required and l_audit_flag = 'Y' then
681: --Apply Reason for audit
682: OE_Reasons_Util.Apply_Reason(
683: p_entity_code => 'HEADER',
684: p_entity_id => oe_order_util.g_old_header_rec.header_id,
685: p_header_id => oe_order_util.g_old_header_rec.header_id,
686: p_version_number => l_version_number,
687: p_reason_type => 'CANCEL_CODE',
688: p_reason_code => OE_ORDER_UTIL.g_header_rec.change_reason,
681: --Apply Reason for audit
682: OE_Reasons_Util.Apply_Reason(
683: p_entity_code => 'HEADER',
684: p_entity_id => oe_order_util.g_old_header_rec.header_id,
685: p_header_id => oe_order_util.g_old_header_rec.header_id,
686: p_version_number => l_version_number,
687: p_reason_type => 'CANCEL_CODE',
688: p_reason_code => OE_ORDER_UTIL.g_header_rec.change_reason,
689: p_reason_comments => OE_ORDER_UTIL.g_header_rec.change_comments,
684: p_entity_id => oe_order_util.g_old_header_rec.header_id,
685: p_header_id => oe_order_util.g_old_header_rec.header_id,
686: p_version_number => l_version_number,
687: p_reason_type => 'CANCEL_CODE',
688: p_reason_code => OE_ORDER_UTIL.g_header_rec.change_reason,
689: p_reason_comments => OE_ORDER_UTIL.g_header_rec.change_comments,
690: x_reason_id => l_reason_id,
691: x_return_status => l_return_status);
692:
685: p_header_id => oe_order_util.g_old_header_rec.header_id,
686: p_version_number => l_version_number,
687: p_reason_type => 'CANCEL_CODE',
688: p_reason_code => OE_ORDER_UTIL.g_header_rec.change_reason,
689: p_reason_comments => OE_ORDER_UTIL.g_header_rec.change_comments,
690: x_reason_id => l_reason_id,
691: x_return_status => l_return_status);
692:
693: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
704:
705: end if; --end apply reason
706:
707: IF l_debug_level > 0 THEN
708: oe_debug_pub.add('Calling recordheaderhist operation: '|| oe_order_util.g_old_header_rec.operation,1);
709: END IF;
710:
711: OE_CHG_ORDER_PVT.RecordHeaderHist
712: ( p_header_id => oe_order_util.g_old_header_rec.header_id,
708: oe_debug_pub.add('Calling recordheaderhist operation: '|| oe_order_util.g_old_header_rec.operation,1);
709: END IF;
710:
711: OE_CHG_ORDER_PVT.RecordHeaderHist
712: ( p_header_id => oe_order_util.g_old_header_rec.header_id,
713: p_header_rec => oe_order_util.g_old_header_rec,
714: p_hist_type_code => l_hist_type_code,
715: p_reason_code => NULL,
716: p_comments => NULL,
709: END IF;
710:
711: OE_CHG_ORDER_PVT.RecordHeaderHist
712: ( p_header_id => oe_order_util.g_old_header_rec.header_id,
713: p_header_rec => oe_order_util.g_old_header_rec,
714: p_hist_type_code => l_hist_type_code,
715: p_reason_code => NULL,
716: p_comments => NULL,
717: p_audit_flag => l_audit_flag,
744: oe_debug_pub.add(' OEXUVERB: before recording lines ',1);
745: END IF;
746:
747: --Update history for lines
748: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
749: WHILE i IS NOT NULL LOOP
750: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
751: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
752: g_audit_line_id_tbl.exists(i)) THEN
746:
747: --Update history for lines
748: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
749: WHILE i IS NOT NULL LOOP
750: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
751: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
752: g_audit_line_id_tbl.exists(i)) THEN
753: IF g_audit_line_id_tbl.exists(i) THEN
754: l_audit_flag := 'Y';
771: -- value can be passed even if constraint does not require reason
772: -- but if reason is supplied for these hist types, it should be
773: -- captured.
774: OR (l_hist_type_code IN ('CANCELLATION','QUANTITY UPDATE')
775: and OE_ORDER_UTIL.g_line_tbl(i).change_reason is not null
776: and OE_ORDER_UTIL.g_line_tbl(i).change_reason <> fnd_api.g_miss_char
777: )
778: ) then
779: --Apply Reason for audit
772: -- but if reason is supplied for these hist types, it should be
773: -- captured.
774: OR (l_hist_type_code IN ('CANCELLATION','QUANTITY UPDATE')
775: and OE_ORDER_UTIL.g_line_tbl(i).change_reason is not null
776: and OE_ORDER_UTIL.g_line_tbl(i).change_reason <> fnd_api.g_miss_char
777: )
778: ) then
779: --Apply Reason for audit
780: OE_Reasons_Util.Apply_Reason(
778: ) then
779: --Apply Reason for audit
780: OE_Reasons_Util.Apply_Reason(
781: p_entity_code => 'LINE',
782: p_entity_id => oe_order_util.g_old_line_tbl(i).line_id,
783: p_header_id => oe_order_util.g_old_line_tbl(i).header_id,
784: p_version_number => l_version_number,
785: p_reason_type => 'CANCEL_CODE',
786: p_reason_code => OE_ORDER_UTIL.g_line_tbl(i).change_reason,
779: --Apply Reason for audit
780: OE_Reasons_Util.Apply_Reason(
781: p_entity_code => 'LINE',
782: p_entity_id => oe_order_util.g_old_line_tbl(i).line_id,
783: p_header_id => oe_order_util.g_old_line_tbl(i).header_id,
784: p_version_number => l_version_number,
785: p_reason_type => 'CANCEL_CODE',
786: p_reason_code => OE_ORDER_UTIL.g_line_tbl(i).change_reason,
787: p_reason_comments => OE_ORDER_UTIL.g_line_tbl(i).change_comments,
782: p_entity_id => oe_order_util.g_old_line_tbl(i).line_id,
783: p_header_id => oe_order_util.g_old_line_tbl(i).header_id,
784: p_version_number => l_version_number,
785: p_reason_type => 'CANCEL_CODE',
786: p_reason_code => OE_ORDER_UTIL.g_line_tbl(i).change_reason,
787: p_reason_comments => OE_ORDER_UTIL.g_line_tbl(i).change_comments,
788: x_reason_id => l_reason_id,
789: x_return_status => l_return_status);
790:
783: p_header_id => oe_order_util.g_old_line_tbl(i).header_id,
784: p_version_number => l_version_number,
785: p_reason_type => 'CANCEL_CODE',
786: p_reason_code => OE_ORDER_UTIL.g_line_tbl(i).change_reason,
787: p_reason_comments => OE_ORDER_UTIL.g_line_tbl(i).change_comments,
788: x_reason_id => l_reason_id,
789: x_return_status => l_return_status);
790:
791: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
802:
803: end if; --end apply reason
804:
805: IF l_debug_level > 0 THEN
806: oe_debug_pub.add('Calling recordlinehist operation: '|| oe_order_util.g_old_line_tbl(i).operation,1);
807: END IF;
808:
809: OE_CHG_ORDER_PVT.RecordLineHist
810: (p_line_id => oe_order_util.g_old_line_tbl(i).line_id,
806: oe_debug_pub.add('Calling recordlinehist operation: '|| oe_order_util.g_old_line_tbl(i).operation,1);
807: END IF;
808:
809: OE_CHG_ORDER_PVT.RecordLineHist
810: (p_line_id => oe_order_util.g_old_line_tbl(i).line_id,
811: p_line_rec => oe_order_util.g_old_line_tbl(i),
812: p_hist_type_code => l_hist_type_code,
813: p_reason_code => NULL,
814: p_comments => NULL,
807: END IF;
808:
809: OE_CHG_ORDER_PVT.RecordLineHist
810: (p_line_id => oe_order_util.g_old_line_tbl(i).line_id,
811: p_line_rec => oe_order_util.g_old_line_tbl(i),
812: p_hist_type_code => l_hist_type_code,
813: p_reason_code => NULL,
814: p_comments => NULL,
815: p_audit_flag => l_audit_flag,
835: END IF;
836: END IF;
837:
838: END IF;
839: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
840: END LOOP;
841:
842: IF l_debug_level > 0 THEN
843: oe_debug_pub.add(' OEXUVERB: before recording header adjs ',1);
843: oe_debug_pub.add(' OEXUVERB: before recording header adjs ',1);
844: END IF;
845:
846: --Update history for header adj
847: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
848: WHILE i IS NOT NULL LOOP
849: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_header_adj_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
850: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
851: g_audit_header_adj_id_tbl.exists(i)) THEN
845:
846: --Update history for header adj
847: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
848: WHILE i IS NOT NULL LOOP
849: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_header_adj_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
850: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
851: g_audit_header_adj_id_tbl.exists(i)) THEN
852: IF g_audit_header_adj_id_tbl.exists(i) THEN
853: l_audit_flag := 'Y';
861: g_audit_header_adj_id_tbl(i).reason_required then
862: --Apply Reason for audit
863: OE_Reasons_Util.Apply_Reason(
864: p_entity_code => 'HEADER_ADJ',
865: p_entity_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
866: p_header_id => oe_order_util.g_old_header_adj_tbl(i).header_id,
867: p_version_number => l_version_number,
868: p_reason_type => 'CHANGE_CODE',
869: p_reason_code => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_code,
862: --Apply Reason for audit
863: OE_Reasons_Util.Apply_Reason(
864: p_entity_code => 'HEADER_ADJ',
865: p_entity_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
866: p_header_id => oe_order_util.g_old_header_adj_tbl(i).header_id,
867: p_version_number => l_version_number,
868: p_reason_type => 'CHANGE_CODE',
869: p_reason_code => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_code,
870: p_reason_comments => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_text,
865: p_entity_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
866: p_header_id => oe_order_util.g_old_header_adj_tbl(i).header_id,
867: p_version_number => l_version_number,
868: p_reason_type => 'CHANGE_CODE',
869: p_reason_code => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_code,
870: p_reason_comments => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_text,
871: x_reason_id => l_reason_id,
872: x_return_status => l_return_status);
873:
866: p_header_id => oe_order_util.g_old_header_adj_tbl(i).header_id,
867: p_version_number => l_version_number,
868: p_reason_type => 'CHANGE_CODE',
869: p_reason_code => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_code,
870: p_reason_comments => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_text,
871: x_reason_id => l_reason_id,
872: x_return_status => l_return_status);
873:
874: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
885:
886: end if; --end apply reason
887:
888: IF l_debug_level > 0 THEN
889: oe_debug_pub.add('Calling recordHPAdjhist operation: '|| oe_order_util.g_old_header_adj_tbl(i).operation,1);
890: END IF;
891:
892: OE_CHG_ORDER_PVT.RecordHPAdjHist
893: (p_header_adj_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
889: oe_debug_pub.add('Calling recordHPAdjhist operation: '|| oe_order_util.g_old_header_adj_tbl(i).operation,1);
890: END IF;
891:
892: OE_CHG_ORDER_PVT.RecordHPAdjHist
893: (p_header_adj_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
894: p_header_adj_rec => oe_order_util.g_old_header_adj_tbl(i),
895: p_hist_type_code => l_hist_type_code,
896: p_reason_code => oe_globals.g_reason_code,
897: p_comments => oe_globals.g_reason_comments,
890: END IF;
891:
892: OE_CHG_ORDER_PVT.RecordHPAdjHist
893: (p_header_adj_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
894: p_header_adj_rec => oe_order_util.g_old_header_adj_tbl(i),
895: p_hist_type_code => l_hist_type_code,
896: p_reason_code => oe_globals.g_reason_code,
897: p_comments => oe_globals.g_reason_comments,
898: p_audit_flag => l_audit_flag,
919: END IF;
920: END IF;
921:
922: END IF;
923: i := oe_order_util.g_old_header_adj_tbl.NEXT(i); -- get subscript of next element
924: END LOOP;
925:
926:
927: IF l_debug_level > 0 THEN
928: oe_debug_pub.add(' OEXUVERB: before recording header scredits ',1);
929: END IF;
930:
931: --Update history for header scredit
932: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
933: WHILE i IS NOT NULL LOOP
934: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_header_scredit_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
935: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
936: g_audit_header_scredit_id_tbl.exists(i)) THEN
930:
931: --Update history for header scredit
932: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
933: WHILE i IS NOT NULL LOOP
934: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_header_scredit_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
935: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
936: g_audit_header_scredit_id_tbl.exists(i)) THEN
937: IF g_audit_header_scredit_id_tbl.exists(i) THEN
938: l_audit_flag := 'Y';
946: g_audit_header_scredit_id_tbl(i).reason_required then
947: --Apply Reason for audit
948: OE_Reasons_Util.Apply_Reason(
949: p_entity_code => 'HEADER_SCREDIT',
950: p_entity_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
951: p_header_id => oe_order_util.g_old_header_scredit_tbl(i).header_id,
952: p_version_number => l_version_number,
953: p_reason_type => 'CANCEL_CODE',
954: p_reason_code => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_reason,
947: --Apply Reason for audit
948: OE_Reasons_Util.Apply_Reason(
949: p_entity_code => 'HEADER_SCREDIT',
950: p_entity_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
951: p_header_id => oe_order_util.g_old_header_scredit_tbl(i).header_id,
952: p_version_number => l_version_number,
953: p_reason_type => 'CANCEL_CODE',
954: p_reason_code => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_reason,
955: p_reason_comments => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_comments,
950: p_entity_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
951: p_header_id => oe_order_util.g_old_header_scredit_tbl(i).header_id,
952: p_version_number => l_version_number,
953: p_reason_type => 'CANCEL_CODE',
954: p_reason_code => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_reason,
955: p_reason_comments => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_comments,
956: x_reason_id => l_reason_id,
957: x_return_status => l_return_status);
958:
951: p_header_id => oe_order_util.g_old_header_scredit_tbl(i).header_id,
952: p_version_number => l_version_number,
953: p_reason_type => 'CANCEL_CODE',
954: p_reason_code => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_reason,
955: p_reason_comments => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_comments,
956: x_reason_id => l_reason_id,
957: x_return_status => l_return_status);
958:
959: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
970:
971: end if; --end apply reason
972:
973: IF l_debug_level > 0 THEN
974: oe_debug_pub.add('Calling recordHSCredithist operation: '|| oe_order_util.g_old_header_scredit_tbl(i).operation,1);
975: END IF;
976:
977: OE_CHG_ORDER_PVT.RecordHSCreditHist
978: (p_header_scredit_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
974: oe_debug_pub.add('Calling recordHSCredithist operation: '|| oe_order_util.g_old_header_scredit_tbl(i).operation,1);
975: END IF;
976:
977: OE_CHG_ORDER_PVT.RecordHSCreditHist
978: (p_header_scredit_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
979: p_header_scredit_rec => oe_order_util.g_old_header_scredit_tbl(i),
980: p_hist_type_code => l_hist_type_code,
981: p_reason_code => oe_globals.g_reason_code,
982: p_comments => oe_globals.g_reason_comments,
975: END IF;
976:
977: OE_CHG_ORDER_PVT.RecordHSCreditHist
978: (p_header_scredit_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
979: p_header_scredit_rec => oe_order_util.g_old_header_scredit_tbl(i),
980: p_hist_type_code => l_hist_type_code,
981: p_reason_code => oe_globals.g_reason_code,
982: p_comments => oe_globals.g_reason_comments,
983: p_audit_flag => l_audit_flag,
1003: END IF;
1004: END IF;
1005:
1006: END IF;
1007: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i); -- get subscript of next element
1008: END LOOP;
1009:
1010: IF l_debug_level > 0 THEN
1011: oe_debug_pub.add(' OEXUVERB: before recording line adjs ',1);
1010: IF l_debug_level > 0 THEN
1011: oe_debug_pub.add(' OEXUVERB: before recording line adjs ',1);
1012: END IF;
1013: --Update history for line adj
1014: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
1015: WHILE i IS NOT NULL LOOP
1016: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_adj_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
1017: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
1018: g_audit_line_adj_id_tbl.exists(i)) THEN
1012: END IF;
1013: --Update history for line adj
1014: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
1015: WHILE i IS NOT NULL LOOP
1016: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_adj_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
1017: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
1018: g_audit_line_adj_id_tbl.exists(i)) THEN
1019: IF g_audit_line_adj_id_tbl.exists(i) THEN
1020: l_audit_flag := 'Y';
1028: g_audit_line_adj_id_tbl(i).reason_required then
1029: --Apply Reason for audit
1030: OE_Reasons_Util.Apply_Reason(
1031: p_entity_code => 'LINE_ADJ',
1032: p_entity_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1033: p_header_id => oe_order_util.g_old_line_adj_tbl(i).header_id,
1034: p_version_number => l_version_number,
1035: p_reason_type => 'CHANGE_CODE',
1036: p_reason_code => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_code,
1029: --Apply Reason for audit
1030: OE_Reasons_Util.Apply_Reason(
1031: p_entity_code => 'LINE_ADJ',
1032: p_entity_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1033: p_header_id => oe_order_util.g_old_line_adj_tbl(i).header_id,
1034: p_version_number => l_version_number,
1035: p_reason_type => 'CHANGE_CODE',
1036: p_reason_code => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_code,
1037: p_reason_comments => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_text,
1032: p_entity_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1033: p_header_id => oe_order_util.g_old_line_adj_tbl(i).header_id,
1034: p_version_number => l_version_number,
1035: p_reason_type => 'CHANGE_CODE',
1036: p_reason_code => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_code,
1037: p_reason_comments => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_text,
1038: x_reason_id => l_reason_id,
1039: x_return_status => l_return_status);
1040:
1033: p_header_id => oe_order_util.g_old_line_adj_tbl(i).header_id,
1034: p_version_number => l_version_number,
1035: p_reason_type => 'CHANGE_CODE',
1036: p_reason_code => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_code,
1037: p_reason_comments => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_text,
1038: x_reason_id => l_reason_id,
1039: x_return_status => l_return_status);
1040:
1041: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1052:
1053: end if; --end apply reason
1054:
1055: IF l_debug_level > 0 THEN
1056: oe_debug_pub.add('Calling recordLPAdjhist operation: '|| oe_order_util.g_old_line_adj_tbl(i).operation,1);
1057: END IF;
1058:
1059: OE_CHG_ORDER_PVT.RecordLPAdjHist
1060: (p_line_adj_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1056: oe_debug_pub.add('Calling recordLPAdjhist operation: '|| oe_order_util.g_old_line_adj_tbl(i).operation,1);
1057: END IF;
1058:
1059: OE_CHG_ORDER_PVT.RecordLPAdjHist
1060: (p_line_adj_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1061: p_line_adj_rec => oe_order_util.g_old_line_adj_tbl(i),
1062: p_hist_type_code => l_hist_type_code,
1063: p_reason_code => oe_globals.g_reason_code,
1064: p_comments => oe_globals.g_reason_comments,
1057: END IF;
1058:
1059: OE_CHG_ORDER_PVT.RecordLPAdjHist
1060: (p_line_adj_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1061: p_line_adj_rec => oe_order_util.g_old_line_adj_tbl(i),
1062: p_hist_type_code => l_hist_type_code,
1063: p_reason_code => oe_globals.g_reason_code,
1064: p_comments => oe_globals.g_reason_comments,
1065: p_audit_flag => l_audit_flag,
1086: END IF;
1087: END IF;
1088:
1089: END IF;
1090: i := oe_order_util.g_old_line_adj_tbl.NEXT(i); -- get subscript of next element
1091: END LOOP;
1092:
1093: IF l_debug_level > 0 THEN
1094: oe_debug_pub.add(' OEXUVERB: before recording line scredits ',1);
1093: IF l_debug_level > 0 THEN
1094: oe_debug_pub.add(' OEXUVERB: before recording line scredits ',1);
1095: END IF;
1096: --Update history for line scredit
1097: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
1098: WHILE i IS NOT NULL LOOP
1099: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_scredit_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
1100: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
1101: g_audit_line_scredit_id_tbl.exists(i)) THEN
1095: END IF;
1096: --Update history for line scredit
1097: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
1098: WHILE i IS NOT NULL LOOP
1099: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_scredit_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
1100: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
1101: g_audit_line_scredit_id_tbl.exists(i)) THEN
1102: IF g_audit_line_scredit_id_tbl.exists(i) THEN
1103: l_audit_flag := 'Y';
1111: g_audit_line_scredit_id_tbl(i).reason_required then
1112: --Apply Reason for audit
1113: OE_Reasons_Util.Apply_Reason(
1114: p_entity_code => 'LINE_SCREDIT',
1115: p_entity_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1116: p_header_id => oe_order_util.g_old_line_scredit_tbl(i).header_id,
1117: p_version_number => l_version_number,
1118: p_reason_type => 'CANCEL_CODE',
1119: p_reason_code => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_reason,
1112: --Apply Reason for audit
1113: OE_Reasons_Util.Apply_Reason(
1114: p_entity_code => 'LINE_SCREDIT',
1115: p_entity_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1116: p_header_id => oe_order_util.g_old_line_scredit_tbl(i).header_id,
1117: p_version_number => l_version_number,
1118: p_reason_type => 'CANCEL_CODE',
1119: p_reason_code => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_reason,
1120: p_reason_comments => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_comments,
1115: p_entity_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1116: p_header_id => oe_order_util.g_old_line_scredit_tbl(i).header_id,
1117: p_version_number => l_version_number,
1118: p_reason_type => 'CANCEL_CODE',
1119: p_reason_code => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_reason,
1120: p_reason_comments => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_comments,
1121: x_reason_id => l_reason_id,
1122: x_return_status => l_return_status);
1123:
1116: p_header_id => oe_order_util.g_old_line_scredit_tbl(i).header_id,
1117: p_version_number => l_version_number,
1118: p_reason_type => 'CANCEL_CODE',
1119: p_reason_code => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_reason,
1120: p_reason_comments => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_comments,
1121: x_reason_id => l_reason_id,
1122: x_return_status => l_return_status);
1123:
1124: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1135:
1136: end if; --end apply reason
1137:
1138: IF l_debug_level > 0 THEN
1139: oe_debug_pub.add('Calling recordLSCredithist operation: '|| oe_order_util.g_old_line_scredit_tbl(i).operation,1);
1140: END IF;
1141:
1142: OE_CHG_ORDER_PVT.RecordLSCreditHist
1143: (p_line_scredit_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1139: oe_debug_pub.add('Calling recordLSCredithist operation: '|| oe_order_util.g_old_line_scredit_tbl(i).operation,1);
1140: END IF;
1141:
1142: OE_CHG_ORDER_PVT.RecordLSCreditHist
1143: (p_line_scredit_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1144: p_line_scredit_rec => oe_order_util.g_old_line_scredit_tbl(i),
1145: p_hist_type_code => l_hist_type_code,
1146: p_reason_code => oe_globals.g_reason_code,
1147: p_comments => oe_globals.g_reason_comments,
1140: END IF;
1141:
1142: OE_CHG_ORDER_PVT.RecordLSCreditHist
1143: (p_line_scredit_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1144: p_line_scredit_rec => oe_order_util.g_old_line_scredit_tbl(i),
1145: p_hist_type_code => l_hist_type_code,
1146: p_reason_code => oe_globals.g_reason_code,
1147: p_comments => oe_globals.g_reason_comments,
1148: p_audit_flag => l_audit_flag,
1168: END IF;
1169: END IF;
1170:
1171: END IF;
1172: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i); -- get subscript of next element
1173: END LOOP;
1174:
1175: -- added for bug 4321689
1176: x_return_status := l_return_status;
1237: END IF;
1238:
1239: -- added for bug 3518059
1240: -- add g_header_created check to fix bug 3700341
1241: if OE_Order_Util.g_header_rec.operation = OE_GLOBALS.G_OPR_CREATE OR
1242: OE_GLOBALS.G_HEADER_CREATED OR
1243: OE_Blanket_Util.g_header_rec.operation = OE_GLOBALS.G_OPR_CREATE then
1244: IF l_debug_level > 0 THEN
1245: oe_debug_pub.add(' OEXUVERB: header is created, do nothing',1);
1312:
1313: G_UI_CALLED := TRUE;
1314:
1315: IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN
1316: IF OE_Order_Util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR THEN
1317: g_temp_reason_code := OE_Order_Util.g_header_rec.change_reason;
1318: g_temp_reason_comments := OE_Order_Util.g_header_rec.change_comments;
1319: RETURN TRUE;
1320: END IF;
1313: G_UI_CALLED := TRUE;
1314:
1315: IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN
1316: IF OE_Order_Util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR THEN
1317: g_temp_reason_code := OE_Order_Util.g_header_rec.change_reason;
1318: g_temp_reason_comments := OE_Order_Util.g_header_rec.change_comments;
1319: RETURN TRUE;
1320: END IF;
1321: ELSE
1314:
1315: IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN
1316: IF OE_Order_Util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR THEN
1317: g_temp_reason_code := OE_Order_Util.g_header_rec.change_reason;
1318: g_temp_reason_comments := OE_Order_Util.g_header_rec.change_comments;
1319: RETURN TRUE;
1320: END IF;
1321: ELSE
1322:
1319: RETURN TRUE;
1320: END IF;
1321: ELSE
1322:
1323: OE_Order_Util.Return_Glb_Ent_Index(
1324: p_entity_code,
1325: p_entity_id,
1326: l_ind,
1327: l_result,
1328: l_return_stat);
1329:
1330: IF l_result = FND_API.G_TRUE THEN
1331: IF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN
1332: IF OE_Order_Util.g_line_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1333: g_temp_reason_code := OE_Order_Util.g_line_tbl(l_ind).change_reason;
1334: g_temp_reason_comments := OE_Order_Util.g_line_tbl(l_ind).change_comments;
1335: RETURN TRUE;
1336: END IF;
1329:
1330: IF l_result = FND_API.G_TRUE THEN
1331: IF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN
1332: IF OE_Order_Util.g_line_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1333: g_temp_reason_code := OE_Order_Util.g_line_tbl(l_ind).change_reason;
1334: g_temp_reason_comments := OE_Order_Util.g_line_tbl(l_ind).change_comments;
1335: RETURN TRUE;
1336: END IF;
1337: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
1330: IF l_result = FND_API.G_TRUE THEN
1331: IF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN
1332: IF OE_Order_Util.g_line_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1333: g_temp_reason_code := OE_Order_Util.g_line_tbl(l_ind).change_reason;
1334: g_temp_reason_comments := OE_Order_Util.g_line_tbl(l_ind).change_comments;
1335: RETURN TRUE;
1336: END IF;
1337: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
1338: IF OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1334: g_temp_reason_comments := OE_Order_Util.g_line_tbl(l_ind).change_comments;
1335: RETURN TRUE;
1336: END IF;
1337: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
1338: IF OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1339: g_temp_reason_code := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code;
1340: g_temp_reason_comments := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_text;
1341: RETURN TRUE;
1342: END IF;
1335: RETURN TRUE;
1336: END IF;
1337: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
1338: IF OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1339: g_temp_reason_code := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code;
1340: g_temp_reason_comments := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_text;
1341: RETURN TRUE;
1342: END IF;
1343: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_SCREDIT THEN
1336: END IF;
1337: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
1338: IF OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1339: g_temp_reason_code := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code;
1340: g_temp_reason_comments := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_text;
1341: RETURN TRUE;
1342: END IF;
1343: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_SCREDIT THEN
1344: IF OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1340: g_temp_reason_comments := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_text;
1341: RETURN TRUE;
1342: END IF;
1343: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_SCREDIT THEN
1344: IF OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1345: g_temp_reason_code := OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason;
1346: g_temp_reason_comments := OE_Order_Util.g_header_scredit_tbl(l_ind).change_comments;
1347: RETURN TRUE;
1348: END IF;
1341: RETURN TRUE;
1342: END IF;
1343: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_SCREDIT THEN
1344: IF OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1345: g_temp_reason_code := OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason;
1346: g_temp_reason_comments := OE_Order_Util.g_header_scredit_tbl(l_ind).change_comments;
1347: RETURN TRUE;
1348: END IF;
1349: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
1342: END IF;
1343: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_SCREDIT THEN
1344: IF OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1345: g_temp_reason_code := OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason;
1346: g_temp_reason_comments := OE_Order_Util.g_header_scredit_tbl(l_ind).change_comments;
1347: RETURN TRUE;
1348: END IF;
1349: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
1350: IF OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1346: g_temp_reason_comments := OE_Order_Util.g_header_scredit_tbl(l_ind).change_comments;
1347: RETURN TRUE;
1348: END IF;
1349: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
1350: IF OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1351: g_temp_reason_code := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code;
1352: g_temp_reason_comments := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_text;
1353: RETURN TRUE;
1354: END IF;
1347: RETURN TRUE;
1348: END IF;
1349: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
1350: IF OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1351: g_temp_reason_code := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code;
1352: g_temp_reason_comments := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_text;
1353: RETURN TRUE;
1354: END IF;
1355: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_SCREDIT THEN
1348: END IF;
1349: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
1350: IF OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1351: g_temp_reason_code := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code;
1352: g_temp_reason_comments := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_text;
1353: RETURN TRUE;
1354: END IF;
1355: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_SCREDIT THEN
1356: IF OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1352: g_temp_reason_comments := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_text;
1353: RETURN TRUE;
1354: END IF;
1355: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_SCREDIT THEN
1356: IF OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1357: g_temp_reason_code := OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason;
1358: g_temp_reason_comments := OE_Order_Util.g_line_scredit_tbl(l_ind).change_comments;
1359: RETURN TRUE;
1360: END IF;
1353: RETURN TRUE;
1354: END IF;
1355: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_SCREDIT THEN
1356: IF OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1357: g_temp_reason_code := OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason;
1358: g_temp_reason_comments := OE_Order_Util.g_line_scredit_tbl(l_ind).change_comments;
1359: RETURN TRUE;
1360: END IF;
1361: END IF;
1354: END IF;
1355: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_SCREDIT THEN
1356: IF OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1357: g_temp_reason_code := OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason;
1358: g_temp_reason_comments := OE_Order_Util.g_line_scredit_tbl(l_ind).change_comments;
1359: RETURN TRUE;
1360: END IF;
1361: END IF;
1362: END IF;
1393: oe_debug_pub.add('hist type :'||p_hist_type_code);
1394: end if;
1395:
1396: IF p_entity_code <> OE_GLOBALS.G_ENTITY_HEADER THEN
1397: OE_Order_Util.Return_Glb_Ent_Index(
1398: p_entity_code,
1399: p_entity_id,
1400: l_ind,
1401: l_result,
1484: x_reason_code := OE_GLOBALS.G_REASON_CODE;
1485: x_reason_comments := OE_GLOBALS.G_REASON_COMMENTS;
1486: end if;
1487:
1488: if oe_order_util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR then
1489: x_reason_code := oe_order_util.g_header_rec.change_reason;
1490: x_reason_comments := oe_order_util.g_header_rec.change_comments;
1491: RETURN;
1492: else
1485: x_reason_comments := OE_GLOBALS.G_REASON_COMMENTS;
1486: end if;
1487:
1488: if oe_order_util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR then
1489: x_reason_code := oe_order_util.g_header_rec.change_reason;
1490: x_reason_comments := oe_order_util.g_header_rec.change_comments;
1491: RETURN;
1492: else
1493:
1486: end if;
1487:
1488: if oe_order_util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR then
1489: x_reason_code := oe_order_util.g_header_rec.change_reason;
1490: x_reason_comments := oe_order_util.g_header_rec.change_comments;
1491: RETURN;
1492: else
1493:
1494: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
1490: x_reason_comments := oe_order_util.g_header_rec.change_comments;
1491: RETURN;
1492: else
1493:
1494: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
1495: WHILE i IS NOT NULL LOOP
1496: if oe_order_util.g_header_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1497: x_reason_code := oe_order_util.g_header_adj_tbl(i).change_reason_code;
1498: x_reason_comments := oe_order_util.g_header_adj_tbl(i).change_reason_text;
1492: else
1493:
1494: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
1495: WHILE i IS NOT NULL LOOP
1496: if oe_order_util.g_header_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1497: x_reason_code := oe_order_util.g_header_adj_tbl(i).change_reason_code;
1498: x_reason_comments := oe_order_util.g_header_adj_tbl(i).change_reason_text;
1499: RETURN;
1500: end if;
1493:
1494: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
1495: WHILE i IS NOT NULL LOOP
1496: if oe_order_util.g_header_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1497: x_reason_code := oe_order_util.g_header_adj_tbl(i).change_reason_code;
1498: x_reason_comments := oe_order_util.g_header_adj_tbl(i).change_reason_text;
1499: RETURN;
1500: end if;
1501: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
1494: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
1495: WHILE i IS NOT NULL LOOP
1496: if oe_order_util.g_header_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1497: x_reason_code := oe_order_util.g_header_adj_tbl(i).change_reason_code;
1498: x_reason_comments := oe_order_util.g_header_adj_tbl(i).change_reason_text;
1499: RETURN;
1500: end if;
1501: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
1502: END LOOP;
1497: x_reason_code := oe_order_util.g_header_adj_tbl(i).change_reason_code;
1498: x_reason_comments := oe_order_util.g_header_adj_tbl(i).change_reason_text;
1499: RETURN;
1500: end if;
1501: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
1502: END LOOP;
1503:
1504: i := oe_order_util.g_header_scredit_tbl.FIRST;
1505: WHILE i IS NOT NULL LOOP
1500: end if;
1501: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
1502: END LOOP;
1503:
1504: i := oe_order_util.g_header_scredit_tbl.FIRST;
1505: WHILE i IS NOT NULL LOOP
1506: if oe_order_util.g_header_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1507: x_reason_code := oe_order_util.g_header_scredit_tbl(i).change_reason;
1508: x_reason_comments := oe_order_util.g_header_scredit_tbl(i).change_comments;
1502: END LOOP;
1503:
1504: i := oe_order_util.g_header_scredit_tbl.FIRST;
1505: WHILE i IS NOT NULL LOOP
1506: if oe_order_util.g_header_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1507: x_reason_code := oe_order_util.g_header_scredit_tbl(i).change_reason;
1508: x_reason_comments := oe_order_util.g_header_scredit_tbl(i).change_comments;
1509: RETURN;
1510: end if;
1503:
1504: i := oe_order_util.g_header_scredit_tbl.FIRST;
1505: WHILE i IS NOT NULL LOOP
1506: if oe_order_util.g_header_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1507: x_reason_code := oe_order_util.g_header_scredit_tbl(i).change_reason;
1508: x_reason_comments := oe_order_util.g_header_scredit_tbl(i).change_comments;
1509: RETURN;
1510: end if;
1511: i := oe_order_util.g_header_scredit_tbl.NEXT(i);
1504: i := oe_order_util.g_header_scredit_tbl.FIRST;
1505: WHILE i IS NOT NULL LOOP
1506: if oe_order_util.g_header_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1507: x_reason_code := oe_order_util.g_header_scredit_tbl(i).change_reason;
1508: x_reason_comments := oe_order_util.g_header_scredit_tbl(i).change_comments;
1509: RETURN;
1510: end if;
1511: i := oe_order_util.g_header_scredit_tbl.NEXT(i);
1512: END LOOP;
1507: x_reason_code := oe_order_util.g_header_scredit_tbl(i).change_reason;
1508: x_reason_comments := oe_order_util.g_header_scredit_tbl(i).change_comments;
1509: RETURN;
1510: end if;
1511: i := oe_order_util.g_header_scredit_tbl.NEXT(i);
1512: END LOOP;
1513:
1514: i := oe_order_util.g_line_tbl.FIRST;
1515: WHILE i IS NOT NULL LOOP
1510: end if;
1511: i := oe_order_util.g_header_scredit_tbl.NEXT(i);
1512: END LOOP;
1513:
1514: i := oe_order_util.g_line_tbl.FIRST;
1515: WHILE i IS NOT NULL LOOP
1516: if oe_order_util.g_line_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1517: x_reason_code := oe_order_util.g_line_tbl(i).change_reason;
1518: x_reason_comments := oe_order_util.g_line_tbl(i).change_comments;
1512: END LOOP;
1513:
1514: i := oe_order_util.g_line_tbl.FIRST;
1515: WHILE i IS NOT NULL LOOP
1516: if oe_order_util.g_line_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1517: x_reason_code := oe_order_util.g_line_tbl(i).change_reason;
1518: x_reason_comments := oe_order_util.g_line_tbl(i).change_comments;
1519: RETURN;
1520: end if;
1513:
1514: i := oe_order_util.g_line_tbl.FIRST;
1515: WHILE i IS NOT NULL LOOP
1516: if oe_order_util.g_line_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1517: x_reason_code := oe_order_util.g_line_tbl(i).change_reason;
1518: x_reason_comments := oe_order_util.g_line_tbl(i).change_comments;
1519: RETURN;
1520: end if;
1521: i := oe_order_util.g_line_tbl.NEXT(i);
1514: i := oe_order_util.g_line_tbl.FIRST;
1515: WHILE i IS NOT NULL LOOP
1516: if oe_order_util.g_line_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1517: x_reason_code := oe_order_util.g_line_tbl(i).change_reason;
1518: x_reason_comments := oe_order_util.g_line_tbl(i).change_comments;
1519: RETURN;
1520: end if;
1521: i := oe_order_util.g_line_tbl.NEXT(i);
1522: END LOOP;
1517: x_reason_code := oe_order_util.g_line_tbl(i).change_reason;
1518: x_reason_comments := oe_order_util.g_line_tbl(i).change_comments;
1519: RETURN;
1520: end if;
1521: i := oe_order_util.g_line_tbl.NEXT(i);
1522: END LOOP;
1523:
1524: i := oe_order_util.g_line_adj_tbl.FIRST;
1525: WHILE i IS NOT NULL LOOP
1520: end if;
1521: i := oe_order_util.g_line_tbl.NEXT(i);
1522: END LOOP;
1523:
1524: i := oe_order_util.g_line_adj_tbl.FIRST;
1525: WHILE i IS NOT NULL LOOP
1526: if oe_order_util.g_line_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1527: x_reason_code := oe_order_util.g_line_adj_tbl(i).change_reason_code;
1528: x_reason_comments := oe_order_util.g_line_adj_tbl(i).change_reason_text;
1522: END LOOP;
1523:
1524: i := oe_order_util.g_line_adj_tbl.FIRST;
1525: WHILE i IS NOT NULL LOOP
1526: if oe_order_util.g_line_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1527: x_reason_code := oe_order_util.g_line_adj_tbl(i).change_reason_code;
1528: x_reason_comments := oe_order_util.g_line_adj_tbl(i).change_reason_text;
1529: RETURN;
1530: end if;
1523:
1524: i := oe_order_util.g_line_adj_tbl.FIRST;
1525: WHILE i IS NOT NULL LOOP
1526: if oe_order_util.g_line_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1527: x_reason_code := oe_order_util.g_line_adj_tbl(i).change_reason_code;
1528: x_reason_comments := oe_order_util.g_line_adj_tbl(i).change_reason_text;
1529: RETURN;
1530: end if;
1531: i := oe_order_util.g_line_adj_tbl.NEXT(i);
1524: i := oe_order_util.g_line_adj_tbl.FIRST;
1525: WHILE i IS NOT NULL LOOP
1526: if oe_order_util.g_line_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1527: x_reason_code := oe_order_util.g_line_adj_tbl(i).change_reason_code;
1528: x_reason_comments := oe_order_util.g_line_adj_tbl(i).change_reason_text;
1529: RETURN;
1530: end if;
1531: i := oe_order_util.g_line_adj_tbl.NEXT(i);
1532: END LOOP;
1527: x_reason_code := oe_order_util.g_line_adj_tbl(i).change_reason_code;
1528: x_reason_comments := oe_order_util.g_line_adj_tbl(i).change_reason_text;
1529: RETURN;
1530: end if;
1531: i := oe_order_util.g_line_adj_tbl.NEXT(i);
1532: END LOOP;
1533:
1534: i := oe_order_util.g_line_scredit_tbl.FIRST;
1535: WHILE i IS NOT NULL LOOP
1530: end if;
1531: i := oe_order_util.g_line_adj_tbl.NEXT(i);
1532: END LOOP;
1533:
1534: i := oe_order_util.g_line_scredit_tbl.FIRST;
1535: WHILE i IS NOT NULL LOOP
1536: if oe_order_util.g_line_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1537: x_reason_code := oe_order_util.g_line_scredit_tbl(i).change_reason;
1538: x_reason_comments := oe_order_util.g_line_scredit_tbl(i).change_comments;
1532: END LOOP;
1533:
1534: i := oe_order_util.g_line_scredit_tbl.FIRST;
1535: WHILE i IS NOT NULL LOOP
1536: if oe_order_util.g_line_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1537: x_reason_code := oe_order_util.g_line_scredit_tbl(i).change_reason;
1538: x_reason_comments := oe_order_util.g_line_scredit_tbl(i).change_comments;
1539: RETURN;
1540: end if;
1533:
1534: i := oe_order_util.g_line_scredit_tbl.FIRST;
1535: WHILE i IS NOT NULL LOOP
1536: if oe_order_util.g_line_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1537: x_reason_code := oe_order_util.g_line_scredit_tbl(i).change_reason;
1538: x_reason_comments := oe_order_util.g_line_scredit_tbl(i).change_comments;
1539: RETURN;
1540: end if;
1541: i := oe_order_util.g_line_scredit_tbl.NEXT(i);
1534: i := oe_order_util.g_line_scredit_tbl.FIRST;
1535: WHILE i IS NOT NULL LOOP
1536: if oe_order_util.g_line_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1537: x_reason_code := oe_order_util.g_line_scredit_tbl(i).change_reason;
1538: x_reason_comments := oe_order_util.g_line_scredit_tbl(i).change_comments;
1539: RETURN;
1540: end if;
1541: i := oe_order_util.g_line_scredit_tbl.NEXT(i);
1542: END LOOP;
1537: x_reason_code := oe_order_util.g_line_scredit_tbl(i).change_reason;
1538: x_reason_comments := oe_order_util.g_line_scredit_tbl(i).change_comments;
1539: RETURN;
1540: end if;
1541: i := oe_order_util.g_line_scredit_tbl.NEXT(i);
1542: END LOOP;
1543:
1544: end if;
1545: