1: PACKAGE BODY PO_PDOI_MOVE_TO_DRAFT_TABS_PVT AS
2: /* $Header: PO_PDOI_MOVE_TO_DRAFT_TABS_PVT.plb 120.35.12010000.2 2008/08/04 08:40:01 rramasam ship $ */
3:
4: d_pkg_name CONSTANT VARCHAR2(50) :=
5: PO_LOG.get_package_base('PO_PDOI_MOVE_TO_DRAFT_TABS_PVT');
6:
7: --------------------------------------------------------------------------
8: ---------------------- PRIVATE PROCEDURES PROTOTYPE ----------------------
9: --------------------------------------------------------------------------
91:
92: BEGIN
93: d_position := 0;
94:
95: IF (PO_LOG.d_proc) THEN
96: PO_LOG.proc_begin(d_module);
97: END IF;
98:
99: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_HEADER_INSERT);
92: BEGIN
93: d_position := 0;
94:
95: IF (PO_LOG.d_proc) THEN
96: PO_LOG.proc_begin(d_module);
97: END IF;
98:
99: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_HEADER_INSERT);
100:
122: );
123:
124: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_HEADER_INSERT);
125:
126: IF (PO_LOG.d_proc) THEN
127: PO_LOG.proc_end (d_module);
128: END IF;
129:
130: EXCEPTION
123:
124: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_HEADER_INSERT);
125:
126: IF (PO_LOG.d_proc) THEN
127: PO_LOG.proc_end (d_module);
128: END IF;
129:
130: EXCEPTION
131: WHEN OTHERS THEN
164:
165: BEGIN
166: d_position := 0;
167:
168: IF (PO_LOG.d_proc) THEN
169: PO_LOG.proc_begin(d_module);
170: END IF;
171:
172: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_LINE_INSERT);
165: BEGIN
166: d_position := 0;
167:
168: IF (PO_LOG.d_proc) THEN
169: PO_LOG.proc_begin(d_module);
170: END IF;
171:
172: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_LINE_INSERT);
173:
192: PO_PDOI_CONSTANTS.g_PROCESS_CODE_NOTIFIED)
193: ) THEN
194: d_position := 20;
195:
196: IF (PO_LOG.d_stmt) THEN
197: PO_LOG.stmt(d_module, d_position, 'set lines to be notified');
198: END IF;
199:
200: -- update interface table with new status set to NOTIFIED
193: ) THEN
194: d_position := 20;
195:
196: IF (PO_LOG.d_stmt) THEN
197: PO_LOG.stmt(d_module, d_position, 'set lines to be notified');
198: END IF;
199:
200: -- update interface table with new status set to NOTIFIED
201: -- bug 6743283 added a condition to check the action, so that only for update
229: -- Insert all lines to draft lines regardless of whether the lines are in
230: -- status 'NOTIFIED' or not... those lines will be removed from the draft
231: -- table during post processing.
232:
233: IF (PO_LOG.d_stmt) THEN
234: PO_LOG.stmt(d_module, d_position, 'insert lines into draft table');
235: END IF;
236:
237: -- insert lines into po_lines_draft_all
230: -- status 'NOTIFIED' or not... those lines will be removed from the draft
231: -- table during post processing.
232:
233: IF (PO_LOG.d_stmt) THEN
234: PO_LOG.stmt(d_module, d_position, 'insert lines into draft table');
235: END IF;
236:
237: -- insert lines into po_lines_draft_all
238: insert_po_lines_draft_all
241: );
242:
243: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_LINE_INSERT);
244:
245: IF (PO_LOG.d_proc) THEN
246: PO_LOG.proc_end (d_module);
247: END IF;
248:
249: EXCEPTION
242:
243: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_LINE_INSERT);
244:
245: IF (PO_LOG.d_proc) THEN
246: PO_LOG.proc_end (d_module);
247: END IF;
248:
249: EXCEPTION
250: WHEN OTHERS THEN
365: l_message_list Error_Handler.Error_Tbl_Type;
366: BEGIN
367: d_position := 0;
368:
369: IF (PO_LOG.d_proc) THEN
370: PO_LOG.proc_begin(d_module);
371: END IF;
372:
373: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_LINE_UPDATE);
366: BEGIN
367: d_position := 0;
368:
369: IF (PO_LOG.d_proc) THEN
370: PO_LOG.proc_begin(d_module);
371: END IF;
372:
373: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_LINE_UPDATE);
374:
395: l_num_tbl(i) := i;
396: END IF;
397: END LOOP;
398:
399: IF (PO_LOG.d_stmt) THEN
400: PO_LOG.stmt(d_module, d_position, 'count of to-be-processed lines',
401: l_num_tbl.COUNT);
402: END IF;
403:
396: END IF;
397: END LOOP;
398:
399: IF (PO_LOG.d_stmt) THEN
400: PO_LOG.stmt(d_module, d_position, 'count of to-be-processed lines',
401: l_num_tbl.COUNT);
402: END IF;
403:
404: IF (l_num_tbl.COUNT = 0) THEN
403:
404: IF (l_num_tbl.COUNT = 0) THEN
405: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_LINE_UPDATE);
406:
407: IF (PO_LOG.d_proc) THEN
408: PO_LOG.proc_end (d_module);
409: END IF;
410:
411: RETURN;
404: IF (l_num_tbl.COUNT = 0) THEN
405: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_LINE_UPDATE);
406:
407: IF (PO_LOG.d_proc) THEN
408: PO_LOG.proc_end (d_module);
409: END IF;
410:
411: RETURN;
412: END IF;
410:
411: RETURN;
412: END IF;
413:
414: IF (PO_LOG.d_stmt) THEN
415: PO_LOG.stmt(d_module, d_position, 'po line ids', l_po_line_id_tbl);
416: PO_LOG.stmt(d_module, d_position, 'draft ids', l_draft_id_tbl);
417: END IF;
418:
411: RETURN;
412: END IF;
413:
414: IF (PO_LOG.d_stmt) THEN
415: PO_LOG.stmt(d_module, d_position, 'po line ids', l_po_line_id_tbl);
416: PO_LOG.stmt(d_module, d_position, 'draft ids', l_draft_id_tbl);
417: END IF;
418:
419: d_position := 10;
412: END IF;
413:
414: IF (PO_LOG.d_stmt) THEN
415: PO_LOG.stmt(d_module, d_position, 'po line ids', l_po_line_id_tbl);
416: PO_LOG.stmt(d_module, d_position, 'draft ids', l_draft_id_tbl);
417: END IF;
418:
419: d_position := 10;
420:
501: l_ip_category_id_tbl,
502: l_orig_intf_line_id_tbl, -- bug5149827
503: l_allow_desc_update_tbl;
504:
505: IF (PO_LOG.d_stmt) THEN
506: PO_LOG.stmt(d_module, d_position, 'orig po line ids', l_po_line_id_tbl);
507: PO_LOG.stmt(d_module, d_position, 'orig uom', l_unit_of_measure_tbl);
508: PO_LOG.stmt(d_module, d_position, 'orig unit price', l_unit_price_tbl);
509: PO_LOG.stmt(d_module, d_position, 'orig item desc', l_item_desc_tbl);
502: l_orig_intf_line_id_tbl, -- bug5149827
503: l_allow_desc_update_tbl;
504:
505: IF (PO_LOG.d_stmt) THEN
506: PO_LOG.stmt(d_module, d_position, 'orig po line ids', l_po_line_id_tbl);
507: PO_LOG.stmt(d_module, d_position, 'orig uom', l_unit_of_measure_tbl);
508: PO_LOG.stmt(d_module, d_position, 'orig unit price', l_unit_price_tbl);
509: PO_LOG.stmt(d_module, d_position, 'orig item desc', l_item_desc_tbl);
510: PO_LOG.stmt(d_module, d_position, 'orig expiration date',
503: l_allow_desc_update_tbl;
504:
505: IF (PO_LOG.d_stmt) THEN
506: PO_LOG.stmt(d_module, d_position, 'orig po line ids', l_po_line_id_tbl);
507: PO_LOG.stmt(d_module, d_position, 'orig uom', l_unit_of_measure_tbl);
508: PO_LOG.stmt(d_module, d_position, 'orig unit price', l_unit_price_tbl);
509: PO_LOG.stmt(d_module, d_position, 'orig item desc', l_item_desc_tbl);
510: PO_LOG.stmt(d_module, d_position, 'orig expiration date',
511: l_expiration_date_tbl);
504:
505: IF (PO_LOG.d_stmt) THEN
506: PO_LOG.stmt(d_module, d_position, 'orig po line ids', l_po_line_id_tbl);
507: PO_LOG.stmt(d_module, d_position, 'orig uom', l_unit_of_measure_tbl);
508: PO_LOG.stmt(d_module, d_position, 'orig unit price', l_unit_price_tbl);
509: PO_LOG.stmt(d_module, d_position, 'orig item desc', l_item_desc_tbl);
510: PO_LOG.stmt(d_module, d_position, 'orig expiration date',
511: l_expiration_date_tbl);
512: PO_LOG.stmt(d_module, d_position, 'orig retroactive date',
505: IF (PO_LOG.d_stmt) THEN
506: PO_LOG.stmt(d_module, d_position, 'orig po line ids', l_po_line_id_tbl);
507: PO_LOG.stmt(d_module, d_position, 'orig uom', l_unit_of_measure_tbl);
508: PO_LOG.stmt(d_module, d_position, 'orig unit price', l_unit_price_tbl);
509: PO_LOG.stmt(d_module, d_position, 'orig item desc', l_item_desc_tbl);
510: PO_LOG.stmt(d_module, d_position, 'orig expiration date',
511: l_expiration_date_tbl);
512: PO_LOG.stmt(d_module, d_position, 'orig retroactive date',
513: l_retroactive_date_tbl);
506: PO_LOG.stmt(d_module, d_position, 'orig po line ids', l_po_line_id_tbl);
507: PO_LOG.stmt(d_module, d_position, 'orig uom', l_unit_of_measure_tbl);
508: PO_LOG.stmt(d_module, d_position, 'orig unit price', l_unit_price_tbl);
509: PO_LOG.stmt(d_module, d_position, 'orig item desc', l_item_desc_tbl);
510: PO_LOG.stmt(d_module, d_position, 'orig expiration date',
511: l_expiration_date_tbl);
512: PO_LOG.stmt(d_module, d_position, 'orig retroactive date',
513: l_retroactive_date_tbl);
514: PO_LOG.stmt(d_module, d_position, 'orig price break lookup code',
508: PO_LOG.stmt(d_module, d_position, 'orig unit price', l_unit_price_tbl);
509: PO_LOG.stmt(d_module, d_position, 'orig item desc', l_item_desc_tbl);
510: PO_LOG.stmt(d_module, d_position, 'orig expiration date',
511: l_expiration_date_tbl);
512: PO_LOG.stmt(d_module, d_position, 'orig retroactive date',
513: l_retroactive_date_tbl);
514: PO_LOG.stmt(d_module, d_position, 'orig price break lookup code',
515: l_price_break_lookup_code_tbl);
516: PO_LOG.stmt(d_module, d_position, 'orig base unit price',
510: PO_LOG.stmt(d_module, d_position, 'orig expiration date',
511: l_expiration_date_tbl);
512: PO_LOG.stmt(d_module, d_position, 'orig retroactive date',
513: l_retroactive_date_tbl);
514: PO_LOG.stmt(d_module, d_position, 'orig price break lookup code',
515: l_price_break_lookup_code_tbl);
516: PO_LOG.stmt(d_module, d_position, 'orig base unit price',
517: l_base_unit_price_tbl);
518: PO_LOG.stmt(d_module, d_position, 'orig attribute_14', l_attribute14_tbl);
512: PO_LOG.stmt(d_module, d_position, 'orig retroactive date',
513: l_retroactive_date_tbl);
514: PO_LOG.stmt(d_module, d_position, 'orig price break lookup code',
515: l_price_break_lookup_code_tbl);
516: PO_LOG.stmt(d_module, d_position, 'orig base unit price',
517: l_base_unit_price_tbl);
518: PO_LOG.stmt(d_module, d_position, 'orig attribute_14', l_attribute14_tbl);
519: PO_LOG.stmt(d_module, d_position, 'orig amount', l_amount_tbl);
520: PO_LOG.stmt(d_module, d_position, 'orig price limit', l_price_limit_tbl);
514: PO_LOG.stmt(d_module, d_position, 'orig price break lookup code',
515: l_price_break_lookup_code_tbl);
516: PO_LOG.stmt(d_module, d_position, 'orig base unit price',
517: l_base_unit_price_tbl);
518: PO_LOG.stmt(d_module, d_position, 'orig attribute_14', l_attribute14_tbl);
519: PO_LOG.stmt(d_module, d_position, 'orig amount', l_amount_tbl);
520: PO_LOG.stmt(d_module, d_position, 'orig price limit', l_price_limit_tbl);
521: PO_LOG.stmt(d_module, d_position, 'orig negotiated flag', l_negotiated_flag_tbl);
522: PO_LOG.stmt(d_module, d_position, 'orig category_id', l_category_id_tbl);
515: l_price_break_lookup_code_tbl);
516: PO_LOG.stmt(d_module, d_position, 'orig base unit price',
517: l_base_unit_price_tbl);
518: PO_LOG.stmt(d_module, d_position, 'orig attribute_14', l_attribute14_tbl);
519: PO_LOG.stmt(d_module, d_position, 'orig amount', l_amount_tbl);
520: PO_LOG.stmt(d_module, d_position, 'orig price limit', l_price_limit_tbl);
521: PO_LOG.stmt(d_module, d_position, 'orig negotiated flag', l_negotiated_flag_tbl);
522: PO_LOG.stmt(d_module, d_position, 'orig category_id', l_category_id_tbl);
523: PO_LOG.stmt(d_module, d_position, 'orig ip category id', l_ip_category_id_tbl);
516: PO_LOG.stmt(d_module, d_position, 'orig base unit price',
517: l_base_unit_price_tbl);
518: PO_LOG.stmt(d_module, d_position, 'orig attribute_14', l_attribute14_tbl);
519: PO_LOG.stmt(d_module, d_position, 'orig amount', l_amount_tbl);
520: PO_LOG.stmt(d_module, d_position, 'orig price limit', l_price_limit_tbl);
521: PO_LOG.stmt(d_module, d_position, 'orig negotiated flag', l_negotiated_flag_tbl);
522: PO_LOG.stmt(d_module, d_position, 'orig category_id', l_category_id_tbl);
523: PO_LOG.stmt(d_module, d_position, 'orig ip category id', l_ip_category_id_tbl);
524: PO_LOG.stmt(d_module, d_position, 'allow desc update', l_allow_desc_update_tbl);
517: l_base_unit_price_tbl);
518: PO_LOG.stmt(d_module, d_position, 'orig attribute_14', l_attribute14_tbl);
519: PO_LOG.stmt(d_module, d_position, 'orig amount', l_amount_tbl);
520: PO_LOG.stmt(d_module, d_position, 'orig price limit', l_price_limit_tbl);
521: PO_LOG.stmt(d_module, d_position, 'orig negotiated flag', l_negotiated_flag_tbl);
522: PO_LOG.stmt(d_module, d_position, 'orig category_id', l_category_id_tbl);
523: PO_LOG.stmt(d_module, d_position, 'orig ip category id', l_ip_category_id_tbl);
524: PO_LOG.stmt(d_module, d_position, 'allow desc update', l_allow_desc_update_tbl);
525: END IF;
518: PO_LOG.stmt(d_module, d_position, 'orig attribute_14', l_attribute14_tbl);
519: PO_LOG.stmt(d_module, d_position, 'orig amount', l_amount_tbl);
520: PO_LOG.stmt(d_module, d_position, 'orig price limit', l_price_limit_tbl);
521: PO_LOG.stmt(d_module, d_position, 'orig negotiated flag', l_negotiated_flag_tbl);
522: PO_LOG.stmt(d_module, d_position, 'orig category_id', l_category_id_tbl);
523: PO_LOG.stmt(d_module, d_position, 'orig ip category id', l_ip_category_id_tbl);
524: PO_LOG.stmt(d_module, d_position, 'allow desc update', l_allow_desc_update_tbl);
525: END IF;
526:
519: PO_LOG.stmt(d_module, d_position, 'orig amount', l_amount_tbl);
520: PO_LOG.stmt(d_module, d_position, 'orig price limit', l_price_limit_tbl);
521: PO_LOG.stmt(d_module, d_position, 'orig negotiated flag', l_negotiated_flag_tbl);
522: PO_LOG.stmt(d_module, d_position, 'orig category_id', l_category_id_tbl);
523: PO_LOG.stmt(d_module, d_position, 'orig ip category id', l_ip_category_id_tbl);
524: PO_LOG.stmt(d_module, d_position, 'allow desc update', l_allow_desc_update_tbl);
525: END IF;
526:
527: -- set up hashtable to refer to existing values
520: PO_LOG.stmt(d_module, d_position, 'orig price limit', l_price_limit_tbl);
521: PO_LOG.stmt(d_module, d_position, 'orig negotiated flag', l_negotiated_flag_tbl);
522: PO_LOG.stmt(d_module, d_position, 'orig category_id', l_category_id_tbl);
523: PO_LOG.stmt(d_module, d_position, 'orig ip category id', l_ip_category_id_tbl);
524: PO_LOG.stmt(d_module, d_position, 'allow desc update', l_allow_desc_update_tbl);
525: END IF;
526:
527: -- set up hashtable to refer to existing values
528: l_line_ref_tbl.DELETE;
541: -- rejected.
542: IF (x_lines.error_flag_tbl(i) = FND_API.g_FALSE AND
543: x_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE) THEN
544:
545: IF (PO_LOG.d_stmt) THEN
546: PO_LOG.stmt(d_module, d_position, 'po_line_id', x_lines.po_line_id_tbl(i));
547: PO_LOG.stmt(d_module, d_position, 'reference',
548: l_line_ref_tbl(x_lines.po_line_id_tbl(i)));
549: PO_LOG.stmt(d_module, d_position, 'orig category_id', x_lines.category_id_tbl(i));
542: IF (x_lines.error_flag_tbl(i) = FND_API.g_FALSE AND
543: x_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE) THEN
544:
545: IF (PO_LOG.d_stmt) THEN
546: PO_LOG.stmt(d_module, d_position, 'po_line_id', x_lines.po_line_id_tbl(i));
547: PO_LOG.stmt(d_module, d_position, 'reference',
548: l_line_ref_tbl(x_lines.po_line_id_tbl(i)));
549: PO_LOG.stmt(d_module, d_position, 'orig category_id', x_lines.category_id_tbl(i));
550: PO_LOG.stmt(d_module, d_position, 'new category_id',
543: x_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE) THEN
544:
545: IF (PO_LOG.d_stmt) THEN
546: PO_LOG.stmt(d_module, d_position, 'po_line_id', x_lines.po_line_id_tbl(i));
547: PO_LOG.stmt(d_module, d_position, 'reference',
548: l_line_ref_tbl(x_lines.po_line_id_tbl(i)));
549: PO_LOG.stmt(d_module, d_position, 'orig category_id', x_lines.category_id_tbl(i));
550: PO_LOG.stmt(d_module, d_position, 'new category_id',
551: l_category_id_tbl(l_line_ref_tbl(x_lines.po_line_id_tbl(i))));
545: IF (PO_LOG.d_stmt) THEN
546: PO_LOG.stmt(d_module, d_position, 'po_line_id', x_lines.po_line_id_tbl(i));
547: PO_LOG.stmt(d_module, d_position, 'reference',
548: l_line_ref_tbl(x_lines.po_line_id_tbl(i)));
549: PO_LOG.stmt(d_module, d_position, 'orig category_id', x_lines.category_id_tbl(i));
550: PO_LOG.stmt(d_module, d_position, 'new category_id',
551: l_category_id_tbl(l_line_ref_tbl(x_lines.po_line_id_tbl(i))));
552: PO_LOG.stmt(d_module, d_position, 'allow_desc_update_flag',
553: l_allow_desc_update_tbl(l_line_ref_tbl(x_lines.po_line_id_tbl(i))));
546: PO_LOG.stmt(d_module, d_position, 'po_line_id', x_lines.po_line_id_tbl(i));
547: PO_LOG.stmt(d_module, d_position, 'reference',
548: l_line_ref_tbl(x_lines.po_line_id_tbl(i)));
549: PO_LOG.stmt(d_module, d_position, 'orig category_id', x_lines.category_id_tbl(i));
550: PO_LOG.stmt(d_module, d_position, 'new category_id',
551: l_category_id_tbl(l_line_ref_tbl(x_lines.po_line_id_tbl(i))));
552: PO_LOG.stmt(d_module, d_position, 'allow_desc_update_flag',
553: l_allow_desc_update_tbl(l_line_ref_tbl(x_lines.po_line_id_tbl(i))));
554: END IF;
548: l_line_ref_tbl(x_lines.po_line_id_tbl(i)));
549: PO_LOG.stmt(d_module, d_position, 'orig category_id', x_lines.category_id_tbl(i));
550: PO_LOG.stmt(d_module, d_position, 'new category_id',
551: l_category_id_tbl(l_line_ref_tbl(x_lines.po_line_id_tbl(i))));
552: PO_LOG.stmt(d_module, d_position, 'allow_desc_update_flag',
553: l_allow_desc_update_tbl(l_line_ref_tbl(x_lines.po_line_id_tbl(i))));
554: END IF;
555:
556:
580: p_vendor_id_tbl => x_lines.hd_vendor_id_tbl,
581: x_price_update_tolerance_tbl => x_lines.price_update_tolerance_tbl
582: );
583:
584: IF (PO_LOG.d_stmt) THEN
585: PO_LOG.stmt(d_module, d_position, 'price tolerance',
586: x_lines.price_update_tolerance_tbl);
587: END IF;
588:
581: x_price_update_tolerance_tbl => x_lines.price_update_tolerance_tbl
582: );
583:
584: IF (PO_LOG.d_stmt) THEN
585: PO_LOG.stmt(d_module, d_position, 'price tolerance',
586: x_lines.price_update_tolerance_tbl);
587: END IF;
588:
589: d_position := 50;
595: d_position := 60;
596:
597: IF (x_lines.error_flag_tbl(i) = FND_API.g_FALSE AND
598: x_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE) THEN
599: IF (PO_LOG.d_stmt) THEN
600: PO_LOG.stmt(d_module, d_position, 'update line on index', i);
601: END IF;
602:
603: -- reset variables
596:
597: IF (x_lines.error_flag_tbl(i) = FND_API.g_FALSE AND
598: x_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE) THEN
599: IF (PO_LOG.d_stmt) THEN
600: PO_LOG.stmt(d_module, d_position, 'update line on index', i);
601: END IF;
602:
603: -- reset variables
604: l_uom_different := FND_API.g_FALSE;
606:
607: -- get index reference in existing value tables
608: l_index := l_line_ref_tbl(x_lines.po_line_id_tbl(i));
609:
610: IF (PO_LOG.d_stmt) THEN
611: PO_LOG.stmt(d_module, d_position, 'reference in original values',
612: l_index);
613: END IF;
614:
607: -- get index reference in existing value tables
608: l_index := l_line_ref_tbl(x_lines.po_line_id_tbl(i));
609:
610: IF (PO_LOG.d_stmt) THEN
611: PO_LOG.stmt(d_module, d_position, 'reference in original values',
612: l_index);
613: END IF;
614:
615: d_position := 70;
619: x_lines.order_type_lookup_code_tbl(i) <> 'FIXED PRICE' AND
620: x_lines.unit_of_measure_tbl(i) <> l_unit_of_measure_tbl(l_index)) THEN
621: l_uom_different := FND_API.g_TRUE;
622:
623: IF (PO_LOG.d_stmt) THEN
624: PO_LOG.stmt(d_module, d_position, 'uom_different',
625: l_uom_different);
626: END IF;
627:
620: x_lines.unit_of_measure_tbl(i) <> l_unit_of_measure_tbl(l_index)) THEN
621: l_uom_different := FND_API.g_TRUE;
622:
623: IF (PO_LOG.d_stmt) THEN
624: PO_LOG.stmt(d_module, d_position, 'uom_different',
625: l_uom_different);
626: END IF;
627:
628: END IF;
631:
632: -- update description
633: IF (NVL(x_lines.allow_desc_update_flag_tbl(i), 'Y') = 'Y' AND
634: x_lines.item_desc_tbl(i) IS NOT NULL) THEN
635: IF (PO_LOG.d_stmt) THEN
636: PO_LOG.stmt(d_module, d_position, 'item id', x_lines.item_id_tbl(i));
637: PO_LOG.stmt(d_module, d_position, 'item desc', x_lines.item_desc_tbl(i));
638: END IF;
639:
632: -- update description
633: IF (NVL(x_lines.allow_desc_update_flag_tbl(i), 'Y') = 'Y' AND
634: x_lines.item_desc_tbl(i) IS NOT NULL) THEN
635: IF (PO_LOG.d_stmt) THEN
636: PO_LOG.stmt(d_module, d_position, 'item id', x_lines.item_id_tbl(i));
637: PO_LOG.stmt(d_module, d_position, 'item desc', x_lines.item_desc_tbl(i));
638: END IF;
639:
640: -- update description in item master
633: IF (NVL(x_lines.allow_desc_update_flag_tbl(i), 'Y') = 'Y' AND
634: x_lines.item_desc_tbl(i) IS NOT NULL) THEN
635: IF (PO_LOG.d_stmt) THEN
636: PO_LOG.stmt(d_module, d_position, 'item id', x_lines.item_id_tbl(i));
637: PO_LOG.stmt(d_module, d_position, 'item desc', x_lines.item_desc_tbl(i));
638: END IF;
639:
640: -- update description in item master
641: IF (NVL(PO_PDOI_PARAMS.g_request.create_items, 'N') = 'Y' AND
656: END IF;
657:
658: d_position := 100;
659:
660: IF (PO_LOG.d_stmt) THEN
661: PO_LOG.stmt(d_module, d_position, 'create_line_loc',
662: x_lines.create_line_loc_tbl(i));
663: PO_LOG.stmt(d_module, d_position, 'unit_price',
664: x_lines.unit_price_tbl(i));
657:
658: d_position := 100;
659:
660: IF (PO_LOG.d_stmt) THEN
661: PO_LOG.stmt(d_module, d_position, 'create_line_loc',
662: x_lines.create_line_loc_tbl(i));
663: PO_LOG.stmt(d_module, d_position, 'unit_price',
664: x_lines.unit_price_tbl(i));
665: PO_LOG.stmt(d_module, d_position, 'orig unit_price',
659:
660: IF (PO_LOG.d_stmt) THEN
661: PO_LOG.stmt(d_module, d_position, 'create_line_loc',
662: x_lines.create_line_loc_tbl(i));
663: PO_LOG.stmt(d_module, d_position, 'unit_price',
664: x_lines.unit_price_tbl(i));
665: PO_LOG.stmt(d_module, d_position, 'orig unit_price',
666: l_unit_price_tbl(l_index));
667: PO_LOG.stmt(d_module, d_position, 'process_code in request',
661: PO_LOG.stmt(d_module, d_position, 'create_line_loc',
662: x_lines.create_line_loc_tbl(i));
663: PO_LOG.stmt(d_module, d_position, 'unit_price',
664: x_lines.unit_price_tbl(i));
665: PO_LOG.stmt(d_module, d_position, 'orig unit_price',
666: l_unit_price_tbl(l_index));
667: PO_LOG.stmt(d_module, d_position, 'process_code in request',
668: PO_PDOI_PARAMS.g_request.process_code);
669: PO_LOG.stmt(d_module, d_position, 'role in request',
663: PO_LOG.stmt(d_module, d_position, 'unit_price',
664: x_lines.unit_price_tbl(i));
665: PO_LOG.stmt(d_module, d_position, 'orig unit_price',
666: l_unit_price_tbl(l_index));
667: PO_LOG.stmt(d_module, d_position, 'process_code in request',
668: PO_PDOI_PARAMS.g_request.process_code);
669: PO_LOG.stmt(d_module, d_position, 'role in request',
670: PO_PDOI_PARAMS.g_request.role);
671: PO_LOG.stmt(d_module, d_position, 'global agreement flag',
665: PO_LOG.stmt(d_module, d_position, 'orig unit_price',
666: l_unit_price_tbl(l_index));
667: PO_LOG.stmt(d_module, d_position, 'process_code in request',
668: PO_PDOI_PARAMS.g_request.process_code);
669: PO_LOG.stmt(d_module, d_position, 'role in request',
670: PO_PDOI_PARAMS.g_request.role);
671: PO_LOG.stmt(d_module, d_position, 'global agreement flag',
672: x_lines.hd_global_agreement_flag_tbl(i));
673: PO_LOG.stmt(d_module, d_position, 'uom_different',
667: PO_LOG.stmt(d_module, d_position, 'process_code in request',
668: PO_PDOI_PARAMS.g_request.process_code);
669: PO_LOG.stmt(d_module, d_position, 'role in request',
670: PO_PDOI_PARAMS.g_request.role);
671: PO_LOG.stmt(d_module, d_position, 'global agreement flag',
672: x_lines.hd_global_agreement_flag_tbl(i));
673: PO_LOG.stmt(d_module, d_position, 'uom_different',
674: l_uom_different);
675: PO_LOG.stmt(d_module, d_position, 'orig intf line id',
669: PO_LOG.stmt(d_module, d_position, 'role in request',
670: PO_PDOI_PARAMS.g_request.role);
671: PO_LOG.stmt(d_module, d_position, 'global agreement flag',
672: x_lines.hd_global_agreement_flag_tbl(i));
673: PO_LOG.stmt(d_module, d_position, 'uom_different',
674: l_uom_different);
675: PO_LOG.stmt(d_module, d_position, 'orig intf line id',
676: l_orig_intf_line_id_tbl(l_index));
677: END IF;
671: PO_LOG.stmt(d_module, d_position, 'global agreement flag',
672: x_lines.hd_global_agreement_flag_tbl(i));
673: PO_LOG.stmt(d_module, d_position, 'uom_different',
674: l_uom_different);
675: PO_LOG.stmt(d_module, d_position, 'orig intf line id',
676: l_orig_intf_line_id_tbl(l_index));
677: END IF;
678:
679: -- bug5149827
682: IF (PO_PDOI_PARAMS.g_request.process_code <>
683: PO_PDOI_CONSTANTS.g_PROCESS_CODE_NOTIFIED
684: AND
685: l_orig_intf_line_id_tbl(l_index) IS NOT NULL) THEN
686: IF (PO_LOG.d_stmt) THEN
687: PO_LOG.stmt(d_module, d_position, 'orig_intf_line_id exists');
688: END IF;
689:
690: l_exceed_tolerance := FND_API.G_TRUE;
683: PO_PDOI_CONSTANTS.g_PROCESS_CODE_NOTIFIED
684: AND
685: l_orig_intf_line_id_tbl(l_index) IS NOT NULL) THEN
686: IF (PO_LOG.d_stmt) THEN
687: PO_LOG.stmt(d_module, d_position, 'orig_intf_line_id exists');
688: END IF;
689:
690: l_exceed_tolerance := FND_API.G_TRUE;
691: x_lines.parent_interface_line_id_tbl(i) := l_orig_intf_line_id_tbl(l_index);
734: ELSE
735: x_lines.unit_price_tbl(i) := NULL;
736: END IF; -- if unit price = NULLIFY_NUM
737:
738: IF (PO_LOG.d_stmt) THEN
739: PO_LOG.stmt(d_module, d_position, 'l_exceed_tolerance', l_exceed_tolerance);
740: END IF;
741:
742: d_position := 120;
735: x_lines.unit_price_tbl(i) := NULL;
736: END IF; -- if unit price = NULLIFY_NUM
737:
738: IF (PO_LOG.d_stmt) THEN
739: PO_LOG.stmt(d_module, d_position, 'l_exceed_tolerance', l_exceed_tolerance);
740: END IF;
741:
742: d_position := 120;
743:
778: -- bug5149827
779: -- Move the handling of exceed tolerance = T to here
780: IF (l_exceed_tolerance = FND_API.g_TRUE) THEN
781:
782: IF (PO_LOG.d_stmt) THEN
783: PO_LOG.stmt(d_module, d_position, 'set line to be notified', i);
784: PO_LOG.stmt(d_module, d_position, 'notified intf header id',
785: x_lines.intf_header_id_tbl(i));
786: END IF;
779: -- Move the handling of exceed tolerance = T to here
780: IF (l_exceed_tolerance = FND_API.g_TRUE) THEN
781:
782: IF (PO_LOG.d_stmt) THEN
783: PO_LOG.stmt(d_module, d_position, 'set line to be notified', i);
784: PO_LOG.stmt(d_module, d_position, 'notified intf header id',
785: x_lines.intf_header_id_tbl(i));
786: END IF;
787:
780: IF (l_exceed_tolerance = FND_API.g_TRUE) THEN
781:
782: IF (PO_LOG.d_stmt) THEN
783: PO_LOG.stmt(d_module, d_position, 'set line to be notified', i);
784: PO_LOG.stmt(d_module, d_position, 'notified intf header id',
785: x_lines.intf_header_id_tbl(i));
786: END IF;
787:
788: -- set process_code to be 'NOTIFIED' for this line;
835: p_currency_code => x_lines.hd_currency_code_tbl(i),
836: x_precision_tbl => l_precision_tbl
837: );
838:
839: IF (PO_LOG.d_stmt) THEN
840: PO_LOG.stmt(d_module, d_position, 'l_precision', l_precision);
841: END IF;
842:
843: -- retroactive_date reset to sysdate since price is changed
836: x_precision_tbl => l_precision_tbl
837: );
838:
839: IF (PO_LOG.d_stmt) THEN
840: PO_LOG.stmt(d_module, d_position, 'l_precision', l_precision);
841: END IF;
842:
843: -- retroactive_date reset to sysdate since price is changed
844: IF (PO_PDOI_PARAMS.g_request.document_type = PO_PDOI_CONSTANTS.g_DOC_TYPE_BLANKET AND
850:
851: l_unit_price_tbl(l_index) :=
852: round((l_unit_price_tbl(l_index)/l_uom_rate),l_precision);
853:
854: IF (PO_LOG.d_stmt) THEN
855: PO_LOG.stmt(d_module, d_position, 'new price', l_unit_price_tbl(l_index));
856: END IF;
857:
858: IF (x_lines.base_unit_price_tbl(i) = PO_PDOI_CONSTANTS.g_NULLIFY_NUM) THEN
851: l_unit_price_tbl(l_index) :=
852: round((l_unit_price_tbl(l_index)/l_uom_rate),l_precision);
853:
854: IF (PO_LOG.d_stmt) THEN
855: PO_LOG.stmt(d_module, d_position, 'new price', l_unit_price_tbl(l_index));
856: END IF;
857:
858: IF (x_lines.base_unit_price_tbl(i) = PO_PDOI_CONSTANTS.g_NULLIFY_NUM) THEN
859: l_base_unit_price_tbl(l_index) := NULL;
957: -- set has_lines_updated flag in g_docs_info
958: IF (l_exceed_tolerance = FND_API.g_FALSE) THEN
959: PO_PDOI_PARAMS.g_docs_info(x_lines.intf_header_id_tbl(i)).has_lines_updated := 'Y';
960:
961: IF (PO_LOG.d_stmt) THEN
962: PO_LOG.stmt(d_module, d_position, 'line updated for document',
963: x_lines.intf_header_id_tbl(i));
964: END IF;
965: END IF;
958: IF (l_exceed_tolerance = FND_API.g_FALSE) THEN
959: PO_PDOI_PARAMS.g_docs_info(x_lines.intf_header_id_tbl(i)).has_lines_updated := 'Y';
960:
961: IF (PO_LOG.d_stmt) THEN
962: PO_LOG.stmt(d_module, d_position, 'line updated for document',
963: x_lines.intf_header_id_tbl(i));
964: END IF;
965: END IF;
966:
1001: );
1002:
1003: d_position := 270;
1004:
1005: IF (PO_LOG.d_stmt) THEN
1006: PO_LOG.stmt(d_module, d_position, 'return status for item update',
1007: l_return_status);
1008: END IF;
1009:
1002:
1003: d_position := 270;
1004:
1005: IF (PO_LOG.d_stmt) THEN
1006: PO_LOG.stmt(d_module, d_position, 'return status for item update',
1007: l_return_status);
1008: END IF;
1009:
1010: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1013: (
1014: x_message_list => l_message_list
1015: );
1016:
1017: IF (PO_LOG.d_stmt) THEN
1018: PO_LOG.stmt(d_module, d_position, 'count of error message',
1019: l_message_list.COUNT);
1020: END IF;
1021:
1014: x_message_list => l_message_list
1015: );
1016:
1017: IF (PO_LOG.d_stmt) THEN
1018: PO_LOG.stmt(d_module, d_position, 'count of error message',
1019: l_message_list.COUNT);
1020: END IF;
1021:
1022: FOR i IN 1..l_message_list.COUNT
1020: END IF;
1021:
1022: FOR i IN 1..l_message_list.COUNT
1023: LOOP
1024: IF (PO_LOG.d_stmt) THEN
1025: PO_LOG.stmt(d_module, d_position, 'index', i);
1026: PO_LOG.stmt(d_module, d_position, 'intf header id',
1027: x_lines.intf_header_id_tbl(l_index));
1028: PO_LOG.stmt(d_module, d_position, 'intf line id',
1021:
1022: FOR i IN 1..l_message_list.COUNT
1023: LOOP
1024: IF (PO_LOG.d_stmt) THEN
1025: PO_LOG.stmt(d_module, d_position, 'index', i);
1026: PO_LOG.stmt(d_module, d_position, 'intf header id',
1027: x_lines.intf_header_id_tbl(l_index));
1028: PO_LOG.stmt(d_module, d_position, 'intf line id',
1029: x_lines.intf_line_id_tbl(l_index));
1022: FOR i IN 1..l_message_list.COUNT
1023: LOOP
1024: IF (PO_LOG.d_stmt) THEN
1025: PO_LOG.stmt(d_module, d_position, 'index', i);
1026: PO_LOG.stmt(d_module, d_position, 'intf header id',
1027: x_lines.intf_header_id_tbl(l_index));
1028: PO_LOG.stmt(d_module, d_position, 'intf line id',
1029: x_lines.intf_line_id_tbl(l_index));
1030: PO_LOG.stmt(d_module, d_position, 'message text',
1024: IF (PO_LOG.d_stmt) THEN
1025: PO_LOG.stmt(d_module, d_position, 'index', i);
1026: PO_LOG.stmt(d_module, d_position, 'intf header id',
1027: x_lines.intf_header_id_tbl(l_index));
1028: PO_LOG.stmt(d_module, d_position, 'intf line id',
1029: x_lines.intf_line_id_tbl(l_index));
1030: PO_LOG.stmt(d_module, d_position, 'message text',
1031: l_message_list(i).message_text);
1032: PO_LOG.stmt(d_module, d_position, 'table name',
1026: PO_LOG.stmt(d_module, d_position, 'intf header id',
1027: x_lines.intf_header_id_tbl(l_index));
1028: PO_LOG.stmt(d_module, d_position, 'intf line id',
1029: x_lines.intf_line_id_tbl(l_index));
1030: PO_LOG.stmt(d_module, d_position, 'message text',
1031: l_message_list(i).message_text);
1032: PO_LOG.stmt(d_module, d_position, 'table name',
1033: l_message_list(i).table_name);
1034: END IF;
1028: PO_LOG.stmt(d_module, d_position, 'intf line id',
1029: x_lines.intf_line_id_tbl(l_index));
1030: PO_LOG.stmt(d_module, d_position, 'message text',
1031: l_message_list(i).message_text);
1032: PO_LOG.stmt(d_module, d_position, 'table name',
1033: l_message_list(i).table_name);
1034: END IF;
1035:
1036: PO_PDOI_ERR_UTL.add_fatal_error
1048: x_lines.error_flag_tbl(l_index) := FND_API.g_TRUE;
1049:
1050: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_LINE_UPDATE);
1051:
1052: IF (PO_LOG.d_proc) THEN
1053: PO_LOG.proc_end (d_module);
1054: END IF;
1055:
1056: RETURN;
1049:
1050: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_LINE_UPDATE);
1051:
1052: IF (PO_LOG.d_proc) THEN
1053: PO_LOG.proc_end (d_module);
1054: END IF;
1055:
1056: RETURN;
1057: END IF;
1267: );
1268:
1269: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_LINE_UPDATE);
1270:
1271: IF (PO_LOG.d_proc) THEN
1272: PO_LOG.proc_end (d_module);
1273: END IF;
1274:
1275: EXCEPTION
1268:
1269: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_LINE_UPDATE);
1270:
1271: IF (PO_LOG.d_proc) THEN
1272: PO_LOG.proc_end (d_module);
1273: END IF;
1274:
1275: EXCEPTION
1276: WHEN OTHERS THEN
1315: l_record_already_exist_tbl PO_TBL_VARCHAR1 := PO_TBL_VARCHAR1();
1316: BEGIN
1317: d_position := 0;
1318:
1319: IF (PO_LOG.d_proc) THEN
1320: PO_LOG.proc_begin(d_module);
1321: END IF;
1322:
1323: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_LINE_LOC_INSERT);
1316: BEGIN
1317: d_position := 0;
1318:
1319: IF (PO_LOG.d_proc) THEN
1320: PO_LOG.proc_begin(d_module);
1321: END IF;
1322:
1323: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_LINE_LOC_INSERT);
1324:
1368: );
1369:
1370: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_LINE_LOC_INSERT);
1371:
1372: IF (PO_LOG.d_proc) THEN
1373: PO_LOG.proc_end (d_module);
1374: END IF;
1375:
1376: EXCEPTION
1369:
1370: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_LINE_LOC_INSERT);
1371:
1372: IF (PO_LOG.d_proc) THEN
1373: PO_LOG.proc_end (d_module);
1374: END IF;
1375:
1376: EXCEPTION
1377: WHEN OTHERS THEN
1410:
1411: BEGIN
1412: d_position := 0;
1413:
1414: IF (PO_LOG.d_proc) THEN
1415: PO_LOG.proc_begin(d_module);
1416: END IF;
1417:
1418: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_DIST_INSERT);
1411: BEGIN
1412: d_position := 0;
1413:
1414: IF (PO_LOG.d_proc) THEN
1415: PO_LOG.proc_begin(d_module);
1416: END IF;
1417:
1418: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_DIST_INSERT);
1419:
1424: );
1425:
1426: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_DIST_INSERT);
1427:
1428: IF (PO_LOG.d_proc) THEN
1429: PO_LOG.proc_end (d_module);
1430: END IF;
1431:
1432: EXCEPTION
1425:
1426: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_DIST_INSERT);
1427:
1428: IF (PO_LOG.d_proc) THEN
1429: PO_LOG.proc_end (d_module);
1430: END IF;
1431:
1432: EXCEPTION
1433: WHEN OTHERS THEN
1466:
1467: BEGIN
1468: d_position := 0;
1469:
1470: IF (PO_LOG.d_proc) THEN
1471: PO_LOG.proc_begin(d_module);
1472: END IF;
1473:
1474: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_PRICE_DIFF_INSERT);
1467: BEGIN
1468: d_position := 0;
1469:
1470: IF (PO_LOG.d_proc) THEN
1471: PO_LOG.proc_begin(d_module);
1472: END IF;
1473:
1474: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_PRICE_DIFF_INSERT);
1475:
1480: );
1481:
1482: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_PRICE_DIFF_INSERT);
1483:
1484: IF (PO_LOG.d_proc) THEN
1485: PO_LOG.proc_end (d_module);
1486: END IF;
1487:
1488: EXCEPTION
1481:
1482: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_PRICE_DIFF_INSERT);
1483:
1484: IF (PO_LOG.d_proc) THEN
1485: PO_LOG.proc_end (d_module);
1486: END IF;
1487:
1488: EXCEPTION
1489: WHEN OTHERS THEN
1539: l_record_already_exist_tbl PO_TBL_VARCHAR1 := PO_TBL_VARCHAR1();
1540: BEGIN
1541: d_position := 0;
1542:
1543: IF (PO_LOG.d_proc) THEN
1544: PO_LOG.proc_begin(d_module, 'p_sync_attr_id_tbl', p_sync_attr_id_tbl);
1545: PO_LOG.proc_begin(d_module, 'p_sync_draft_id_tbl', p_sync_draft_id_tbl);
1546: END IF;
1547:
1540: BEGIN
1541: d_position := 0;
1542:
1543: IF (PO_LOG.d_proc) THEN
1544: PO_LOG.proc_begin(d_module, 'p_sync_attr_id_tbl', p_sync_attr_id_tbl);
1545: PO_LOG.proc_begin(d_module, 'p_sync_draft_id_tbl', p_sync_draft_id_tbl);
1546: END IF;
1547:
1548: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_ATTR_VALUES_INSERT);
1541: d_position := 0;
1542:
1543: IF (PO_LOG.d_proc) THEN
1544: PO_LOG.proc_begin(d_module, 'p_sync_attr_id_tbl', p_sync_attr_id_tbl);
1545: PO_LOG.proc_begin(d_module, 'p_sync_draft_id_tbl', p_sync_draft_id_tbl);
1546: END IF;
1547:
1548: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_ATTR_VALUES_INSERT);
1549:
1598: );
1599:
1600: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_ATTR_VALUES_INSERT);
1601:
1602: IF (PO_LOG.d_proc) THEN
1603: PO_LOG.proc_end (d_module);
1604: END IF;
1605:
1606: EXCEPTION
1599:
1600: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_ATTR_VALUES_INSERT);
1601:
1602: IF (PO_LOG.d_proc) THEN
1603: PO_LOG.proc_end (d_module);
1604: END IF;
1605:
1606: EXCEPTION
1607: WHEN OTHERS THEN
1657: l_record_already_exist_tbl PO_TBL_VARCHAR1 := PO_TBL_VARCHAR1();
1658: BEGIN
1659: d_position := 0;
1660:
1661: IF (PO_LOG.d_proc) THEN
1662: PO_LOG.proc_begin(d_module, 'p_sync_attr_tlp_id_tbl', p_sync_attr_tlp_id_tbl);
1663: PO_LOG.proc_begin(d_module, 'p_sync_draft_id_tbl', p_sync_draft_id_tbl);
1664: END IF;
1665:
1658: BEGIN
1659: d_position := 0;
1660:
1661: IF (PO_LOG.d_proc) THEN
1662: PO_LOG.proc_begin(d_module, 'p_sync_attr_tlp_id_tbl', p_sync_attr_tlp_id_tbl);
1663: PO_LOG.proc_begin(d_module, 'p_sync_draft_id_tbl', p_sync_draft_id_tbl);
1664: END IF;
1665:
1666: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_ATTR_VALUES_TLP_INSERT);
1659: d_position := 0;
1660:
1661: IF (PO_LOG.d_proc) THEN
1662: PO_LOG.proc_begin(d_module, 'p_sync_attr_tlp_id_tbl', p_sync_attr_tlp_id_tbl);
1663: PO_LOG.proc_begin(d_module, 'p_sync_draft_id_tbl', p_sync_draft_id_tbl);
1664: END IF;
1665:
1666: PO_TIMING_UTL.start_time(PO_PDOI_CONSTANTS.g_T_ATTR_VALUES_TLP_INSERT);
1667:
1718: );
1719:
1720: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_ATTR_VALUES_TLP_INSERT);
1721:
1722: IF (PO_LOG.d_proc) THEN
1723: PO_LOG.proc_end (d_module);
1724: END IF;
1725:
1726: EXCEPTION
1719:
1720: PO_TIMING_UTL.stop_time(PO_PDOI_CONSTANTS.g_T_ATTR_VALUES_TLP_INSERT);
1721:
1722: IF (PO_LOG.d_proc) THEN
1723: PO_LOG.proc_end (d_module);
1724: END IF;
1725:
1726: EXCEPTION
1727: WHEN OTHERS THEN
1766: l_count NUMBER;
1767: BEGIN
1768: d_position := 0;
1769:
1770: IF (PO_LOG.d_proc) THEN
1771: PO_LOG.proc_begin(d_module);
1772: END IF;
1773:
1774: IF (PO_LOG.d_stmt) THEN
1767: BEGIN
1768: d_position := 0;
1769:
1770: IF (PO_LOG.d_proc) THEN
1771: PO_LOG.proc_begin(d_module);
1772: END IF;
1773:
1774: IF (PO_LOG.d_stmt) THEN
1775: FOR i IN 1..p_headers.rec_count
1770: IF (PO_LOG.d_proc) THEN
1771: PO_LOG.proc_begin(d_module);
1772: END IF;
1773:
1774: IF (PO_LOG.d_stmt) THEN
1775: FOR i IN 1..p_headers.rec_count
1776: LOOP
1777: IF (p_headers.error_flag_tbl(i) = FND_API.G_FALSE) THEN
1778: l_valid_intf_header_id_tbl.EXTEND(1);
1781: p_headers.intf_header_id_tbl(i);
1782: END IF;
1783: END LOOP;
1784:
1785: PO_LOG.stmt(d_module, d_position, 'intf header to be inserted',
1786: l_valid_intf_header_id_tbl);
1787: END IF;
1788:
1789: FORALL i IN 1..p_headers.rec_count
2006: FROM po_headers_interface
2007: WHERE interface_header_id = p_headers.intf_header_id_tbl(i)
2008: AND p_headers.error_flag_tbl(i) = FND_API.g_FALSE;
2009:
2010: IF (PO_LOG.d_proc) THEN
2011: PO_LOG.proc_end (d_module);
2012: END IF;
2013:
2014: EXCEPTION
2007: WHERE interface_header_id = p_headers.intf_header_id_tbl(i)
2008: AND p_headers.error_flag_tbl(i) = FND_API.g_FALSE;
2009:
2010: IF (PO_LOG.d_proc) THEN
2011: PO_LOG.proc_end (d_module);
2012: END IF;
2013:
2014: EXCEPTION
2015: WHEN OTHERS THEN
2049:
2050: BEGIN
2051: d_position := 0;
2052:
2053: IF (PO_LOG.d_proc) THEN
2054: PO_LOG.proc_begin(d_module);
2055: END IF;
2056:
2057: IF (PO_PDOI_PARAMS.g_request.document_type =
2050: BEGIN
2051: d_position := 0;
2052:
2053: IF (PO_LOG.d_proc) THEN
2054: PO_LOG.proc_begin(d_module);
2055: END IF;
2056:
2057: IF (PO_PDOI_PARAMS.g_request.document_type =
2058: PO_PDOI_CONSTANTS.g_DOC_TYPE_BLANKET) THEN
2095: AND p_headers.doc_type_tbl(i) = PO_PDOI_CONSTANTS.g_DOC_TYPE_BLANKET
2096: AND COALESCE(global_agreement_flag, PO_PDOI_PARAMS.g_request.ga_flag, 'N') = 'Y';
2097: END IF;
2098:
2099: IF (PO_LOG.d_proc) THEN
2100: PO_LOG.proc_end (d_module);
2101: END IF;
2102:
2103: EXCEPTION
2096: AND COALESCE(global_agreement_flag, PO_PDOI_PARAMS.g_request.ga_flag, 'N') = 'Y';
2097: END IF;
2098:
2099: IF (PO_LOG.d_proc) THEN
2100: PO_LOG.proc_end (d_module);
2101: END IF;
2102:
2103: EXCEPTION
2104: WHEN OTHERS THEN
2146:
2147: BEGIN
2148: d_position := 0;
2149:
2150: IF (PO_LOG.d_proc) THEN
2151: PO_LOG.proc_begin(d_module);
2152: END IF;
2153:
2154: -- add distribution row from po_headers_interface table
2147: BEGIN
2148: d_position := 0;
2149:
2150: IF (PO_LOG.d_proc) THEN
2151: PO_LOG.proc_begin(d_module);
2152: END IF;
2153:
2154: -- add distribution row from po_headers_interface table
2155: IF (PO_PDOI_PARAMS.g_request.document_type =
2217: WHERE p_headers.error_flag_tbl(i) = FND_API.g_FALSE
2218: AND p_headers.encumbrance_required_flag_tbl(i) = 'Y';
2219: END IF;
2220:
2221: IF (PO_LOG.d_proc) THEN
2222: PO_LOG.proc_end (d_module);
2223: END IF;
2224:
2225: EXCEPTION
2218: AND p_headers.encumbrance_required_flag_tbl(i) = 'Y';
2219: END IF;
2220:
2221: IF (PO_LOG.d_proc) THEN
2222: PO_LOG.proc_end (d_module);
2223: END IF;
2224:
2225: EXCEPTION
2226: WHEN OTHERS THEN
2271: l_count NUMBER := 0;
2272: BEGIN
2273: d_position := 0;
2274:
2275: IF (PO_LOG.d_proc) THEN
2276: PO_LOG.proc_begin(d_module);
2277: END IF;
2278:
2279: IF (PO_LOG.d_stmt) THEN
2272: BEGIN
2273: d_position := 0;
2274:
2275: IF (PO_LOG.d_proc) THEN
2276: PO_LOG.proc_begin(d_module);
2277: END IF;
2278:
2279: IF (PO_LOG.d_stmt) THEN
2280: FOR i IN 1..p_dists.rec_count
2275: IF (PO_LOG.d_proc) THEN
2276: PO_LOG.proc_begin(d_module);
2277: END IF;
2278:
2279: IF (PO_LOG.d_stmt) THEN
2280: FOR i IN 1..p_dists.rec_count
2281: LOOP
2282: IF (p_dists.error_flag_tbl(i) = FND_API.g_FALSE) THEN
2283: l_valid_intf_dist_id_tbl.EXTEND(1);
2286: p_dists.intf_dist_id_tbl(i);
2287: END IF;
2288: END LOOP;
2289:
2290: PO_LOG.stmt(d_module, d_position, 'intf dist to be inserted',
2291: l_valid_intf_dist_id_tbl);
2292: END IF;
2293:
2294: -- add distribution row from po_distributions_inteface table
2480: FROM po_distributions_interface
2481: WHERE interface_distribution_id = p_dists.intf_dist_id_tbl(i)
2482: AND p_dists.error_flag_tbl(i) = FND_API.g_FALSE;
2483:
2484: IF (PO_LOG.d_proc) THEN
2485: PO_LOG.proc_end (d_module);
2486: END IF;
2487:
2488: EXCEPTION
2481: WHERE interface_distribution_id = p_dists.intf_dist_id_tbl(i)
2482: AND p_dists.error_flag_tbl(i) = FND_API.g_FALSE;
2483:
2484: IF (PO_LOG.d_proc) THEN
2485: PO_LOG.proc_end (d_module);
2486: END IF;
2487:
2488: EXCEPTION
2489: WHEN OTHERS THEN
2525: l_count NUMBER := 0;
2526: BEGIN
2527: d_position := 0;
2528:
2529: IF (PO_LOG.d_proc) THEN
2530: PO_LOG.proc_begin(d_module);
2531: END IF;
2532:
2533:
2526: BEGIN
2527: d_position := 0;
2528:
2529: IF (PO_LOG.d_proc) THEN
2530: PO_LOG.proc_begin(d_module);
2531: END IF;
2532:
2533:
2534: IF (PO_LOG.d_stmt) THEN
2530: PO_LOG.proc_begin(d_module);
2531: END IF;
2532:
2533:
2534: IF (PO_LOG.d_stmt) THEN
2535:
2536: FOR i IN 1..p_lines.rec_count
2537: LOOP
2538: IF (p_lines.error_flag_tbl(i) = FND_API.g_FALSE AND
2536: FOR i IN 1..p_lines.rec_count
2537: LOOP
2538: IF (p_lines.error_flag_tbl(i) = FND_API.g_FALSE AND
2539: p_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE) THEN
2540: PO_LOG.stmt(d_module, d_position, 'interface line id', p_lines.intf_line_id_tbl(i));
2541: PO_LOG.stmt(d_module, d_position, 'po_header_id', p_lines.po_header_id_tbl(i));
2542: PO_LOG.stmt(d_module, d_position, 'line_num', p_lines.line_num_tbl(i));
2543: PO_LOG.stmt(d_module, d_position, 'draft_id', p_lines.draft_id_tbl(i));
2544: PO_LOG.stmt(d_module, d_position, 'supplier_part_auxid',
2537: LOOP
2538: IF (p_lines.error_flag_tbl(i) = FND_API.g_FALSE AND
2539: p_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE) THEN
2540: PO_LOG.stmt(d_module, d_position, 'interface line id', p_lines.intf_line_id_tbl(i));
2541: PO_LOG.stmt(d_module, d_position, 'po_header_id', p_lines.po_header_id_tbl(i));
2542: PO_LOG.stmt(d_module, d_position, 'line_num', p_lines.line_num_tbl(i));
2543: PO_LOG.stmt(d_module, d_position, 'draft_id', p_lines.draft_id_tbl(i));
2544: PO_LOG.stmt(d_module, d_position, 'supplier_part_auxid',
2545: p_lines.supplier_part_auxid_tbl(i));
2538: IF (p_lines.error_flag_tbl(i) = FND_API.g_FALSE AND
2539: p_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE) THEN
2540: PO_LOG.stmt(d_module, d_position, 'interface line id', p_lines.intf_line_id_tbl(i));
2541: PO_LOG.stmt(d_module, d_position, 'po_header_id', p_lines.po_header_id_tbl(i));
2542: PO_LOG.stmt(d_module, d_position, 'line_num', p_lines.line_num_tbl(i));
2543: PO_LOG.stmt(d_module, d_position, 'draft_id', p_lines.draft_id_tbl(i));
2544: PO_LOG.stmt(d_module, d_position, 'supplier_part_auxid',
2545: p_lines.supplier_part_auxid_tbl(i));
2546: END IF;
2539: p_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE) THEN
2540: PO_LOG.stmt(d_module, d_position, 'interface line id', p_lines.intf_line_id_tbl(i));
2541: PO_LOG.stmt(d_module, d_position, 'po_header_id', p_lines.po_header_id_tbl(i));
2542: PO_LOG.stmt(d_module, d_position, 'line_num', p_lines.line_num_tbl(i));
2543: PO_LOG.stmt(d_module, d_position, 'draft_id', p_lines.draft_id_tbl(i));
2544: PO_LOG.stmt(d_module, d_position, 'supplier_part_auxid',
2545: p_lines.supplier_part_auxid_tbl(i));
2546: END IF;
2547: END LOOP;
2540: PO_LOG.stmt(d_module, d_position, 'interface line id', p_lines.intf_line_id_tbl(i));
2541: PO_LOG.stmt(d_module, d_position, 'po_header_id', p_lines.po_header_id_tbl(i));
2542: PO_LOG.stmt(d_module, d_position, 'line_num', p_lines.line_num_tbl(i));
2543: PO_LOG.stmt(d_module, d_position, 'draft_id', p_lines.draft_id_tbl(i));
2544: PO_LOG.stmt(d_module, d_position, 'supplier_part_auxid',
2545: p_lines.supplier_part_auxid_tbl(i));
2546: END IF;
2547: END LOOP;
2548: END IF;
2758: WHERE interface_line_id = p_lines.intf_line_id_tbl(i)
2759: AND p_lines.error_flag_tbl(i) = FND_API.g_FALSE
2760: AND p_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE;
2761:
2762: IF (PO_LOG.d_proc) THEN
2763: PO_LOG.proc_end (d_module);
2764: END IF;
2765:
2766: EXCEPTION
2759: AND p_lines.error_flag_tbl(i) = FND_API.g_FALSE
2760: AND p_lines.need_to_reject_flag_tbl(i) = FND_API.g_FALSE;
2761:
2762: IF (PO_LOG.d_proc) THEN
2763: PO_LOG.proc_end (d_module);
2764: END IF;
2765:
2766: EXCEPTION
2767: WHEN OTHERS THEN
2804: l_count NUMBER := 0;
2805: BEGIN
2806: d_position := 0;
2807:
2808: IF (PO_LOG.d_proc) THEN
2809: PO_LOG.proc_begin(d_module);
2810: END IF;
2811:
2812: IF (PO_LOG.d_stmt) THEN
2805: BEGIN
2806: d_position := 0;
2807:
2808: IF (PO_LOG.d_proc) THEN
2809: PO_LOG.proc_begin(d_module);
2810: END IF;
2811:
2812: IF (PO_LOG.d_stmt) THEN
2813: FOR i IN 1..p_line_locs.rec_count
2808: IF (PO_LOG.d_proc) THEN
2809: PO_LOG.proc_begin(d_module);
2810: END IF;
2811:
2812: IF (PO_LOG.d_stmt) THEN
2813: FOR i IN 1..p_line_locs.rec_count
2814: LOOP
2815: IF (p_line_locs.error_flag_tbl(i) = FND_API.g_FALSE) THEN
2816: l_valid_intf_loc_id_tbl.EXTEND(1);
2819: p_line_locs.intf_line_loc_id_tbl(i);
2820: END IF;
2821: END LOOP;
2822:
2823: PO_LOG.stmt(d_module, d_position, 'intf line loc to be inserted',
2824: l_valid_intf_loc_id_tbl);
2825: END IF;
2826:
2827: FORALL i IN 1..p_line_locs.rec_count
3039: FROM po_line_locations_interface
3040: WHERE interface_line_location_id = p_line_locs.intf_line_loc_id_tbl(i)
3041: AND p_line_locs.error_flag_tbl(i) = FND_API.g_FALSE;
3042:
3043: IF (PO_LOG.d_proc) THEN
3044: PO_LOG.proc_end (d_module);
3045: END IF;
3046:
3047: EXCEPTION
3040: WHERE interface_line_location_id = p_line_locs.intf_line_loc_id_tbl(i)
3041: AND p_line_locs.error_flag_tbl(i) = FND_API.g_FALSE;
3042:
3043: IF (PO_LOG.d_proc) THEN
3044: PO_LOG.proc_end (d_module);
3045: END IF;
3046:
3047: EXCEPTION
3048: WHEN OTHERS THEN
3085: l_count NUMBER := 0;
3086: BEGIN
3087: d_position := 0;
3088:
3089: IF (PO_LOG.d_proc) THEN
3090: PO_LOG.proc_begin(d_module);
3091: END IF;
3092:
3093: IF (PO_LOG.d_stmt) THEN
3086: BEGIN
3087: d_position := 0;
3088:
3089: IF (PO_LOG.d_proc) THEN
3090: PO_LOG.proc_begin(d_module);
3091: END IF;
3092:
3093: IF (PO_LOG.d_stmt) THEN
3094: FOR i IN 1..p_price_diffs.rec_count
3089: IF (PO_LOG.d_proc) THEN
3090: PO_LOG.proc_begin(d_module);
3091: END IF;
3092:
3093: IF (PO_LOG.d_stmt) THEN
3094: FOR i IN 1..p_price_diffs.rec_count
3095: LOOP
3096: IF (p_price_diffs.error_flag_tbl(i) = FND_API.g_FALSE) THEN
3097: l_valid_intf_diff_id_tbl.EXTEND(1);
3100: p_price_diffs.intf_price_diff_id_tbl(i);
3101: END IF;
3102: END LOOP;
3103:
3104: PO_LOG.stmt(d_module, d_position, 'intf price diff to be inserted',
3105: l_valid_intf_diff_id_tbl);
3106: END IF;
3107:
3108: FORALL i IN 1..p_price_diffs.rec_count
3147: FROM po_price_diff_interface
3148: WHERE price_diff_interface_id = p_price_diffs.intf_price_diff_id_tbl(i)
3149: AND p_price_diffs.error_flag_tbl(i) = FND_API.g_FALSE;
3150:
3151: IF (PO_LOG.d_proc) THEN
3152: PO_LOG.proc_end (d_module);
3153: END IF;
3154:
3155: EXCEPTION
3148: WHERE price_diff_interface_id = p_price_diffs.intf_price_diff_id_tbl(i)
3149: AND p_price_diffs.error_flag_tbl(i) = FND_API.g_FALSE;
3150:
3151: IF (PO_LOG.d_proc) THEN
3152: PO_LOG.proc_end (d_module);
3153: END IF;
3154:
3155: EXCEPTION
3156: WHEN OTHERS THEN
3193:
3194: BEGIN
3195: d_position := 0;
3196:
3197: IF (PO_LOG.d_proc) THEN
3198: PO_LOG.proc_begin(d_module);
3199: END IF;
3200:
3201: MERGE INTO po_attribute_values_draft PAVD
3194: BEGIN
3195: d_position := 0;
3196:
3197: IF (PO_LOG.d_proc) THEN
3198: PO_LOG.proc_begin(d_module);
3199: END IF;
3200:
3201: MERGE INTO po_attribute_values_draft PAVD
3202: USING (
4520: NVL(PAVI.PROGRAM_ID, FND_GLOBAL.conc_program_id),
4521: NVL(PAVI.PROGRAM_UPDATE_DATE, sysdate),
4522: DECODE(PAVI.PICTURE, PO_PDOI_CONSTANTS.g_NULLIFY_VARCHAR, NULL, PAVI.PICTURE));
4523:
4524: IF (PO_LOG.d_proc) THEN
4525: PO_LOG.proc_end (d_module);
4526: END IF;
4527:
4528: EXCEPTION
4521: NVL(PAVI.PROGRAM_UPDATE_DATE, sysdate),
4522: DECODE(PAVI.PICTURE, PO_PDOI_CONSTANTS.g_NULLIFY_VARCHAR, NULL, PAVI.PICTURE));
4523:
4524: IF (PO_LOG.d_proc) THEN
4525: PO_LOG.proc_end (d_module);
4526: END IF;
4527:
4528: EXCEPTION
4529: WHEN OTHERS THEN
4566:
4567: BEGIN
4568: d_position := 0;
4569:
4570: IF (PO_LOG.d_proc) THEN
4571: PO_LOG.proc_begin(d_module);
4572: END IF;
4573:
4574: MERGE INTO po_attribute_values_tlp_draft PAVTD
4567: BEGIN
4568: d_position := 0;
4569:
4570: IF (PO_LOG.d_proc) THEN
4571: PO_LOG.proc_begin(d_module);
4572: END IF;
4573:
4574: MERGE INTO po_attribute_values_tlp_draft PAVTD
4575: USING (
5281: NVL(PAVTI.PROGRAM_APPLICATION_ID, FND_GLOBAL.prog_appl_id),
5282: NVL(PAVTI.PROGRAM_ID, FND_GLOBAL.conc_program_id),
5283: NVL(PAVTI.PROGRAM_UPDATE_DATE, sysdate));
5284:
5285: IF (PO_LOG.d_proc) THEN
5286: PO_LOG.proc_end (d_module);
5287: END IF;
5288:
5289: EXCEPTION
5282: NVL(PAVTI.PROGRAM_ID, FND_GLOBAL.conc_program_id),
5283: NVL(PAVTI.PROGRAM_UPDATE_DATE, sysdate));
5284:
5285: IF (PO_LOG.d_proc) THEN
5286: PO_LOG.proc_end (d_module);
5287: END IF;
5288:
5289: EXCEPTION
5290: WHEN OTHERS THEN
5335: l_record_already_exist_tbl PO_TBL_VARCHAR1 := PO_TBL_VARCHAR1();
5336: BEGIN
5337: d_position := 0;
5338:
5339: IF (PO_LOG.d_proc) THEN
5340: PO_LOG.proc_begin(d_module, 'p_po_line_id_tbl', p_po_line_id_tbl);
5341: PO_LOG.proc_begin(d_module, 'p_draft_id_tbl', p_draft_id_tbl);
5342: END IF;
5343:
5336: BEGIN
5337: d_position := 0;
5338:
5339: IF (PO_LOG.d_proc) THEN
5340: PO_LOG.proc_begin(d_module, 'p_po_line_id_tbl', p_po_line_id_tbl);
5341: PO_LOG.proc_begin(d_module, 'p_draft_id_tbl', p_draft_id_tbl);
5342: END IF;
5343:
5344: l_key := PO_CORE_S.get_session_gt_nextval;
5337: d_position := 0;
5338:
5339: IF (PO_LOG.d_proc) THEN
5340: PO_LOG.proc_begin(d_module, 'p_po_line_id_tbl', p_po_line_id_tbl);
5341: PO_LOG.proc_begin(d_module, 'p_draft_id_tbl', p_draft_id_tbl);
5342: END IF;
5343:
5344: l_key := PO_CORE_S.get_session_gt_nextval;
5345:
5596: PROGRAM_UPDATE_DATE = sysdate
5597: WHERE attribute_values_tlp_id = l_sync_attr_values_tlp_id_tbl(i)
5598: AND draft_id = l_draft_id_tbl(i);
5599:
5600: IF (PO_LOG.d_proc) THEN
5601: PO_LOG.proc_end (d_module);
5602: END IF;
5603:
5604: EXCEPTION
5597: WHERE attribute_values_tlp_id = l_sync_attr_values_tlp_id_tbl(i)
5598: AND draft_id = l_draft_id_tbl(i);
5599:
5600: IF (PO_LOG.d_proc) THEN
5601: PO_LOG.proc_end (d_module);
5602: END IF;
5603:
5604: EXCEPTION
5605: WHEN OTHERS THEN