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);
204: IF (OE_GLOBALS.G_ROLL_VERSION = 'PV') THEN
205: l_version_flag := 'Y';
206: l_phase_change_flag := 'Y';
207: IF (p_document_type <> 'BLANKETS') THEN
208: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
209: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
210: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
211: ELSE
212: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
205: l_version_flag := 'Y';
206: l_phase_change_flag := 'Y';
207: IF (p_document_type <> 'BLANKETS') THEN
208: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
209: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
210: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
211: ELSE
212: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
213: END IF;
208: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
209: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
210: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
211: ELSE
212: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
213: END IF;
214: END IF;
215: ELSIF (OE_GLOBALS.G_ROLL_VERSION = 'P') THEN
216: l_version_flag := 'N';
218: ELSE
219: l_phase_change_flag := 'N';
220: l_version_flag := 'Y';
221: IF (p_document_type <> 'BLANKETS') THEN
222: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
223: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
224: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
225: ELSE
226: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
219: l_phase_change_flag := 'N';
220: l_version_flag := 'Y';
221: IF (p_document_type <> 'BLANKETS') THEN
222: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
223: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
224: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
225: ELSE
226: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
227: END IF;
222: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
223: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
224: select version_number into l_version_number from oe_order_headers_all where header_id = p_header_id;
225: ELSE
226: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
227: END IF;
228: END IF;
229: END IF;
230:
300:
301:
302: -- Return if header is created in same operation
303: -- add g_header_created check to fix bug 3700341
304: IF OE_Order_Util.g_header_rec.operation = OE_GLOBALS.G_OPR_CREATE OR
305: OE_GLOBALS.G_HEADER_CREATED THEN
306: IF l_debug_level > 0 THEN
307: oe_debug_pub.add('Not versioning because header was also created',1);
308: END IF;
423: INTO l_lock_control
424: FROM OE_ORDER_HEADERS_ALL
425: WHERE HEADER_ID = p_header_id;
426:
427: IF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER
428: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER IS NULL
429: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM
430: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER IS NULL
431: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM THEN
424: FROM OE_ORDER_HEADERS_ALL
425: WHERE HEADER_ID = p_header_id;
426:
427: IF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER
428: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER IS NULL
429: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM
430: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER IS NULL
431: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM THEN
432: UPDATE OE_ORDER_HEADERS_ALL
425: WHERE HEADER_ID = p_header_id;
426:
427: IF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER
428: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER IS NULL
429: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM
430: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER IS NULL
431: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM THEN
432: UPDATE OE_ORDER_HEADERS_ALL
433: SET VERSION_NUMBER = l_version_number + 1,
426:
427: IF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER
428: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER IS NULL
429: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM
430: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER IS NULL
431: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM THEN
432: UPDATE OE_ORDER_HEADERS_ALL
433: SET VERSION_NUMBER = l_version_number + 1,
434: LOCK_CONTROL = l_lock_control + 1
427: IF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER
428: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER IS NULL
429: OR OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM
430: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER IS NULL
431: OR OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER = FND_API.G_MISS_NUM THEN
432: UPDATE OE_ORDER_HEADERS_ALL
433: SET VERSION_NUMBER = l_version_number + 1,
434: LOCK_CONTROL = l_lock_control + 1
435: WHERE HEADER_ID = p_header_id;
442: OE_ORDER_CACHE.g_header_rec.version_number := l_version_number + 1;
443: OE_ORDER_CACHE.g_header_rec.lock_control := l_lock_control + 1;
444:
445: OE_GLOBALS.G_CASCADING_REQUEST_LOGGED := TRUE;
446: ELSIF OE_ORDER_UTIL.G_HEADER_REC.VERSION_NUMBER < OE_ORDER_UTIL.G_OLD_HEADER_REC.VERSION_NUMBER THEN
447: FND_MESSAGE.SET_NAME('ONT','OE_BLKT_INVALID_REVISION_NUM');
448: OE_MSG_PUB.ADD;
449:
450: RAISE FND_API.G_EXC_ERROR;
453:
454: G_VERSION_NUMBER := l_version_number;
455: --added for bug5216912 start
456: if G_VERSION_NUMBER is null then
457: G_VERSION_NUMBER := OE_ORDER_UTIL.g_old_header_rec.version_number;
458: end if;
459: --added for bug5216912 end
460: -- added for 3679627
461: x_return_status := l_return_status;
500: BEGIN
501:
502: -- Get current header_id
503:
504: if oe_order_util.g_header_id <> FND_API.G_MISS_NUM then
505: RETURN oe_order_util.g_header_id;
506: elsif
507: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
508: RETURN oe_order_util.g_old_header_rec.header_id;
501:
502: -- Get current header_id
503:
504: if oe_order_util.g_header_id <> FND_API.G_MISS_NUM then
505: RETURN oe_order_util.g_header_id;
506: elsif
507: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
508: RETURN oe_order_util.g_old_header_rec.header_id;
509: elsif
503:
504: if oe_order_util.g_header_id <> FND_API.G_MISS_NUM then
505: RETURN oe_order_util.g_header_id;
506: elsif
507: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
508: RETURN oe_order_util.g_old_header_rec.header_id;
509: elsif
510: oe_order_util.g_header_rec.header_id <> FND_API.G_MISS_NUM then
511: RETURN oe_order_util.g_header_rec.header_id;
504: if oe_order_util.g_header_id <> FND_API.G_MISS_NUM then
505: RETURN oe_order_util.g_header_id;
506: elsif
507: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
508: RETURN oe_order_util.g_old_header_rec.header_id;
509: elsif
510: oe_order_util.g_header_rec.header_id <> FND_API.G_MISS_NUM then
511: RETURN oe_order_util.g_header_rec.header_id;
512: else
506: elsif
507: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
508: RETURN oe_order_util.g_old_header_rec.header_id;
509: elsif
510: oe_order_util.g_header_rec.header_id <> FND_API.G_MISS_NUM then
511: RETURN oe_order_util.g_header_rec.header_id;
512: else
513: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
514: WHILE i IS NOT NULL LOOP
507: oe_order_util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM then
508: RETURN oe_order_util.g_old_header_rec.header_id;
509: elsif
510: oe_order_util.g_header_rec.header_id <> FND_API.G_MISS_NUM then
511: RETURN oe_order_util.g_header_rec.header_id;
512: else
513: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
514: WHILE i IS NOT NULL LOOP
515: if oe_order_util.g_old_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
509: elsif
510: oe_order_util.g_header_rec.header_id <> FND_API.G_MISS_NUM then
511: RETURN oe_order_util.g_header_rec.header_id;
512: else
513: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
514: WHILE i IS NOT NULL LOOP
515: if oe_order_util.g_old_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
516: RETURN oe_order_util.g_old_line_tbl(i).header_id;
517: end if;
511: RETURN oe_order_util.g_header_rec.header_id;
512: else
513: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
514: WHILE i IS NOT NULL LOOP
515: if oe_order_util.g_old_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
516: RETURN oe_order_util.g_old_line_tbl(i).header_id;
517: end if;
518: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
519: END LOOP;
512: else
513: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
514: WHILE i IS NOT NULL LOOP
515: if oe_order_util.g_old_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
516: RETURN oe_order_util.g_old_line_tbl(i).header_id;
517: end if;
518: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
519: END LOOP;
520:
514: WHILE i IS NOT NULL LOOP
515: if oe_order_util.g_old_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
516: RETURN oe_order_util.g_old_line_tbl(i).header_id;
517: end if;
518: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
519: END LOOP;
520:
521: i := oe_order_util.g_line_tbl.FIRST; -- get subscript of first element
522: WHILE i IS NOT NULL LOOP
517: end if;
518: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
519: END LOOP;
520:
521: i := oe_order_util.g_line_tbl.FIRST; -- get subscript of first element
522: WHILE i IS NOT NULL LOOP
523: if oe_order_util.g_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
524: RETURN oe_order_util.g_line_tbl(i).header_id;
525: end if;
519: END LOOP;
520:
521: i := oe_order_util.g_line_tbl.FIRST; -- get subscript of first element
522: WHILE i IS NOT NULL LOOP
523: if oe_order_util.g_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
524: RETURN oe_order_util.g_line_tbl(i).header_id;
525: end if;
526: i := oe_order_util.g_line_tbl.NEXT(i); -- get subscript of next element
527: END LOOP;
520:
521: i := oe_order_util.g_line_tbl.FIRST; -- get subscript of first element
522: WHILE i IS NOT NULL LOOP
523: if oe_order_util.g_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
524: RETURN oe_order_util.g_line_tbl(i).header_id;
525: end if;
526: i := oe_order_util.g_line_tbl.NEXT(i); -- get subscript of next element
527: END LOOP;
528:
522: WHILE i IS NOT NULL LOOP
523: if oe_order_util.g_line_tbl(i).header_id <> FND_API.G_MISS_NUM then
524: RETURN oe_order_util.g_line_tbl(i).header_id;
525: end if;
526: i := oe_order_util.g_line_tbl.NEXT(i); -- get subscript of next element
527: END LOOP;
528:
529: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
530: WHILE i IS NOT NULL LOOP
525: end if;
526: i := oe_order_util.g_line_tbl.NEXT(i); -- get subscript of next element
527: END LOOP;
528:
529: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
530: WHILE i IS NOT NULL LOOP
531: if oe_order_util.g_old_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
532: RETURN oe_order_util.g_old_header_adj_tbl(i).header_id;
533: end if;
527: END LOOP;
528:
529: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
530: WHILE i IS NOT NULL LOOP
531: if oe_order_util.g_old_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
532: RETURN oe_order_util.g_old_header_adj_tbl(i).header_id;
533: end if;
534: i := oe_order_util.g_old_header_adj_tbl.NEXT(i); -- get subscript of next element
535: END LOOP;
528:
529: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
530: WHILE i IS NOT NULL LOOP
531: if oe_order_util.g_old_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
532: RETURN oe_order_util.g_old_header_adj_tbl(i).header_id;
533: end if;
534: i := oe_order_util.g_old_header_adj_tbl.NEXT(i); -- get subscript of next element
535: END LOOP;
536:
530: WHILE i IS NOT NULL LOOP
531: if oe_order_util.g_old_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
532: RETURN oe_order_util.g_old_header_adj_tbl(i).header_id;
533: end if;
534: i := oe_order_util.g_old_header_adj_tbl.NEXT(i); -- get subscript of next element
535: END LOOP;
536:
537: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
538: WHILE i IS NOT NULL LOOP
533: end if;
534: i := oe_order_util.g_old_header_adj_tbl.NEXT(i); -- get subscript of next element
535: END LOOP;
536:
537: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
538: WHILE i IS NOT NULL LOOP
539: if oe_order_util.g_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
540: RETURN oe_order_util.g_header_adj_tbl(i).header_id;
541: end if;
535: END LOOP;
536:
537: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
538: WHILE i IS NOT NULL LOOP
539: if oe_order_util.g_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
540: RETURN oe_order_util.g_header_adj_tbl(i).header_id;
541: end if;
542: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
543: END LOOP;
536:
537: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
538: WHILE i IS NOT NULL LOOP
539: if oe_order_util.g_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
540: RETURN oe_order_util.g_header_adj_tbl(i).header_id;
541: end if;
542: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
543: END LOOP;
544:
538: WHILE i IS NOT NULL LOOP
539: if oe_order_util.g_header_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
540: RETURN oe_order_util.g_header_adj_tbl(i).header_id;
541: end if;
542: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
543: END LOOP;
544:
545: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
546: WHILE i IS NOT NULL LOOP
541: end if;
542: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
543: END LOOP;
544:
545: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
546: WHILE i IS NOT NULL LOOP
547: if oe_order_util.g_old_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
548: RETURN oe_order_util.g_old_line_adj_tbl(i).header_id;
549: end if;
543: END LOOP;
544:
545: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
546: WHILE i IS NOT NULL LOOP
547: if oe_order_util.g_old_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
548: RETURN oe_order_util.g_old_line_adj_tbl(i).header_id;
549: end if;
550: i := oe_order_util.g_old_line_adj_tbl.NEXT(i); -- get subscript of next element
551: END LOOP;
544:
545: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
546: WHILE i IS NOT NULL LOOP
547: if oe_order_util.g_old_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
548: RETURN oe_order_util.g_old_line_adj_tbl(i).header_id;
549: end if;
550: i := oe_order_util.g_old_line_adj_tbl.NEXT(i); -- get subscript of next element
551: END LOOP;
552:
546: WHILE i IS NOT NULL LOOP
547: if oe_order_util.g_old_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
548: RETURN oe_order_util.g_old_line_adj_tbl(i).header_id;
549: end if;
550: i := oe_order_util.g_old_line_adj_tbl.NEXT(i); -- get subscript of next element
551: END LOOP;
552:
553: i := oe_order_util.g_line_adj_tbl.FIRST; -- get subscript of first element
554: WHILE i IS NOT NULL LOOP
549: end if;
550: i := oe_order_util.g_old_line_adj_tbl.NEXT(i); -- get subscript of next element
551: END LOOP;
552:
553: i := oe_order_util.g_line_adj_tbl.FIRST; -- get subscript of first element
554: WHILE i IS NOT NULL LOOP
555: if oe_order_util.g_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
556: RETURN oe_order_util.g_line_adj_tbl(i).header_id;
557: end if;
551: END LOOP;
552:
553: i := oe_order_util.g_line_adj_tbl.FIRST; -- get subscript of first element
554: WHILE i IS NOT NULL LOOP
555: if oe_order_util.g_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
556: RETURN oe_order_util.g_line_adj_tbl(i).header_id;
557: end if;
558: i := oe_order_util.g_line_adj_tbl.NEXT(i); -- get subscript of next element
559: END LOOP;
552:
553: i := oe_order_util.g_line_adj_tbl.FIRST; -- get subscript of first element
554: WHILE i IS NOT NULL LOOP
555: if oe_order_util.g_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
556: RETURN oe_order_util.g_line_adj_tbl(i).header_id;
557: end if;
558: i := oe_order_util.g_line_adj_tbl.NEXT(i); -- get subscript of next element
559: END LOOP;
560:
554: WHILE i IS NOT NULL LOOP
555: if oe_order_util.g_line_adj_tbl(i).header_id <> FND_API.G_MISS_NUM then
556: RETURN oe_order_util.g_line_adj_tbl(i).header_id;
557: end if;
558: i := oe_order_util.g_line_adj_tbl.NEXT(i); -- get subscript of next element
559: END LOOP;
560:
561: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
562: WHILE i IS NOT NULL LOOP
557: end if;
558: i := oe_order_util.g_line_adj_tbl.NEXT(i); -- get subscript of next element
559: END LOOP;
560:
561: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
562: WHILE i IS NOT NULL LOOP
563: if oe_order_util.g_old_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
564: RETURN oe_order_util.g_old_header_scredit_tbl(i).header_id;
565: end if;
559: END LOOP;
560:
561: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
562: WHILE i IS NOT NULL LOOP
563: if oe_order_util.g_old_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
564: RETURN oe_order_util.g_old_header_scredit_tbl(i).header_id;
565: end if;
566: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i); -- get subscript of next element
567: END LOOP;
560:
561: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
562: WHILE i IS NOT NULL LOOP
563: if oe_order_util.g_old_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
564: RETURN oe_order_util.g_old_header_scredit_tbl(i).header_id;
565: end if;
566: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i); -- get subscript of next element
567: END LOOP;
568:
562: WHILE i IS NOT NULL LOOP
563: if oe_order_util.g_old_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
564: RETURN oe_order_util.g_old_header_scredit_tbl(i).header_id;
565: end if;
566: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i); -- get subscript of next element
567: END LOOP;
568:
569: i := oe_order_util.g_header_scredit_tbl.FIRST; -- get subscript of first element
570: WHILE i IS NOT NULL LOOP
565: end if;
566: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i); -- get subscript of next element
567: END LOOP;
568:
569: i := oe_order_util.g_header_scredit_tbl.FIRST; -- get subscript of first element
570: WHILE i IS NOT NULL LOOP
571: if oe_order_util.g_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
572: RETURN oe_order_util.g_header_scredit_tbl(i).header_id;
573: end if;
567: END LOOP;
568:
569: i := oe_order_util.g_header_scredit_tbl.FIRST; -- get subscript of first element
570: WHILE i IS NOT NULL LOOP
571: if oe_order_util.g_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
572: RETURN oe_order_util.g_header_scredit_tbl(i).header_id;
573: end if;
574: i := oe_order_util.g_header_scredit_tbl.NEXT(i); -- get subscript of next element
575: END LOOP;
568:
569: i := oe_order_util.g_header_scredit_tbl.FIRST; -- get subscript of first element
570: WHILE i IS NOT NULL LOOP
571: if oe_order_util.g_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
572: RETURN oe_order_util.g_header_scredit_tbl(i).header_id;
573: end if;
574: i := oe_order_util.g_header_scredit_tbl.NEXT(i); -- get subscript of next element
575: END LOOP;
576:
570: WHILE i IS NOT NULL LOOP
571: if oe_order_util.g_header_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
572: RETURN oe_order_util.g_header_scredit_tbl(i).header_id;
573: end if;
574: i := oe_order_util.g_header_scredit_tbl.NEXT(i); -- get subscript of next element
575: END LOOP;
576:
577: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
578: WHILE i IS NOT NULL LOOP
573: end if;
574: i := oe_order_util.g_header_scredit_tbl.NEXT(i); -- get subscript of next element
575: END LOOP;
576:
577: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
578: WHILE i IS NOT NULL LOOP
579: if oe_order_util.g_old_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
580: RETURN oe_order_util.g_old_line_scredit_tbl(i).header_id;
581: end if;
575: END LOOP;
576:
577: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
578: WHILE i IS NOT NULL LOOP
579: if oe_order_util.g_old_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
580: RETURN oe_order_util.g_old_line_scredit_tbl(i).header_id;
581: end if;
582: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i); -- get subscript of next element
583: END LOOP;
576:
577: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
578: WHILE i IS NOT NULL LOOP
579: if oe_order_util.g_old_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
580: RETURN oe_order_util.g_old_line_scredit_tbl(i).header_id;
581: end if;
582: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i); -- get subscript of next element
583: END LOOP;
584:
578: WHILE i IS NOT NULL LOOP
579: if oe_order_util.g_old_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
580: RETURN oe_order_util.g_old_line_scredit_tbl(i).header_id;
581: end if;
582: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i); -- get subscript of next element
583: END LOOP;
584:
585: i := oe_order_util.g_line_scredit_tbl.FIRST; -- get subscript of first element
586: WHILE i IS NOT NULL LOOP
581: end if;
582: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i); -- get subscript of next element
583: END LOOP;
584:
585: i := oe_order_util.g_line_scredit_tbl.FIRST; -- get subscript of first element
586: WHILE i IS NOT NULL LOOP
587: if oe_order_util.g_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
588: RETURN oe_order_util.g_line_scredit_tbl(i).header_id;
589: end if;
583: END LOOP;
584:
585: i := oe_order_util.g_line_scredit_tbl.FIRST; -- get subscript of first element
586: WHILE i IS NOT NULL LOOP
587: if oe_order_util.g_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
588: RETURN oe_order_util.g_line_scredit_tbl(i).header_id;
589: end if;
590: i := oe_order_util.g_line_scredit_tbl.NEXT(i); -- get subscript of next element
591: END LOOP;
584:
585: i := oe_order_util.g_line_scredit_tbl.FIRST; -- get subscript of first element
586: WHILE i IS NOT NULL LOOP
587: if oe_order_util.g_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
588: RETURN oe_order_util.g_line_scredit_tbl(i).header_id;
589: end if;
590: i := oe_order_util.g_line_scredit_tbl.NEXT(i); -- get subscript of next element
591: END LOOP;
592:
586: WHILE i IS NOT NULL LOOP
587: if oe_order_util.g_line_scredit_tbl(i).header_id <> FND_API.G_MISS_NUM then
588: RETURN oe_order_util.g_line_scredit_tbl(i).header_id;
589: end if;
590: i := oe_order_util.g_line_scredit_tbl.NEXT(i); -- get subscript of next element
591: END LOOP;
592:
593: end if;
594:
628: IF l_debug_level > 0 THEN
629: oe_debug_pub.add('OE_Versioning_Util header_id: ' || l_header_id,1);
630: END IF;
631:
632: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
633: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
634: select version_number into l_version_number from oe_order_headers_all where header_id = l_header_id;
635: ELSE
636: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
629: oe_debug_pub.add('OE_Versioning_Util header_id: ' || l_header_id,1);
630: END IF;
631:
632: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
633: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
634: select version_number into l_version_number from oe_order_headers_all where header_id = l_header_id;
635: ELSE
636: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
637: END IF;
632: IF OE_ORDER_UTIL.g_old_header_rec.version_number IS NULL
633: OR OE_ORDER_UTIL.g_old_header_rec.version_number = FND_API.G_MISS_NUM THEN
634: select version_number into l_version_number from oe_order_headers_all where header_id = l_header_id;
635: ELSE
636: l_version_number := OE_ORDER_UTIL.g_old_header_rec.version_number;
637: END IF;
638:
639: IF l_debug_level > 0 THEN
640: oe_debug_pub.add('Before updating history ',1);
640: oe_debug_pub.add('Before updating history ',1);
641: END IF;
642:
643: --Update history with audit flag information gathered in global picture
644: IF OE_Order_Util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM THEN
645: IF NOT OE_GLOBALS.Equal(OE_Order_Util.g_old_header_rec.operation, OE_GLOBALS.G_OPR_CREATE) AND
646: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
647: g_audit_header_hist_code IS NOT NULL) THEN
648:
641: END IF;
642:
643: --Update history with audit flag information gathered in global picture
644: IF OE_Order_Util.g_old_header_rec.header_id <> FND_API.G_MISS_NUM THEN
645: IF NOT OE_GLOBALS.Equal(OE_Order_Util.g_old_header_rec.operation, OE_GLOBALS.G_OPR_CREATE) AND
646: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
647: g_audit_header_hist_code IS NOT NULL) THEN
648:
649: IF g_audit_header_hist_code IS NOT NULL THEN
657: if g_audit_header_reason_required and l_audit_flag = 'Y' then
658: --Apply Reason for audit
659: OE_Reasons_Util.Apply_Reason(
660: p_entity_code => 'HEADER',
661: p_entity_id => oe_order_util.g_old_header_rec.header_id,
662: p_header_id => oe_order_util.g_old_header_rec.header_id,
663: p_version_number => l_version_number,
664: p_reason_type => 'CANCEL_CODE',
665: p_reason_code => OE_ORDER_UTIL.g_header_rec.change_reason,
658: --Apply Reason for audit
659: OE_Reasons_Util.Apply_Reason(
660: p_entity_code => 'HEADER',
661: p_entity_id => oe_order_util.g_old_header_rec.header_id,
662: p_header_id => oe_order_util.g_old_header_rec.header_id,
663: p_version_number => l_version_number,
664: p_reason_type => 'CANCEL_CODE',
665: p_reason_code => OE_ORDER_UTIL.g_header_rec.change_reason,
666: p_reason_comments => OE_ORDER_UTIL.g_header_rec.change_comments,
661: p_entity_id => oe_order_util.g_old_header_rec.header_id,
662: p_header_id => oe_order_util.g_old_header_rec.header_id,
663: p_version_number => l_version_number,
664: p_reason_type => 'CANCEL_CODE',
665: p_reason_code => OE_ORDER_UTIL.g_header_rec.change_reason,
666: p_reason_comments => OE_ORDER_UTIL.g_header_rec.change_comments,
667: x_reason_id => l_reason_id,
668: x_return_status => l_return_status);
669:
662: p_header_id => oe_order_util.g_old_header_rec.header_id,
663: p_version_number => l_version_number,
664: p_reason_type => 'CANCEL_CODE',
665: p_reason_code => OE_ORDER_UTIL.g_header_rec.change_reason,
666: p_reason_comments => OE_ORDER_UTIL.g_header_rec.change_comments,
667: x_reason_id => l_reason_id,
668: x_return_status => l_return_status);
669:
670: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
681:
682: end if; --end apply reason
683:
684: IF l_debug_level > 0 THEN
685: oe_debug_pub.add('Calling recordheaderhist operation: '|| oe_order_util.g_old_header_rec.operation,1);
686: END IF;
687:
688: OE_CHG_ORDER_PVT.RecordHeaderHist
689: ( p_header_id => oe_order_util.g_old_header_rec.header_id,
685: oe_debug_pub.add('Calling recordheaderhist operation: '|| oe_order_util.g_old_header_rec.operation,1);
686: END IF;
687:
688: OE_CHG_ORDER_PVT.RecordHeaderHist
689: ( p_header_id => oe_order_util.g_old_header_rec.header_id,
690: p_header_rec => oe_order_util.g_old_header_rec,
691: p_hist_type_code => l_hist_type_code,
692: p_reason_code => NULL,
693: p_comments => NULL,
686: END IF;
687:
688: OE_CHG_ORDER_PVT.RecordHeaderHist
689: ( p_header_id => oe_order_util.g_old_header_rec.header_id,
690: p_header_rec => oe_order_util.g_old_header_rec,
691: p_hist_type_code => l_hist_type_code,
692: p_reason_code => NULL,
693: p_comments => NULL,
694: p_audit_flag => l_audit_flag,
721: oe_debug_pub.add(' OEXUVERB: before recording lines ',1);
722: END IF;
723:
724: --Update history for lines
725: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
726: WHILE i IS NOT NULL LOOP
727: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
728: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
729: g_audit_line_id_tbl.exists(i)) THEN
723:
724: --Update history for lines
725: i := oe_order_util.g_old_line_tbl.FIRST; -- get subscript of first element
726: WHILE i IS NOT NULL LOOP
727: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
728: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
729: g_audit_line_id_tbl.exists(i)) THEN
730: IF g_audit_line_id_tbl.exists(i) THEN
731: l_audit_flag := 'Y';
748: -- value can be passed even if constraint does not require reason
749: -- but if reason is supplied for these hist types, it should be
750: -- captured.
751: OR (l_hist_type_code IN ('CANCELLATION','QUANTITY UPDATE')
752: and OE_ORDER_UTIL.g_line_tbl(i).change_reason is not null
753: and OE_ORDER_UTIL.g_line_tbl(i).change_reason <> fnd_api.g_miss_char
754: )
755: ) then
756: --Apply Reason for audit
749: -- but if reason is supplied for these hist types, it should be
750: -- captured.
751: OR (l_hist_type_code IN ('CANCELLATION','QUANTITY UPDATE')
752: and OE_ORDER_UTIL.g_line_tbl(i).change_reason is not null
753: and OE_ORDER_UTIL.g_line_tbl(i).change_reason <> fnd_api.g_miss_char
754: )
755: ) then
756: --Apply Reason for audit
757: OE_Reasons_Util.Apply_Reason(
755: ) then
756: --Apply Reason for audit
757: OE_Reasons_Util.Apply_Reason(
758: p_entity_code => 'LINE',
759: p_entity_id => oe_order_util.g_old_line_tbl(i).line_id,
760: p_header_id => oe_order_util.g_old_line_tbl(i).header_id,
761: p_version_number => l_version_number,
762: p_reason_type => 'CANCEL_CODE',
763: p_reason_code => OE_ORDER_UTIL.g_line_tbl(i).change_reason,
756: --Apply Reason for audit
757: OE_Reasons_Util.Apply_Reason(
758: p_entity_code => 'LINE',
759: p_entity_id => oe_order_util.g_old_line_tbl(i).line_id,
760: p_header_id => oe_order_util.g_old_line_tbl(i).header_id,
761: p_version_number => l_version_number,
762: p_reason_type => 'CANCEL_CODE',
763: p_reason_code => OE_ORDER_UTIL.g_line_tbl(i).change_reason,
764: p_reason_comments => OE_ORDER_UTIL.g_line_tbl(i).change_comments,
759: p_entity_id => oe_order_util.g_old_line_tbl(i).line_id,
760: p_header_id => oe_order_util.g_old_line_tbl(i).header_id,
761: p_version_number => l_version_number,
762: p_reason_type => 'CANCEL_CODE',
763: p_reason_code => OE_ORDER_UTIL.g_line_tbl(i).change_reason,
764: p_reason_comments => OE_ORDER_UTIL.g_line_tbl(i).change_comments,
765: x_reason_id => l_reason_id,
766: x_return_status => l_return_status);
767:
760: p_header_id => oe_order_util.g_old_line_tbl(i).header_id,
761: p_version_number => l_version_number,
762: p_reason_type => 'CANCEL_CODE',
763: p_reason_code => OE_ORDER_UTIL.g_line_tbl(i).change_reason,
764: p_reason_comments => OE_ORDER_UTIL.g_line_tbl(i).change_comments,
765: x_reason_id => l_reason_id,
766: x_return_status => l_return_status);
767:
768: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
779:
780: end if; --end apply reason
781:
782: IF l_debug_level > 0 THEN
783: oe_debug_pub.add('Calling recordlinehist operation: '|| oe_order_util.g_old_line_tbl(i).operation,1);
784: END IF;
785:
786: OE_CHG_ORDER_PVT.RecordLineHist
787: (p_line_id => oe_order_util.g_old_line_tbl(i).line_id,
783: oe_debug_pub.add('Calling recordlinehist operation: '|| oe_order_util.g_old_line_tbl(i).operation,1);
784: END IF;
785:
786: OE_CHG_ORDER_PVT.RecordLineHist
787: (p_line_id => oe_order_util.g_old_line_tbl(i).line_id,
788: p_line_rec => oe_order_util.g_old_line_tbl(i),
789: p_hist_type_code => l_hist_type_code,
790: p_reason_code => NULL,
791: p_comments => NULL,
784: END IF;
785:
786: OE_CHG_ORDER_PVT.RecordLineHist
787: (p_line_id => oe_order_util.g_old_line_tbl(i).line_id,
788: p_line_rec => oe_order_util.g_old_line_tbl(i),
789: p_hist_type_code => l_hist_type_code,
790: p_reason_code => NULL,
791: p_comments => NULL,
792: p_audit_flag => l_audit_flag,
812: END IF;
813: END IF;
814:
815: END IF;
816: i := oe_order_util.g_old_line_tbl.NEXT(i); -- get subscript of next element
817: END LOOP;
818:
819: IF l_debug_level > 0 THEN
820: oe_debug_pub.add(' OEXUVERB: before recording header adjs ',1);
820: oe_debug_pub.add(' OEXUVERB: before recording header adjs ',1);
821: END IF;
822:
823: --Update history for header adj
824: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
825: WHILE i IS NOT NULL LOOP
826: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_header_adj_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
827: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
828: g_audit_header_adj_id_tbl.exists(i)) THEN
822:
823: --Update history for header adj
824: i := oe_order_util.g_old_header_adj_tbl.FIRST; -- get subscript of first element
825: WHILE i IS NOT NULL LOOP
826: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_header_adj_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
827: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
828: g_audit_header_adj_id_tbl.exists(i)) THEN
829: IF g_audit_header_adj_id_tbl.exists(i) THEN
830: l_audit_flag := 'Y';
838: g_audit_header_adj_id_tbl(i).reason_required then
839: --Apply Reason for audit
840: OE_Reasons_Util.Apply_Reason(
841: p_entity_code => 'HEADER_ADJ',
842: p_entity_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
843: p_header_id => oe_order_util.g_old_header_adj_tbl(i).header_id,
844: p_version_number => l_version_number,
845: p_reason_type => 'CHANGE_CODE',
846: p_reason_code => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_code,
839: --Apply Reason for audit
840: OE_Reasons_Util.Apply_Reason(
841: p_entity_code => 'HEADER_ADJ',
842: p_entity_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
843: p_header_id => oe_order_util.g_old_header_adj_tbl(i).header_id,
844: p_version_number => l_version_number,
845: p_reason_type => 'CHANGE_CODE',
846: p_reason_code => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_code,
847: p_reason_comments => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_text,
842: p_entity_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
843: p_header_id => oe_order_util.g_old_header_adj_tbl(i).header_id,
844: p_version_number => l_version_number,
845: p_reason_type => 'CHANGE_CODE',
846: p_reason_code => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_code,
847: p_reason_comments => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_text,
848: x_reason_id => l_reason_id,
849: x_return_status => l_return_status);
850:
843: p_header_id => oe_order_util.g_old_header_adj_tbl(i).header_id,
844: p_version_number => l_version_number,
845: p_reason_type => 'CHANGE_CODE',
846: p_reason_code => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_code,
847: p_reason_comments => OE_ORDER_UTIL.g_header_adj_tbl(i).change_reason_text,
848: x_reason_id => l_reason_id,
849: x_return_status => l_return_status);
850:
851: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
862:
863: end if; --end apply reason
864:
865: IF l_debug_level > 0 THEN
866: oe_debug_pub.add('Calling recordHPAdjhist operation: '|| oe_order_util.g_old_header_adj_tbl(i).operation,1);
867: END IF;
868:
869: OE_CHG_ORDER_PVT.RecordHPAdjHist
870: (p_header_adj_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
866: oe_debug_pub.add('Calling recordHPAdjhist operation: '|| oe_order_util.g_old_header_adj_tbl(i).operation,1);
867: END IF;
868:
869: OE_CHG_ORDER_PVT.RecordHPAdjHist
870: (p_header_adj_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
871: p_header_adj_rec => oe_order_util.g_old_header_adj_tbl(i),
872: p_hist_type_code => l_hist_type_code,
873: p_reason_code => oe_globals.g_reason_code,
874: p_comments => oe_globals.g_reason_comments,
867: END IF;
868:
869: OE_CHG_ORDER_PVT.RecordHPAdjHist
870: (p_header_adj_id => oe_order_util.g_old_header_adj_tbl(i).price_adjustment_id,
871: p_header_adj_rec => oe_order_util.g_old_header_adj_tbl(i),
872: p_hist_type_code => l_hist_type_code,
873: p_reason_code => oe_globals.g_reason_code,
874: p_comments => oe_globals.g_reason_comments,
875: p_audit_flag => l_audit_flag,
896: END IF;
897: END IF;
898:
899: END IF;
900: i := oe_order_util.g_old_header_adj_tbl.NEXT(i); -- get subscript of next element
901: END LOOP;
902:
903:
904: IF l_debug_level > 0 THEN
905: oe_debug_pub.add(' OEXUVERB: before recording header scredits ',1);
906: END IF;
907:
908: --Update history for header scredit
909: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
910: WHILE i IS NOT NULL LOOP
911: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_header_scredit_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
912: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
913: g_audit_header_scredit_id_tbl.exists(i)) THEN
907:
908: --Update history for header scredit
909: i := oe_order_util.g_old_header_scredit_tbl.FIRST; -- get subscript of first element
910: WHILE i IS NOT NULL LOOP
911: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_header_scredit_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
912: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
913: g_audit_header_scredit_id_tbl.exists(i)) THEN
914: IF g_audit_header_scredit_id_tbl.exists(i) THEN
915: l_audit_flag := 'Y';
923: g_audit_header_scredit_id_tbl(i).reason_required then
924: --Apply Reason for audit
925: OE_Reasons_Util.Apply_Reason(
926: p_entity_code => 'HEADER_SCREDIT',
927: p_entity_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
928: p_header_id => oe_order_util.g_old_header_scredit_tbl(i).header_id,
929: p_version_number => l_version_number,
930: p_reason_type => 'CANCEL_CODE',
931: p_reason_code => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_reason,
924: --Apply Reason for audit
925: OE_Reasons_Util.Apply_Reason(
926: p_entity_code => 'HEADER_SCREDIT',
927: p_entity_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
928: p_header_id => oe_order_util.g_old_header_scredit_tbl(i).header_id,
929: p_version_number => l_version_number,
930: p_reason_type => 'CANCEL_CODE',
931: p_reason_code => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_reason,
932: p_reason_comments => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_comments,
927: p_entity_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
928: p_header_id => oe_order_util.g_old_header_scredit_tbl(i).header_id,
929: p_version_number => l_version_number,
930: p_reason_type => 'CANCEL_CODE',
931: p_reason_code => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_reason,
932: p_reason_comments => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_comments,
933: x_reason_id => l_reason_id,
934: x_return_status => l_return_status);
935:
928: p_header_id => oe_order_util.g_old_header_scredit_tbl(i).header_id,
929: p_version_number => l_version_number,
930: p_reason_type => 'CANCEL_CODE',
931: p_reason_code => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_reason,
932: p_reason_comments => OE_ORDER_UTIL.g_header_scredit_tbl(i).change_comments,
933: x_reason_id => l_reason_id,
934: x_return_status => l_return_status);
935:
936: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
947:
948: end if; --end apply reason
949:
950: IF l_debug_level > 0 THEN
951: oe_debug_pub.add('Calling recordHSCredithist operation: '|| oe_order_util.g_old_header_scredit_tbl(i).operation,1);
952: END IF;
953:
954: OE_CHG_ORDER_PVT.RecordHSCreditHist
955: (p_header_scredit_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
951: oe_debug_pub.add('Calling recordHSCredithist operation: '|| oe_order_util.g_old_header_scredit_tbl(i).operation,1);
952: END IF;
953:
954: OE_CHG_ORDER_PVT.RecordHSCreditHist
955: (p_header_scredit_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
956: p_header_scredit_rec => oe_order_util.g_old_header_scredit_tbl(i),
957: p_hist_type_code => l_hist_type_code,
958: p_reason_code => oe_globals.g_reason_code,
959: p_comments => oe_globals.g_reason_comments,
952: END IF;
953:
954: OE_CHG_ORDER_PVT.RecordHSCreditHist
955: (p_header_scredit_id => oe_order_util.g_old_header_scredit_tbl(i).sales_credit_id,
956: p_header_scredit_rec => oe_order_util.g_old_header_scredit_tbl(i),
957: p_hist_type_code => l_hist_type_code,
958: p_reason_code => oe_globals.g_reason_code,
959: p_comments => oe_globals.g_reason_comments,
960: p_audit_flag => l_audit_flag,
980: END IF;
981: END IF;
982:
983: END IF;
984: i := oe_order_util.g_old_header_scredit_tbl.NEXT(i); -- get subscript of next element
985: END LOOP;
986:
987: IF l_debug_level > 0 THEN
988: oe_debug_pub.add(' OEXUVERB: before recording line adjs ',1);
987: IF l_debug_level > 0 THEN
988: oe_debug_pub.add(' OEXUVERB: before recording line adjs ',1);
989: END IF;
990: --Update history for line adj
991: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
992: WHILE i IS NOT NULL LOOP
993: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_adj_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
994: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
995: g_audit_line_adj_id_tbl.exists(i)) THEN
989: END IF;
990: --Update history for line adj
991: i := oe_order_util.g_old_line_adj_tbl.FIRST; -- get subscript of first element
992: WHILE i IS NOT NULL LOOP
993: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_adj_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
994: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
995: g_audit_line_adj_id_tbl.exists(i)) THEN
996: IF g_audit_line_adj_id_tbl.exists(i) THEN
997: l_audit_flag := 'Y';
1005: g_audit_line_adj_id_tbl(i).reason_required then
1006: --Apply Reason for audit
1007: OE_Reasons_Util.Apply_Reason(
1008: p_entity_code => 'LINE_ADJ',
1009: p_entity_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1010: p_header_id => oe_order_util.g_old_line_adj_tbl(i).header_id,
1011: p_version_number => l_version_number,
1012: p_reason_type => 'CHANGE_CODE',
1013: p_reason_code => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_code,
1006: --Apply Reason for audit
1007: OE_Reasons_Util.Apply_Reason(
1008: p_entity_code => 'LINE_ADJ',
1009: p_entity_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1010: p_header_id => oe_order_util.g_old_line_adj_tbl(i).header_id,
1011: p_version_number => l_version_number,
1012: p_reason_type => 'CHANGE_CODE',
1013: p_reason_code => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_code,
1014: p_reason_comments => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_text,
1009: p_entity_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1010: p_header_id => oe_order_util.g_old_line_adj_tbl(i).header_id,
1011: p_version_number => l_version_number,
1012: p_reason_type => 'CHANGE_CODE',
1013: p_reason_code => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_code,
1014: p_reason_comments => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_text,
1015: x_reason_id => l_reason_id,
1016: x_return_status => l_return_status);
1017:
1010: p_header_id => oe_order_util.g_old_line_adj_tbl(i).header_id,
1011: p_version_number => l_version_number,
1012: p_reason_type => 'CHANGE_CODE',
1013: p_reason_code => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_code,
1014: p_reason_comments => OE_ORDER_UTIL.g_line_adj_tbl(i).change_reason_text,
1015: x_reason_id => l_reason_id,
1016: x_return_status => l_return_status);
1017:
1018: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1029:
1030: end if; --end apply reason
1031:
1032: IF l_debug_level > 0 THEN
1033: oe_debug_pub.add('Calling recordLPAdjhist operation: '|| oe_order_util.g_old_line_adj_tbl(i).operation,1);
1034: END IF;
1035:
1036: OE_CHG_ORDER_PVT.RecordLPAdjHist
1037: (p_line_adj_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1033: oe_debug_pub.add('Calling recordLPAdjhist operation: '|| oe_order_util.g_old_line_adj_tbl(i).operation,1);
1034: END IF;
1035:
1036: OE_CHG_ORDER_PVT.RecordLPAdjHist
1037: (p_line_adj_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1038: p_line_adj_rec => oe_order_util.g_old_line_adj_tbl(i),
1039: p_hist_type_code => l_hist_type_code,
1040: p_reason_code => oe_globals.g_reason_code,
1041: p_comments => oe_globals.g_reason_comments,
1034: END IF;
1035:
1036: OE_CHG_ORDER_PVT.RecordLPAdjHist
1037: (p_line_adj_id => oe_order_util.g_old_line_adj_tbl(i).price_adjustment_id,
1038: p_line_adj_rec => oe_order_util.g_old_line_adj_tbl(i),
1039: p_hist_type_code => l_hist_type_code,
1040: p_reason_code => oe_globals.g_reason_code,
1041: p_comments => oe_globals.g_reason_comments,
1042: p_audit_flag => l_audit_flag,
1063: END IF;
1064: END IF;
1065:
1066: END IF;
1067: i := oe_order_util.g_old_line_adj_tbl.NEXT(i); -- get subscript of next element
1068: END LOOP;
1069:
1070: IF l_debug_level > 0 THEN
1071: oe_debug_pub.add(' OEXUVERB: before recording line scredits ',1);
1070: IF l_debug_level > 0 THEN
1071: oe_debug_pub.add(' OEXUVERB: before recording line scredits ',1);
1072: END IF;
1073: --Update history for line scredit
1074: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
1075: WHILE i IS NOT NULL LOOP
1076: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_scredit_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
1077: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
1078: g_audit_line_scredit_id_tbl.exists(i)) THEN
1072: END IF;
1073: --Update history for line scredit
1074: i := oe_order_util.g_old_line_scredit_tbl.FIRST; -- get subscript of first element
1075: WHILE i IS NOT NULL LOOP
1076: IF NOT OE_GLOBALS.Equal(oe_order_util.g_old_line_scredit_tbl(i).operation, OE_GLOBALS.G_OPR_CREATE) AND
1077: (p_version_flag = 'Y' OR p_phase_change_flag = 'Y' or
1078: g_audit_line_scredit_id_tbl.exists(i)) THEN
1079: IF g_audit_line_scredit_id_tbl.exists(i) THEN
1080: l_audit_flag := 'Y';
1088: g_audit_line_scredit_id_tbl(i).reason_required then
1089: --Apply Reason for audit
1090: OE_Reasons_Util.Apply_Reason(
1091: p_entity_code => 'LINE_SCREDIT',
1092: p_entity_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1093: p_header_id => oe_order_util.g_old_line_scredit_tbl(i).header_id,
1094: p_version_number => l_version_number,
1095: p_reason_type => 'CANCEL_CODE',
1096: p_reason_code => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_reason,
1089: --Apply Reason for audit
1090: OE_Reasons_Util.Apply_Reason(
1091: p_entity_code => 'LINE_SCREDIT',
1092: p_entity_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1093: p_header_id => oe_order_util.g_old_line_scredit_tbl(i).header_id,
1094: p_version_number => l_version_number,
1095: p_reason_type => 'CANCEL_CODE',
1096: p_reason_code => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_reason,
1097: p_reason_comments => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_comments,
1092: p_entity_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1093: p_header_id => oe_order_util.g_old_line_scredit_tbl(i).header_id,
1094: p_version_number => l_version_number,
1095: p_reason_type => 'CANCEL_CODE',
1096: p_reason_code => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_reason,
1097: p_reason_comments => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_comments,
1098: x_reason_id => l_reason_id,
1099: x_return_status => l_return_status);
1100:
1093: p_header_id => oe_order_util.g_old_line_scredit_tbl(i).header_id,
1094: p_version_number => l_version_number,
1095: p_reason_type => 'CANCEL_CODE',
1096: p_reason_code => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_reason,
1097: p_reason_comments => OE_ORDER_UTIL.g_line_scredit_tbl(i).change_comments,
1098: x_reason_id => l_reason_id,
1099: x_return_status => l_return_status);
1100:
1101: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1112:
1113: end if; --end apply reason
1114:
1115: IF l_debug_level > 0 THEN
1116: oe_debug_pub.add('Calling recordLSCredithist operation: '|| oe_order_util.g_old_line_scredit_tbl(i).operation,1);
1117: END IF;
1118:
1119: OE_CHG_ORDER_PVT.RecordLSCreditHist
1120: (p_line_scredit_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1116: oe_debug_pub.add('Calling recordLSCredithist operation: '|| oe_order_util.g_old_line_scredit_tbl(i).operation,1);
1117: END IF;
1118:
1119: OE_CHG_ORDER_PVT.RecordLSCreditHist
1120: (p_line_scredit_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1121: p_line_scredit_rec => oe_order_util.g_old_line_scredit_tbl(i),
1122: p_hist_type_code => l_hist_type_code,
1123: p_reason_code => oe_globals.g_reason_code,
1124: p_comments => oe_globals.g_reason_comments,
1117: END IF;
1118:
1119: OE_CHG_ORDER_PVT.RecordLSCreditHist
1120: (p_line_scredit_id => oe_order_util.g_old_line_scredit_tbl(i).sales_credit_id,
1121: p_line_scredit_rec => oe_order_util.g_old_line_scredit_tbl(i),
1122: p_hist_type_code => l_hist_type_code,
1123: p_reason_code => oe_globals.g_reason_code,
1124: p_comments => oe_globals.g_reason_comments,
1125: p_audit_flag => l_audit_flag,
1145: END IF;
1146: END IF;
1147:
1148: END IF;
1149: i := oe_order_util.g_old_line_scredit_tbl.NEXT(i); -- get subscript of next element
1150: END LOOP;
1151:
1152: -- added for bug 4321689
1153: x_return_status := l_return_status;
1214: END IF;
1215:
1216: -- added for bug 3518059
1217: -- add g_header_created check to fix bug 3700341
1218: if OE_Order_Util.g_header_rec.operation = OE_GLOBALS.G_OPR_CREATE OR
1219: OE_GLOBALS.G_HEADER_CREATED OR
1220: OE_Blanket_Util.g_header_rec.operation = OE_GLOBALS.G_OPR_CREATE then
1221: IF l_debug_level > 0 THEN
1222: oe_debug_pub.add(' OEXUVERB: header is created, do nothing',1);
1289:
1290: G_UI_CALLED := TRUE;
1291:
1292: IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN
1293: IF OE_Order_Util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR THEN
1294: g_temp_reason_code := OE_Order_Util.g_header_rec.change_reason;
1295: g_temp_reason_comments := OE_Order_Util.g_header_rec.change_comments;
1296: RETURN TRUE;
1297: END IF;
1290: G_UI_CALLED := TRUE;
1291:
1292: IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN
1293: IF OE_Order_Util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR THEN
1294: g_temp_reason_code := OE_Order_Util.g_header_rec.change_reason;
1295: g_temp_reason_comments := OE_Order_Util.g_header_rec.change_comments;
1296: RETURN TRUE;
1297: END IF;
1298: ELSE
1291:
1292: IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN
1293: IF OE_Order_Util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR THEN
1294: g_temp_reason_code := OE_Order_Util.g_header_rec.change_reason;
1295: g_temp_reason_comments := OE_Order_Util.g_header_rec.change_comments;
1296: RETURN TRUE;
1297: END IF;
1298: ELSE
1299:
1296: RETURN TRUE;
1297: END IF;
1298: ELSE
1299:
1300: OE_Order_Util.Return_Glb_Ent_Index(
1301: p_entity_code,
1302: p_entity_id,
1303: l_ind,
1304: l_result,
1305: l_return_stat);
1306:
1307: IF l_result = FND_API.G_TRUE THEN
1308: IF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN
1309: IF OE_Order_Util.g_line_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1310: g_temp_reason_code := OE_Order_Util.g_line_tbl(l_ind).change_reason;
1311: g_temp_reason_comments := OE_Order_Util.g_line_tbl(l_ind).change_comments;
1312: RETURN TRUE;
1313: END IF;
1306:
1307: IF l_result = FND_API.G_TRUE THEN
1308: IF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN
1309: IF OE_Order_Util.g_line_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1310: g_temp_reason_code := OE_Order_Util.g_line_tbl(l_ind).change_reason;
1311: g_temp_reason_comments := OE_Order_Util.g_line_tbl(l_ind).change_comments;
1312: RETURN TRUE;
1313: END IF;
1314: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
1307: IF l_result = FND_API.G_TRUE THEN
1308: IF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN
1309: IF OE_Order_Util.g_line_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1310: g_temp_reason_code := OE_Order_Util.g_line_tbl(l_ind).change_reason;
1311: g_temp_reason_comments := OE_Order_Util.g_line_tbl(l_ind).change_comments;
1312: RETURN TRUE;
1313: END IF;
1314: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
1315: IF OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1311: g_temp_reason_comments := OE_Order_Util.g_line_tbl(l_ind).change_comments;
1312: RETURN TRUE;
1313: END IF;
1314: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
1315: IF OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1316: g_temp_reason_code := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code;
1317: g_temp_reason_comments := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_text;
1318: RETURN TRUE;
1319: END IF;
1312: RETURN TRUE;
1313: END IF;
1314: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
1315: IF OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1316: g_temp_reason_code := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code;
1317: g_temp_reason_comments := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_text;
1318: RETURN TRUE;
1319: END IF;
1320: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_SCREDIT THEN
1313: END IF;
1314: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
1315: IF OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1316: g_temp_reason_code := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_code;
1317: g_temp_reason_comments := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_text;
1318: RETURN TRUE;
1319: END IF;
1320: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_SCREDIT THEN
1321: IF OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1317: g_temp_reason_comments := OE_Order_Util.g_header_adj_tbl(l_ind).change_reason_text;
1318: RETURN TRUE;
1319: END IF;
1320: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_SCREDIT THEN
1321: IF OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1322: g_temp_reason_code := OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason;
1323: g_temp_reason_comments := OE_Order_Util.g_header_scredit_tbl(l_ind).change_comments;
1324: RETURN TRUE;
1325: END IF;
1318: RETURN TRUE;
1319: END IF;
1320: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_SCREDIT THEN
1321: IF OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1322: g_temp_reason_code := OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason;
1323: g_temp_reason_comments := OE_Order_Util.g_header_scredit_tbl(l_ind).change_comments;
1324: RETURN TRUE;
1325: END IF;
1326: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
1319: END IF;
1320: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_SCREDIT THEN
1321: IF OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1322: g_temp_reason_code := OE_Order_Util.g_header_scredit_tbl(l_ind).change_reason;
1323: g_temp_reason_comments := OE_Order_Util.g_header_scredit_tbl(l_ind).change_comments;
1324: RETURN TRUE;
1325: END IF;
1326: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
1327: IF OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1323: g_temp_reason_comments := OE_Order_Util.g_header_scredit_tbl(l_ind).change_comments;
1324: RETURN TRUE;
1325: END IF;
1326: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
1327: IF OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1328: g_temp_reason_code := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code;
1329: g_temp_reason_comments := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_text;
1330: RETURN TRUE;
1331: END IF;
1324: RETURN TRUE;
1325: END IF;
1326: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
1327: IF OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1328: g_temp_reason_code := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code;
1329: g_temp_reason_comments := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_text;
1330: RETURN TRUE;
1331: END IF;
1332: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_SCREDIT THEN
1325: END IF;
1326: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
1327: IF OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code <> FND_API.G_MISS_CHAR THEN
1328: g_temp_reason_code := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_code;
1329: g_temp_reason_comments := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_text;
1330: RETURN TRUE;
1331: END IF;
1332: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_SCREDIT THEN
1333: IF OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1329: g_temp_reason_comments := OE_Order_Util.g_line_adj_tbl(l_ind).change_reason_text;
1330: RETURN TRUE;
1331: END IF;
1332: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_SCREDIT THEN
1333: IF OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1334: g_temp_reason_code := OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason;
1335: g_temp_reason_comments := OE_Order_Util.g_line_scredit_tbl(l_ind).change_comments;
1336: RETURN TRUE;
1337: END IF;
1330: RETURN TRUE;
1331: END IF;
1332: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_SCREDIT THEN
1333: IF OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1334: g_temp_reason_code := OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason;
1335: g_temp_reason_comments := OE_Order_Util.g_line_scredit_tbl(l_ind).change_comments;
1336: RETURN TRUE;
1337: END IF;
1338: END IF;
1331: END IF;
1332: ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_SCREDIT THEN
1333: IF OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason <> FND_API.G_MISS_CHAR THEN
1334: g_temp_reason_code := OE_Order_Util.g_line_scredit_tbl(l_ind).change_reason;
1335: g_temp_reason_comments := OE_Order_Util.g_line_scredit_tbl(l_ind).change_comments;
1336: RETURN TRUE;
1337: END IF;
1338: END IF;
1339: END IF;
1370: oe_debug_pub.add('hist type :'||p_hist_type_code);
1371: end if;
1372:
1373: IF p_entity_code <> OE_GLOBALS.G_ENTITY_HEADER THEN
1374: OE_Order_Util.Return_Glb_Ent_Index(
1375: p_entity_code,
1376: p_entity_id,
1377: l_ind,
1378: l_result,
1461: x_reason_code := OE_GLOBALS.G_REASON_CODE;
1462: x_reason_comments := OE_GLOBALS.G_REASON_COMMENTS;
1463: end if;
1464:
1465: if oe_order_util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR then
1466: x_reason_code := oe_order_util.g_header_rec.change_reason;
1467: x_reason_comments := oe_order_util.g_header_rec.change_comments;
1468: RETURN;
1469: else
1462: x_reason_comments := OE_GLOBALS.G_REASON_COMMENTS;
1463: end if;
1464:
1465: if oe_order_util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR then
1466: x_reason_code := oe_order_util.g_header_rec.change_reason;
1467: x_reason_comments := oe_order_util.g_header_rec.change_comments;
1468: RETURN;
1469: else
1470:
1463: end if;
1464:
1465: if oe_order_util.g_header_rec.change_reason <> FND_API.G_MISS_CHAR then
1466: x_reason_code := oe_order_util.g_header_rec.change_reason;
1467: x_reason_comments := oe_order_util.g_header_rec.change_comments;
1468: RETURN;
1469: else
1470:
1471: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
1467: x_reason_comments := oe_order_util.g_header_rec.change_comments;
1468: RETURN;
1469: else
1470:
1471: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
1472: WHILE i IS NOT NULL LOOP
1473: if oe_order_util.g_header_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1474: x_reason_code := oe_order_util.g_header_adj_tbl(i).change_reason_code;
1475: x_reason_comments := oe_order_util.g_header_adj_tbl(i).change_reason_text;
1469: else
1470:
1471: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
1472: WHILE i IS NOT NULL LOOP
1473: if oe_order_util.g_header_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1474: x_reason_code := oe_order_util.g_header_adj_tbl(i).change_reason_code;
1475: x_reason_comments := oe_order_util.g_header_adj_tbl(i).change_reason_text;
1476: RETURN;
1477: end if;
1470:
1471: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
1472: WHILE i IS NOT NULL LOOP
1473: if oe_order_util.g_header_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1474: x_reason_code := oe_order_util.g_header_adj_tbl(i).change_reason_code;
1475: x_reason_comments := oe_order_util.g_header_adj_tbl(i).change_reason_text;
1476: RETURN;
1477: end if;
1478: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
1471: i := oe_order_util.g_header_adj_tbl.FIRST; -- get subscript of first element
1472: WHILE i IS NOT NULL LOOP
1473: if oe_order_util.g_header_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1474: x_reason_code := oe_order_util.g_header_adj_tbl(i).change_reason_code;
1475: x_reason_comments := oe_order_util.g_header_adj_tbl(i).change_reason_text;
1476: RETURN;
1477: end if;
1478: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
1479: END LOOP;
1474: x_reason_code := oe_order_util.g_header_adj_tbl(i).change_reason_code;
1475: x_reason_comments := oe_order_util.g_header_adj_tbl(i).change_reason_text;
1476: RETURN;
1477: end if;
1478: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
1479: END LOOP;
1480:
1481: i := oe_order_util.g_header_scredit_tbl.FIRST;
1482: WHILE i IS NOT NULL LOOP
1477: end if;
1478: i := oe_order_util.g_header_adj_tbl.NEXT(i); -- get subscript of next element
1479: END LOOP;
1480:
1481: i := oe_order_util.g_header_scredit_tbl.FIRST;
1482: WHILE i IS NOT NULL LOOP
1483: if oe_order_util.g_header_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1484: x_reason_code := oe_order_util.g_header_scredit_tbl(i).change_reason;
1485: x_reason_comments := oe_order_util.g_header_scredit_tbl(i).change_comments;
1479: END LOOP;
1480:
1481: i := oe_order_util.g_header_scredit_tbl.FIRST;
1482: WHILE i IS NOT NULL LOOP
1483: if oe_order_util.g_header_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1484: x_reason_code := oe_order_util.g_header_scredit_tbl(i).change_reason;
1485: x_reason_comments := oe_order_util.g_header_scredit_tbl(i).change_comments;
1486: RETURN;
1487: end if;
1480:
1481: i := oe_order_util.g_header_scredit_tbl.FIRST;
1482: WHILE i IS NOT NULL LOOP
1483: if oe_order_util.g_header_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1484: x_reason_code := oe_order_util.g_header_scredit_tbl(i).change_reason;
1485: x_reason_comments := oe_order_util.g_header_scredit_tbl(i).change_comments;
1486: RETURN;
1487: end if;
1488: i := oe_order_util.g_header_scredit_tbl.NEXT(i);
1481: i := oe_order_util.g_header_scredit_tbl.FIRST;
1482: WHILE i IS NOT NULL LOOP
1483: if oe_order_util.g_header_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1484: x_reason_code := oe_order_util.g_header_scredit_tbl(i).change_reason;
1485: x_reason_comments := oe_order_util.g_header_scredit_tbl(i).change_comments;
1486: RETURN;
1487: end if;
1488: i := oe_order_util.g_header_scredit_tbl.NEXT(i);
1489: END LOOP;
1484: x_reason_code := oe_order_util.g_header_scredit_tbl(i).change_reason;
1485: x_reason_comments := oe_order_util.g_header_scredit_tbl(i).change_comments;
1486: RETURN;
1487: end if;
1488: i := oe_order_util.g_header_scredit_tbl.NEXT(i);
1489: END LOOP;
1490:
1491: i := oe_order_util.g_line_tbl.FIRST;
1492: WHILE i IS NOT NULL LOOP
1487: end if;
1488: i := oe_order_util.g_header_scredit_tbl.NEXT(i);
1489: END LOOP;
1490:
1491: i := oe_order_util.g_line_tbl.FIRST;
1492: WHILE i IS NOT NULL LOOP
1493: if oe_order_util.g_line_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1494: x_reason_code := oe_order_util.g_line_tbl(i).change_reason;
1495: x_reason_comments := oe_order_util.g_line_tbl(i).change_comments;
1489: END LOOP;
1490:
1491: i := oe_order_util.g_line_tbl.FIRST;
1492: WHILE i IS NOT NULL LOOP
1493: if oe_order_util.g_line_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1494: x_reason_code := oe_order_util.g_line_tbl(i).change_reason;
1495: x_reason_comments := oe_order_util.g_line_tbl(i).change_comments;
1496: RETURN;
1497: end if;
1490:
1491: i := oe_order_util.g_line_tbl.FIRST;
1492: WHILE i IS NOT NULL LOOP
1493: if oe_order_util.g_line_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1494: x_reason_code := oe_order_util.g_line_tbl(i).change_reason;
1495: x_reason_comments := oe_order_util.g_line_tbl(i).change_comments;
1496: RETURN;
1497: end if;
1498: i := oe_order_util.g_line_tbl.NEXT(i);
1491: i := oe_order_util.g_line_tbl.FIRST;
1492: WHILE i IS NOT NULL LOOP
1493: if oe_order_util.g_line_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1494: x_reason_code := oe_order_util.g_line_tbl(i).change_reason;
1495: x_reason_comments := oe_order_util.g_line_tbl(i).change_comments;
1496: RETURN;
1497: end if;
1498: i := oe_order_util.g_line_tbl.NEXT(i);
1499: END LOOP;
1494: x_reason_code := oe_order_util.g_line_tbl(i).change_reason;
1495: x_reason_comments := oe_order_util.g_line_tbl(i).change_comments;
1496: RETURN;
1497: end if;
1498: i := oe_order_util.g_line_tbl.NEXT(i);
1499: END LOOP;
1500:
1501: i := oe_order_util.g_line_adj_tbl.FIRST;
1502: WHILE i IS NOT NULL LOOP
1497: end if;
1498: i := oe_order_util.g_line_tbl.NEXT(i);
1499: END LOOP;
1500:
1501: i := oe_order_util.g_line_adj_tbl.FIRST;
1502: WHILE i IS NOT NULL LOOP
1503: if oe_order_util.g_line_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1504: x_reason_code := oe_order_util.g_line_adj_tbl(i).change_reason_code;
1505: x_reason_comments := oe_order_util.g_line_adj_tbl(i).change_reason_text;
1499: END LOOP;
1500:
1501: i := oe_order_util.g_line_adj_tbl.FIRST;
1502: WHILE i IS NOT NULL LOOP
1503: if oe_order_util.g_line_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1504: x_reason_code := oe_order_util.g_line_adj_tbl(i).change_reason_code;
1505: x_reason_comments := oe_order_util.g_line_adj_tbl(i).change_reason_text;
1506: RETURN;
1507: end if;
1500:
1501: i := oe_order_util.g_line_adj_tbl.FIRST;
1502: WHILE i IS NOT NULL LOOP
1503: if oe_order_util.g_line_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1504: x_reason_code := oe_order_util.g_line_adj_tbl(i).change_reason_code;
1505: x_reason_comments := oe_order_util.g_line_adj_tbl(i).change_reason_text;
1506: RETURN;
1507: end if;
1508: i := oe_order_util.g_line_adj_tbl.NEXT(i);
1501: i := oe_order_util.g_line_adj_tbl.FIRST;
1502: WHILE i IS NOT NULL LOOP
1503: if oe_order_util.g_line_adj_tbl(i).change_reason_code <> FND_API.G_MISS_CHAR then
1504: x_reason_code := oe_order_util.g_line_adj_tbl(i).change_reason_code;
1505: x_reason_comments := oe_order_util.g_line_adj_tbl(i).change_reason_text;
1506: RETURN;
1507: end if;
1508: i := oe_order_util.g_line_adj_tbl.NEXT(i);
1509: END LOOP;
1504: x_reason_code := oe_order_util.g_line_adj_tbl(i).change_reason_code;
1505: x_reason_comments := oe_order_util.g_line_adj_tbl(i).change_reason_text;
1506: RETURN;
1507: end if;
1508: i := oe_order_util.g_line_adj_tbl.NEXT(i);
1509: END LOOP;
1510:
1511: i := oe_order_util.g_line_scredit_tbl.FIRST;
1512: WHILE i IS NOT NULL LOOP
1507: end if;
1508: i := oe_order_util.g_line_adj_tbl.NEXT(i);
1509: END LOOP;
1510:
1511: i := oe_order_util.g_line_scredit_tbl.FIRST;
1512: WHILE i IS NOT NULL LOOP
1513: if oe_order_util.g_line_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1514: x_reason_code := oe_order_util.g_line_scredit_tbl(i).change_reason;
1515: x_reason_comments := oe_order_util.g_line_scredit_tbl(i).change_comments;
1509: END LOOP;
1510:
1511: i := oe_order_util.g_line_scredit_tbl.FIRST;
1512: WHILE i IS NOT NULL LOOP
1513: if oe_order_util.g_line_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1514: x_reason_code := oe_order_util.g_line_scredit_tbl(i).change_reason;
1515: x_reason_comments := oe_order_util.g_line_scredit_tbl(i).change_comments;
1516: RETURN;
1517: end if;
1510:
1511: i := oe_order_util.g_line_scredit_tbl.FIRST;
1512: WHILE i IS NOT NULL LOOP
1513: if oe_order_util.g_line_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1514: x_reason_code := oe_order_util.g_line_scredit_tbl(i).change_reason;
1515: x_reason_comments := oe_order_util.g_line_scredit_tbl(i).change_comments;
1516: RETURN;
1517: end if;
1518: i := oe_order_util.g_line_scredit_tbl.NEXT(i);
1511: i := oe_order_util.g_line_scredit_tbl.FIRST;
1512: WHILE i IS NOT NULL LOOP
1513: if oe_order_util.g_line_scredit_tbl(i).change_reason <> FND_API.G_MISS_CHAR then
1514: x_reason_code := oe_order_util.g_line_scredit_tbl(i).change_reason;
1515: x_reason_comments := oe_order_util.g_line_scredit_tbl(i).change_comments;
1516: RETURN;
1517: end if;
1518: i := oe_order_util.g_line_scredit_tbl.NEXT(i);
1519: END LOOP;
1514: x_reason_code := oe_order_util.g_line_scredit_tbl(i).change_reason;
1515: x_reason_comments := oe_order_util.g_line_scredit_tbl(i).change_comments;
1516: RETURN;
1517: end if;
1518: i := oe_order_util.g_line_scredit_tbl.NEXT(i);
1519: END LOOP;
1520:
1521: end if;
1522: