1: PACKAGE BODY PO_PDOI_PREPROC_PVT AS
2: /* $Header: PO_PDOI_PREPROC_PVT.plb 120.26.12020000.3 2013/02/10 19:27:48 vegajula ship $ */
3:
4: d_pkg_name CONSTANT varchar2(50) :=
5: PO_LOG.get_package_base('PO_PDOI_PREPROC_PVT');
6:
7: -------------------------------------------------------
8: ----------- PRIVATE PROCEDURES PROTOTYPE --------------
9: -------------------------------------------------------
107: BEGIN
108:
109: d_position := 0;
110:
111: IF (PO_LOG.d_proc) THEN
112: PO_LOG.proc_begin (d_module);
113: END IF;
114:
115: PO_TIMING_UTL.start_time (PO_PDOI_CONSTANTS.g_T_PREPROCESSING);
108:
109: d_position := 0;
110:
111: IF (PO_LOG.d_proc) THEN
112: PO_LOG.proc_begin (d_module);
113: END IF;
114:
115: PO_TIMING_UTL.start_time (PO_PDOI_CONSTANTS.g_T_PREPROCESSING);
116:
166: PO_PDOI_UTL.commit_work;
167:
168: PO_TIMING_UTL.stop_time (PO_PDOI_CONSTANTS.g_T_PREPROCESSING);
169:
170: IF (PO_LOG.d_proc) THEN
171: PO_LOG.proc_end (d_module);
172: END IF;
173:
174: EXCEPTION
167:
168: PO_TIMING_UTL.stop_time (PO_PDOI_CONSTANTS.g_T_PREPROCESSING);
169:
170: IF (PO_LOG.d_proc) THEN
171: PO_LOG.proc_end (d_module);
172: END IF;
173:
174: EXCEPTION
175: WHEN OTHERS THEN
219:
220: BEGIN
221: d_position := 0;
222:
223: IF (PO_LOG.d_proc) THEN
224: PO_LOG.proc_begin (d_module);
225: END IF;
226:
227: IF (PO_PDOI_PARAMS.g_request.interface_header_id IS NOT NULL) THEN
220: BEGIN
221: d_position := 0;
222:
223: IF (PO_LOG.d_proc) THEN
224: PO_LOG.proc_begin (d_module);
225: END IF;
226:
227: IF (PO_PDOI_PARAMS.g_request.interface_header_id IS NOT NULL) THEN
228:
241: AND NVL(process_code, PO_PDOI_CONSTANTS.g_process_code_PENDING) =
242: PO_PDOI_CONSTANTS.g_process_code_NOTIFIED
243: ORDER BY po_line_id, interface_line_id;
244:
245: IF (PO_LOG.d_stmt) THEN
246: PO_LOG.stmt(d_module, d_position, 'number of lines with notified status ',
247: l_intf_line_id_tbl.COUNT);
248: END IF;
249:
242: PO_PDOI_CONSTANTS.g_process_code_NOTIFIED
243: ORDER BY po_line_id, interface_line_id;
244:
245: IF (PO_LOG.d_stmt) THEN
246: PO_LOG.stmt(d_module, d_position, 'number of lines with notified status ',
247: l_intf_line_id_tbl.COUNT);
248: END IF;
249:
250: d_position := 10;
249:
250: d_position := 10;
251:
252: FOR i IN 1..l_intf_line_id_tbl.COUNT LOOP
253: IF (PO_LOG.d_stmt) THEN
254: PO_LOG.stmt(d_module, d_position, 'i = ' || i || ', intf_line_id = ' ||
255: l_intf_line_id_tbl(i) || ' change accept flag = ' ||
256: l_price_chg_accept_flag_tbl(i));
257: END IF;
250: d_position := 10;
251:
252: FOR i IN 1..l_intf_line_id_tbl.COUNT LOOP
253: IF (PO_LOG.d_stmt) THEN
254: PO_LOG.stmt(d_module, d_position, 'i = ' || i || ', intf_line_id = ' ||
255: l_intf_line_id_tbl(i) || ' change accept flag = ' ||
256: l_price_chg_accept_flag_tbl(i));
257: END IF;
258:
295: AND NVL(lines.process_code, PO_PDOI_CONSTANTS.g_process_code_PENDING) =
296: PO_PDOI_CONSTANTS.g_process_code_NOTIFIED
297: AND lines.parent_interface_line_id IS NOT NULL;
298:
299: IF (PO_LOG.d_stmt) THEN
300: PO_LOG.stmt(d_module, d_position, '# of lines updated based on parent_intf_line_id',
301: SQL%ROWCOUNT);
302: END IF;
303:
296: PO_PDOI_CONSTANTS.g_process_code_NOTIFIED
297: AND lines.parent_interface_line_id IS NOT NULL;
298:
299: IF (PO_LOG.d_stmt) THEN
300: PO_LOG.stmt(d_module, d_position, '# of lines updated based on parent_intf_line_id',
301: SQL%ROWCOUNT);
302: END IF;
303:
304: d_position := 40;
312:
313: d_position := 30;
314: END IF;
315:
316: IF (PO_LOG.d_proc) THEN
317: PO_LOG.proc_end (d_module);
318: END IF;
319:
320: EXCEPTION
313: d_position := 30;
314: END IF;
315:
316: IF (PO_LOG.d_proc) THEN
317: PO_LOG.proc_end (d_module);
318: END IF;
319:
320: EXCEPTION
321: WHEN OTHERS THEN
400: l_intf_line_id_tbl PO_TBL_NUMBER := PO_TBL_NUMBER();
401: BEGIN
402: d_position := 0;
403:
404: IF (PO_LOG.d_proc) THEN
405: PO_LOG.proc_begin (d_module);
406: END IF;
407:
408: --
401: BEGIN
402: d_position := 0;
403:
404: IF (PO_LOG.d_proc) THEN
405: PO_LOG.proc_begin (d_module);
406: END IF;
407:
408: --
409: -- ECO 4420269
415: SET PHI.org_id = PO_PDOI_PARAMS.g_request.org_id
416: WHERE PHI.batch_id = PO_PDOI_PARAMS.g_request.batch_id
417: AND PHI.org_id IS NULL;
418:
419: IF (PO_LOG.d_stmt) THEN
420: PO_LOG.stmt(d_module, d_position, 'updatec org id for ' ||
421: SQL%ROWCOUNT || ' records.');
422: END IF;
423: END IF;
416: WHERE PHI.batch_id = PO_PDOI_PARAMS.g_request.batch_id
417: AND PHI.org_id IS NULL;
418:
419: IF (PO_LOG.d_stmt) THEN
420: PO_LOG.stmt(d_module, d_position, 'updatec org id for ' ||
421: SQL%ROWCOUNT || ' records.');
422: END IF;
423: END IF;
424:
455: approval_status = NVL(approval_status,
456: PO_PDOI_PARAMS.g_request.approved_status)
457: WHERE interface_header_id = l_intf_header_id_tbl(i);
458:
459: IF (PO_LOG.d_stmt) THEN
460: PO_LOG.stmt(d_module, d_position, 'after header assignment. Updated ' ||
461: SQL%ROWCOUNT || ' records');
462: END IF;
463:
456: PO_PDOI_PARAMS.g_request.approved_status)
457: WHERE interface_header_id = l_intf_header_id_tbl(i);
458:
459: IF (PO_LOG.d_stmt) THEN
460: PO_LOG.stmt(d_module, d_position, 'after header assignment. Updated ' ||
461: SQL%ROWCOUNT || ' records');
462: END IF;
463:
464: d_position := 40;
491: RETURNING interface_line_id
492: BULK COLLECT INTO l_intf_line_id_tbl;
493:
494:
495: IF (PO_LOG.d_stmt) THEN
496: PO_LOG.stmt(d_module, d_position, 'after line assignment. Updated ' ||
497: SQL%ROWCOUNT || ' records');
498: END IF;
499:
492: BULK COLLECT INTO l_intf_line_id_tbl;
493:
494:
495: IF (PO_LOG.d_stmt) THEN
496: PO_LOG.stmt(d_module, d_position, 'after line assignment. Updated ' ||
497: SQL%ROWCOUNT || ' records');
498: END IF;
499:
500: d_position := 50;
502: UPDATE po_line_locations_interface
503: SET processing_id = PO_PDOI_PARAMS.g_processing_id
504: WHERE interface_line_id = l_intf_line_id_tbl(i);
505:
506: IF (PO_LOG.d_stmt) THEN
507: PO_LOG.stmt(d_module, d_position, 'after line location assignment. ' ||
508: ' Updated ' || SQL%ROWCOUNT || ' records');
509: END IF;
510:
503: SET processing_id = PO_PDOI_PARAMS.g_processing_id
504: WHERE interface_line_id = l_intf_line_id_tbl(i);
505:
506: IF (PO_LOG.d_stmt) THEN
507: PO_LOG.stmt(d_module, d_position, 'after line location assignment. ' ||
508: ' Updated ' || SQL%ROWCOUNT || ' records');
509: END IF;
510:
511: d_position := 60;
513: UPDATE po_price_diff_interface
514: SET processing_id = PO_PDOI_PARAMS.g_processing_id
515: WHERE interface_line_id = l_intf_line_id_tbl(i);
516:
517: IF (PO_LOG.d_stmt) THEN
518: PO_LOG.stmt(d_module, d_position, 'after price diff assignment. ' ||
519: 'Updated ' || SQL%ROWCOUNT || ' records');
520: END IF;
521:
514: SET processing_id = PO_PDOI_PARAMS.g_processing_id
515: WHERE interface_line_id = l_intf_line_id_tbl(i);
516:
517: IF (PO_LOG.d_stmt) THEN
518: PO_LOG.stmt(d_module, d_position, 'after price diff assignment. ' ||
519: 'Updated ' || SQL%ROWCOUNT || ' records');
520: END IF;
521:
522: d_position := 70;
526: UPDATE po_distributions_interface
527: SET processing_id = PO_PDOI_PARAMS.g_processing_id
528: WHERE interface_line_id = l_intf_line_id_tbl(i);
529:
530: IF (PO_LOG.d_stmt) THEN
531: PO_LOG.stmt(d_module, d_position, 'after distirbution assignment. ' ||
532: 'Updated ' || SQL%ROWCOUNT || ' records');
533: END IF;
534: END IF;
527: SET processing_id = PO_PDOI_PARAMS.g_processing_id
528: WHERE interface_line_id = l_intf_line_id_tbl(i);
529:
530: IF (PO_LOG.d_stmt) THEN
531: PO_LOG.stmt(d_module, d_position, 'after distirbution assignment. ' ||
532: 'Updated ' || SQL%ROWCOUNT || ' records');
533: END IF;
534: END IF;
535:
542: UPDATE po_attr_values_interface
543: SET processing_id = PO_PDOI_PARAMS.g_processing_id
544: WHERE interface_line_id = l_intf_line_id_tbl(i);
545:
546: IF (PO_LOG.d_stmt) THEN
547: PO_LOG.stmt(d_module, d_position, 'after attr value assignment. ' ||
548: 'Updated ' || SQL%ROWCOUNT || ' records');
549: END IF;
550:
543: SET processing_id = PO_PDOI_PARAMS.g_processing_id
544: WHERE interface_line_id = l_intf_line_id_tbl(i);
545:
546: IF (PO_LOG.d_stmt) THEN
547: PO_LOG.stmt(d_module, d_position, 'after attr value assignment. ' ||
548: 'Updated ' || SQL%ROWCOUNT || ' records');
549: END IF;
550:
551: d_position := 100;
553: UPDATE po_attr_values_tlp_interface
554: SET processing_id = PO_PDOI_PARAMS.g_processing_id
555: WHERE interface_line_id = l_intf_line_id_tbl(i);
556:
557: IF (PO_LOG.d_stmt) THEN
558: PO_LOG.stmt(d_module, d_position, 'after attr values tlp assignment.' ||
559: ' Updated ' || SQL%ROWCOUNT || ' records');
560: END IF;
561: END IF;
554: SET processing_id = PO_PDOI_PARAMS.g_processing_id
555: WHERE interface_line_id = l_intf_line_id_tbl(i);
556:
557: IF (PO_LOG.d_stmt) THEN
558: PO_LOG.stmt(d_module, d_position, 'after attr values tlp assignment.' ||
559: ' Updated ' || SQL%ROWCOUNT || ' records');
560: END IF;
561: END IF;
562:
565: END LOOP;
566:
567: CLOSE c_interface_headers;
568:
569: IF (PO_LOG.d_proc) THEN
570: PO_LOG.proc_end (d_module);
571: END IF;
572:
573: EXCEPTION
566:
567: CLOSE c_interface_headers;
568:
569: IF (PO_LOG.d_proc) THEN
570: PO_LOG.proc_end (d_module);
571: END IF;
572:
573: EXCEPTION
574: WHEN OTHERS THEN
618:
619: BEGIN
620: d_position := 0;
621:
622: IF (PO_LOG.d_proc) THEN
623: PO_LOG.proc_begin (d_module, '# of records to eval', x_intf_header_id_tbl.COUNT);
624: END IF;
625:
626: FOR i IN 1..x_intf_header_id_tbl.COUNT LOOP
619: BEGIN
620: d_position := 0;
621:
622: IF (PO_LOG.d_proc) THEN
623: PO_LOG.proc_begin (d_module, '# of records to eval', x_intf_header_id_tbl.COUNT);
624: END IF;
625:
626: FOR i IN 1..x_intf_header_id_tbl.COUNT LOOP
627: d_position := 10;
649:
650: -- return the list with records that are still being processed filtered.
651: x_intf_header_id_tbl := l_tmp_intf_tbl;
652:
653: IF (PO_LOG.d_proc) THEN
654: PO_LOG.proc_end (d_module, '# of processable rec', x_intf_header_id_tbl.COUNT);
655: END IF;
656:
657: EXCEPTION
650: -- return the list with records that are still being processed filtered.
651: x_intf_header_id_tbl := l_tmp_intf_tbl;
652:
653: IF (PO_LOG.d_proc) THEN
654: PO_LOG.proc_end (d_module, '# of processable rec', x_intf_header_id_tbl.COUNT);
655: END IF;
656:
657: EXCEPTION
658: WHEN OTHERS THEN
690: BEGIN
691:
692: d_position := 0;
693:
694: IF (PO_LOG.d_proc) THEN
695: PO_LOG.proc_begin (d_module);
696: END IF;
697:
698: -- Check action code
691:
692: d_position := 0;
693:
694: IF (PO_LOG.d_proc) THEN
695: PO_LOG.proc_begin (d_module);
696: END IF;
697:
698: -- Check action code
699: SELECT interface_header_id, action
717: PO_PDOI_CONSTANTS.g_ACTION_UPDATE)));
718:
719: d_position := 10;
720:
721: IF (PO_LOG.d_stmt) THEN
722: PO_LOG.stmt(d_module, d_position, '# of records to reject:',
723: l_reject_tbl.COUNT);
724: END IF;
725:
718:
719: d_position := 10;
720:
721: IF (PO_LOG.d_stmt) THEN
722: PO_LOG.stmt(d_module, d_position, '# of records to reject:',
723: l_reject_tbl.COUNT);
724: END IF;
725:
726: FOR i IN 1..l_reject_tbl.COUNT LOOP
749: ( p_id_param_type => PO_PDOI_CONSTANTS.g_INTERFACE_HEADER_ID,
750: p_id_tbl => l_reject_tbl,
751: p_cascade => FND_API.G_TRUE);
752:
753: IF (PO_LOG.d_proc) THEN
754: PO_LOG.proc_end (d_module);
755: END IF;
756:
757: EXCEPTION
750: p_id_tbl => l_reject_tbl,
751: p_cascade => FND_API.G_TRUE);
752:
753: IF (PO_LOG.d_proc) THEN
754: PO_LOG.proc_end (d_module);
755: END IF;
756:
757: EXCEPTION
758: WHEN OTHERS THEN
801:
802: BEGIN
803: d_position := 0;
804:
805: IF (PO_LOG.d_proc) THEN
806: PO_LOG.proc_begin (d_module);
807: END IF;
808:
809: l_key := PO_CORE_S.get_session_gt_nextval;
802: BEGIN
803: d_position := 0;
804:
805: IF (PO_LOG.d_proc) THEN
806: PO_LOG.proc_begin (d_module);
807: END IF;
808:
809: l_key := PO_CORE_S.get_session_gt_nextval;
810:
912: p_id_tbl => l_reject_list,
913: p_cascade => FND_API.G_TRUE
914: );
915:
916: IF (PO_LOG.d_proc) THEN
917: PO_LOG.proc_end (d_module);
918: END IF;
919:
920: EXCEPTION
913: p_cascade => FND_API.G_TRUE
914: );
915:
916: IF (PO_LOG.d_proc) THEN
917: PO_LOG.proc_end (d_module);
918: END IF;
919:
920: EXCEPTION
921: WHEN OTHERS THEN
970: l_reject_list PO_TBL_NUMBER := PO_TBL_NUMBER();
971: BEGIN
972: d_position := 0;
973:
974: IF (PO_LOG.d_proc) THEN
975: PO_LOG.proc_begin (d_module);
976: END IF;
977:
978: -- For update and replace action, make sure that the document exists
971: BEGIN
972: d_position := 0;
973:
974: IF (PO_LOG.d_proc) THEN
975: PO_LOG.proc_begin (d_module);
976: END IF;
977:
978: -- For update and replace action, make sure that the document exists
979:
996: d_position := 20;
997: FOR i IN 1..l_interface_header_id_tbl.COUNT LOOP
998: l_valid := FND_API.G_TRUE;
999:
1000: IF (PO_LOG.d_stmt) THEN
1001: PO_LOG.stmt(d_module, d_position, 'checking for ' ||
1002: l_interface_header_id_tbl(i));
1003: END IF;
1004:
997: FOR i IN 1..l_interface_header_id_tbl.COUNT LOOP
998: l_valid := FND_API.G_TRUE;
999:
1000: IF (PO_LOG.d_stmt) THEN
1001: PO_LOG.stmt(d_module, d_position, 'checking for ' ||
1002: l_interface_header_id_tbl(i));
1003: END IF;
1004:
1005: -- start date has to be provided for replace
1135:
1136: IF (l_index_for_replacement IS NOT NULL) THEN
1137: d_position := 110;
1138:
1139: IF (PO_LOG.d_stmt) THEN
1140: PO_LOG.stmt(d_module, d_position, 'Found doc for replacement: ' ||
1141: l_orig_po_header_id_tbl(l_index_for_replacement));
1142: END IF;
1143:
1136: IF (l_index_for_replacement IS NOT NULL) THEN
1137: d_position := 110;
1138:
1139: IF (PO_LOG.d_stmt) THEN
1140: PO_LOG.stmt(d_module, d_position, 'Found doc for replacement: ' ||
1141: l_orig_po_header_id_tbl(l_index_for_replacement));
1142: END IF;
1143:
1144: -- For blanket, make sure that all releases should not have release
1161:
1162: IF (l_valid = FND_API.G_TRUE) THEN
1163: d_position := 130;
1164:
1165: IF (PO_LOG.d_stmt) THEN
1166: PO_LOG.stmt(d_module, d_position, 'Release date check passed');
1167: END IF;
1168:
1169: l_final_intf_header_id_tbl.extend;
1162: IF (l_valid = FND_API.G_TRUE) THEN
1163: d_position := 130;
1164:
1165: IF (PO_LOG.d_stmt) THEN
1166: PO_LOG.stmt(d_module, d_position, 'Release date check passed');
1167: END IF;
1168:
1169: l_final_intf_header_id_tbl.extend;
1170: l_final_intf_header_id_tbl(l_final_intf_header_id_tbl.COUNT) :=
1195: p_id_tbl => l_reject_list,
1196: p_cascade => FND_API.G_TRUE
1197: );
1198:
1199: IF (PO_LOG.d_proc) THEN
1200: PO_LOG.proc_end (d_module);
1201: END IF;
1202:
1203: EXCEPTION
1196: p_cascade => FND_API.G_TRUE
1197: );
1198:
1199: IF (PO_LOG.d_proc) THEN
1200: PO_LOG.proc_end (d_module);
1201: END IF;
1202:
1203: EXCEPTION
1204: WHEN OTHERS THEN
1250:
1251: BEGIN
1252: d_position := 0;
1253:
1254: IF (PO_LOG.d_proc) THEN
1255: PO_LOG.proc_begin (d_module);
1256: END IF;
1257:
1258: -- if we are expiring a blanket, make sure that none of the releases falls
1251: BEGIN
1252: d_position := 0;
1253:
1254: IF (PO_LOG.d_proc) THEN
1255: PO_LOG.proc_begin (d_module);
1256: END IF;
1257:
1258: -- if we are expiring a blanket, make sure that none of the releases falls
1259: -- outside of the effective dates of the blanket being expired
1305: x_valid := FND_API.G_FALSE;
1306: END IF;
1307: END IF;
1308:
1309: IF (PO_LOG.d_proc) THEN
1310: PO_LOG.proc_end (d_module);
1311: END IF;
1312:
1313: EXCEPTION
1306: END IF;
1307: END IF;
1308:
1309: IF (PO_LOG.d_proc) THEN
1310: PO_LOG.proc_end (d_module);
1311: END IF;
1312:
1313: EXCEPTION
1314: WHEN OTHERS THEN
1377: l_reject_list PO_TBL_NUMBER := PO_TBL_NUMBER();
1378: BEGIN
1379: d_position := 0;
1380:
1381: IF (PO_LOG.d_proc) THEN
1382: PO_LOG.proc_begin (d_module);
1383: END IF;
1384:
1385: SELECT interface_header_id,
1378: BEGIN
1379: d_position := 0;
1380:
1381: IF (PO_LOG.d_proc) THEN
1382: PO_LOG.proc_begin (d_module);
1383: END IF;
1384:
1385: SELECT interface_header_id,
1386: vendor_id,
1415:
1416: FOR i IN 1..l_interface_header_id_tbl.COUNT LOOP
1417: l_valid := FND_API.g_TRUE;
1418:
1419: IF (PO_LOG.d_stmt) THEN
1420: PO_LOG.stmt(d_module, d_position, 'checking for ' ||
1421: l_interface_header_id_tbl(i));
1422: END IF;
1423:
1416: FOR i IN 1..l_interface_header_id_tbl.COUNT LOOP
1417: l_valid := FND_API.g_TRUE;
1418:
1419: IF (PO_LOG.d_stmt) THEN
1420: PO_LOG.stmt(d_module, d_position, 'checking for ' ||
1421: l_interface_header_id_tbl(i));
1422: END IF;
1423:
1424: IF (l_po_header_id_tbl(i) IS NOT NULL) THEN
1423:
1424: IF (l_po_header_id_tbl(i) IS NOT NULL) THEN
1425: d_position := 20;
1426:
1427: IF (PO_LOG.d_stmt) THEN
1428: PO_LOG.stmt(d_module, d_position, 'po_header_id ' ||
1429: l_po_header_id_tbl(i) || 'is provided');
1430: END IF;
1431:
1424: IF (l_po_header_id_tbl(i) IS NOT NULL) THEN
1425: d_position := 20;
1426:
1427: IF (PO_LOG.d_stmt) THEN
1428: PO_LOG.stmt(d_module, d_position, 'po_header_id ' ||
1429: l_po_header_id_tbl(i) || 'is provided');
1430: END IF;
1431:
1432: -- Make sure that the po_header_id is still valid
1440: AND POH.type_lookup_code = PO_PDOI_PARAMS.g_request.document_type;
1441:
1442: IF (l_existing_header = 'N' OR l_consigned_consumption_flag = 'Y') THEN
1443:
1444: IF (PO_LOG.d_stmt) THEN
1445: PO_LOG.stmt(d_module, d_position, 'po header id does not exist or' ||
1446: ' document type does not match');
1447: END IF;
1448:
1441:
1442: IF (l_existing_header = 'N' OR l_consigned_consumption_flag = 'Y') THEN
1443:
1444: IF (PO_LOG.d_stmt) THEN
1445: PO_LOG.stmt(d_module, d_position, 'po header id does not exist or' ||
1446: ' document type does not match');
1447: END IF;
1448:
1449: l_valid := FND_API.g_FALSE;
1523:
1524: ELSE -- po_header_id is not provided
1525: d_position := 80;
1526:
1527: IF (PO_LOG.d_stmt) THEN
1528: PO_LOG.stmt(d_module, d_position, 'po_header_id is not provided. ' ||
1529: 'vendor doc num = ' || l_vendor_doc_num_tbl(i) ||
1530: ', document_num = ' || l_document_num_tbl(i));
1531: END IF;
1524: ELSE -- po_header_id is not provided
1525: d_position := 80;
1526:
1527: IF (PO_LOG.d_stmt) THEN
1528: PO_LOG.stmt(d_module, d_position, 'po_header_id is not provided. ' ||
1529: 'vendor doc num = ' || l_vendor_doc_num_tbl(i) ||
1530: ', document_num = ' || l_document_num_tbl(i));
1531: END IF;
1532:
1771: p_id_tbl => l_reject_list,
1772: p_cascade => FND_API.G_TRUE
1773: );
1774:
1775: IF (PO_LOG.d_proc) THEN
1776: PO_LOG.proc_end (d_module);
1777: END IF;
1778:
1779: EXCEPTION
1772: p_cascade => FND_API.G_TRUE
1773: );
1774:
1775: IF (PO_LOG.d_proc) THEN
1776: PO_LOG.proc_end (d_module);
1777: END IF;
1778:
1779: EXCEPTION
1780: WHEN OTHERS THEN
1811: l_vendor_doc_num_tbl PO_TBL_VARCHAR25 := PO_TBL_VARCHAR25();
1812: BEGIN
1813: d_position := 0;
1814:
1815: IF (PO_LOG.d_proc) THEN
1816: PO_LOG.proc_begin (d_module);
1817: END IF;
1818:
1819: IF (PO_PDOI_PARAMS.g_request.document_type =
1812: BEGIN
1813: d_position := 0;
1814:
1815: IF (PO_LOG.d_proc) THEN
1816: PO_LOG.proc_begin (d_module);
1817: END IF;
1818:
1819: IF (PO_PDOI_PARAMS.g_request.document_type =
1820: PO_PDOI_CONSTANTS.g_DOC_TYPE_QUOTATION) THEN
1889: p_id_tbl => l_reject_list,
1890: p_cascade => FND_API.G_TRUE
1891: );
1892:
1893: IF (PO_LOG.d_proc) THEN
1894: PO_LOG.proc_end (d_module);
1895: END IF;
1896: EXCEPTION
1897: WHEN OTHERS THEN
1890: p_cascade => FND_API.G_TRUE
1891: );
1892:
1893: IF (PO_LOG.d_proc) THEN
1894: PO_LOG.proc_end (d_module);
1895: END IF;
1896: EXCEPTION
1897: WHEN OTHERS THEN
1898: PO_MESSAGE_S.add_exc_msg
1925: BEGIN
1926:
1927: d_position := 0;
1928:
1929: IF (PO_LOG.d_proc) THEN
1930: PO_LOG.proc_begin (d_module);
1931: END IF;
1932:
1933: -- For ORIGINAL, ADD or REPLACE action, new document will be created
1926:
1927: d_position := 0;
1928:
1929: IF (PO_LOG.d_proc) THEN
1930: PO_LOG.proc_begin (d_module);
1931: END IF;
1932:
1933: -- For ORIGINAL, ADD or REPLACE action, new document will be created
1934: -- Need to assign a new po_header_id
1939: AND action IN (PO_PDOI_CONSTANTS.g_ACTION_ORIGINAL,
1940: PO_PDOI_CONSTANTS.g_ACTION_ADD,
1941: PO_PDOI_CONSTANTS.g_ACTION_REPLACE);
1942:
1943: IF (PO_LOG.d_proc) THEN
1944: PO_LOG.proc_end (d_module);
1945: END IF;
1946:
1947: EXCEPTION
1940: PO_PDOI_CONSTANTS.g_ACTION_ADD,
1941: PO_PDOI_CONSTANTS.g_ACTION_REPLACE);
1942:
1943: IF (PO_LOG.d_proc) THEN
1944: PO_LOG.proc_end (d_module);
1945: END IF;
1946:
1947: EXCEPTION
1948: WHEN OTHERS THEN
2010: -- << PDOI for Complex PO Project: End >>
2011: BEGIN
2012: d_position := 0;
2013:
2014: IF (PO_LOG.d_proc) THEN
2015: PO_LOG.proc_begin (d_module);
2016: END IF;
2017:
2018: OPEN c_line_intf;
2011: BEGIN
2012: d_position := 0;
2013:
2014: IF (PO_LOG.d_proc) THEN
2015: PO_LOG.proc_begin (d_module);
2016: END IF;
2017:
2018: OPEN c_line_intf;
2019:
2026: d_position := 10;
2027:
2028: EXIT WHEN l_rowid_tbl.COUNT = 0;
2029:
2030: IF (PO_LOG.d_stmt) THEN
2031: PO_LOG.stmt(d_module, d_position, 'number of lines fetched: ' ||
2032: l_rowid_tbl.COUNT);
2033: END IF;
2034:
2027:
2028: EXIT WHEN l_rowid_tbl.COUNT = 0;
2029:
2030: IF (PO_LOG.d_stmt) THEN
2031: PO_LOG.stmt(d_module, d_position, 'number of lines fetched: ' ||
2032: l_rowid_tbl.COUNT);
2033: END IF;
2034:
2035: FOR i IN 1..l_rowid_tbl.COUNT LOOP -- PDOI for Complex PO Project
2243: FROM po_lines_interface PLI
2244: WHERE PLI.rowid = l_rowid_tbl(i));
2245: END IF;
2246:
2247: IF (PO_LOG.d_stmt) THEN
2248: PO_LOG.stmt(d_module, d_position, 'creating Pay items for Interface Line Id: ' ||
2249: l_rowid_tbl(i));
2250: END IF;
2251:
2244: WHERE PLI.rowid = l_rowid_tbl(i));
2245: END IF;
2246:
2247: IF (PO_LOG.d_stmt) THEN
2248: PO_LOG.stmt(d_module, d_position, 'creating Pay items for Interface Line Id: ' ||
2249: l_rowid_tbl(i));
2250: END IF;
2251:
2252: populate_payitems(p_interface_line_id => l_interface_line_id,
2380: SET line_loc_populated_flag = 'S'
2381: WHERE processing_id = PO_PDOI_PARAMS.g_processing_id
2382: AND NVL(line_loc_populated_flag, 'N') = 'N';
2383:
2384: IF (PO_LOG.d_proc) THEN
2385: PO_LOG.proc_end (d_module);
2386: END IF;
2387:
2388: EXCEPTION
2381: WHERE processing_id = PO_PDOI_PARAMS.g_processing_id
2382: AND NVL(line_loc_populated_flag, 'N') = 'N';
2383:
2384: IF (PO_LOG.d_proc) THEN
2385: PO_LOG.proc_end (d_module);
2386: END IF;
2387:
2388: EXCEPTION
2389: WHEN OTHERS THEN
2433:
2434: BEGIN
2435: d_position := 0;
2436:
2437: IF (PO_LOG.d_proc) THEN
2438: PO_LOG.proc_begin (d_module);
2439: END IF;
2440:
2441: PO_COMPLEX_WORK_PVT.get_payment_style_settings(
2434: BEGIN
2435: d_position := 0;
2436:
2437: IF (PO_LOG.d_proc) THEN
2438: PO_LOG.proc_begin (d_module);
2439: END IF;
2440:
2441: PO_COMPLEX_WORK_PVT.get_payment_style_settings(
2442: p_style_id => p_style_id
2456: IF l_financing_payments_flag = 'Y' THEN
2457: populate_progress_payitem(p_interface_line_id => p_interface_line_id);
2458: END IF;
2459:
2460: IF (PO_LOG.d_proc) THEN
2461: PO_LOG.proc_end (d_module);
2462: END IF;
2463:
2464: EXCEPTION
2457: populate_progress_payitem(p_interface_line_id => p_interface_line_id);
2458: END IF;
2459:
2460: IF (PO_LOG.d_proc) THEN
2461: PO_LOG.proc_end (d_module);
2462: END IF;
2463:
2464: EXCEPTION
2465: WHEN OTHERS THEN
2498:
2499: BEGIN
2500: d_position := 0;
2501:
2502: IF (PO_LOG.d_proc) THEN
2503: PO_LOG.proc_begin (d_module);
2504: END IF;
2505:
2506: INSERT INTO po_line_locations_interface
2499: BEGIN
2500: d_position := 0;
2501:
2502: IF (PO_LOG.d_proc) THEN
2503: PO_LOG.proc_begin (d_module);
2504: END IF;
2505:
2506: INSERT INTO po_line_locations_interface
2507: (
2680: populate_advance_payitem_dist
2681: (p_interface_line_location_id => l_interface_line_location_id);
2682: END IF;
2683:
2684: IF (PO_LOG.d_proc) THEN
2685: PO_LOG.proc_end (d_module);
2686: END IF;
2687:
2688: EXCEPTION
2681: (p_interface_line_location_id => l_interface_line_location_id);
2682: END IF;
2683:
2684: IF (PO_LOG.d_proc) THEN
2685: PO_LOG.proc_end (d_module);
2686: END IF;
2687:
2688: EXCEPTION
2689: WHEN OTHERS THEN
2721:
2722: BEGIN
2723: d_position := 0;
2724:
2725: IF (PO_LOG.d_proc) THEN
2726: PO_LOG.proc_begin (d_module);
2727: END IF;
2728:
2729: INSERT INTO po_distributions_interface
2722: BEGIN
2723: d_position := 0;
2724:
2725: IF (PO_LOG.d_proc) THEN
2726: PO_LOG.proc_begin (d_module);
2727: END IF;
2728:
2729: INSERT INTO po_distributions_interface
2730: (
2773: PLL.program_update_date
2774: FROM po_line_locations_interface PLL
2775: WHERE PLL.interface_line_location_id = p_interface_line_location_id;
2776:
2777: IF (PO_LOG.d_proc) THEN
2778: PO_LOG.proc_end (d_module);
2779: END IF;
2780:
2781: EXCEPTION
2774: FROM po_line_locations_interface PLL
2775: WHERE PLL.interface_line_location_id = p_interface_line_location_id;
2776:
2777: IF (PO_LOG.d_proc) THEN
2778: PO_LOG.proc_end (d_module);
2779: END IF;
2780:
2781: EXCEPTION
2782: WHEN OTHERS THEN
2816:
2817: BEGIN
2818: d_position := 0;
2819:
2820: IF (PO_LOG.d_proc) THEN
2821: PO_LOG.proc_begin (d_module);
2822: END IF;
2823:
2824: INSERT INTO po_line_locations_interface
2817: BEGIN
2818: d_position := 0;
2819:
2820: IF (PO_LOG.d_proc) THEN
2821: PO_LOG.proc_begin (d_module);
2822: END IF;
2823:
2824: INSERT INTO po_line_locations_interface
2825: (
2993: populate_progress_payitem_dist
2994: (p_interface_line_location_id => l_interface_line_location_id);
2995: END IF;
2996:
2997: IF (PO_LOG.d_proc) THEN
2998: PO_LOG.proc_end (d_module);
2999: END IF;
3000:
3001: EXCEPTION
2994: (p_interface_line_location_id => l_interface_line_location_id);
2995: END IF;
2996:
2997: IF (PO_LOG.d_proc) THEN
2998: PO_LOG.proc_end (d_module);
2999: END IF;
3000:
3001: EXCEPTION
3002: WHEN OTHERS THEN
3034:
3035: BEGIN
3036: d_position := 0;
3037:
3038: IF (PO_LOG.d_proc) THEN
3039: PO_LOG.proc_begin (d_module);
3040: END IF;
3041:
3042: INSERT INTO po_distributions_interface
3035: BEGIN
3036: d_position := 0;
3037:
3038: IF (PO_LOG.d_proc) THEN
3039: PO_LOG.proc_begin (d_module);
3040: END IF;
3041:
3042: INSERT INTO po_distributions_interface
3043: (
3088: PLL.program_update_date
3089: FROM po_line_locations_interface PLL
3090: WHERE PLL.interface_line_location_id = p_interface_line_location_id;
3091:
3092: IF (PO_LOG.d_proc) THEN
3093: PO_LOG.proc_end (d_module);
3094: END IF;
3095:
3096: EXCEPTION
3089: FROM po_line_locations_interface PLL
3090: WHERE PLL.interface_line_location_id = p_interface_line_location_id;
3091:
3092: IF (PO_LOG.d_proc) THEN
3093: PO_LOG.proc_end (d_module);
3094: END IF;
3095:
3096: EXCEPTION
3097: WHEN OTHERS THEN
3146:
3147:
3148: d_position := 0;
3149:
3150: IF (PO_LOG.d_proc) THEN
3151: PO_LOG.proc_begin (d_module);
3152: END IF;
3153:
3154: SELECT PLI.interface_header_id,
3147:
3148: d_position := 0;
3149:
3150: IF (PO_LOG.d_proc) THEN
3151: PO_LOG.proc_begin (d_module);
3152: END IF;
3153:
3154: SELECT PLI.interface_header_id,
3155: PLI.interface_line_id,
3284: BEGIN
3285:
3286: d_position := 0;
3287:
3288: IF (PO_LOG.d_proc) THEN
3289: PO_LOG.proc_begin (d_module);
3290: END IF;
3291: p_group_line_id_tbl := PO_TBL_NUMBER();
3292:
3285:
3286: d_position := 0;
3287:
3288: IF (PO_LOG.d_proc) THEN
3289: PO_LOG.proc_begin (d_module);
3290: END IF;
3291: p_group_line_id_tbl := PO_TBL_NUMBER();
3292:
3293: -- initialize table containing the row number(index)
3329: RETURNING num1, num4 BULK COLLECT INTO l_index_tbl , l_group_line_id_tbl;
3330:
3331: d_position := 30;
3332:
3333: IF (PO_LOG.d_stmt) THEN
3334: PO_LOG.stmt(d_module, d_position, 'l_index_tbl', l_index_tbl);
3335: PO_LOG.stmt(d_module, d_position, 'l_group_line_id_tbl', l_group_line_id_tbl);
3336: END IF;
3337:
3330:
3331: d_position := 30;
3332:
3333: IF (PO_LOG.d_stmt) THEN
3334: PO_LOG.stmt(d_module, d_position, 'l_index_tbl', l_index_tbl);
3335: PO_LOG.stmt(d_module, d_position, 'l_group_line_id_tbl', l_group_line_id_tbl);
3336: END IF;
3337:
3338: p_group_line_id_tbl.extend(l_index_tbl.Count);
3331: d_position := 30;
3332:
3333: IF (PO_LOG.d_stmt) THEN
3334: PO_LOG.stmt(d_module, d_position, 'l_index_tbl', l_index_tbl);
3335: PO_LOG.stmt(d_module, d_position, 'l_group_line_id_tbl', l_group_line_id_tbl);
3336: END IF;
3337:
3338: p_group_line_id_tbl.extend(l_index_tbl.Count);
3339:
3342: l_index := l_index_tbl(i);
3343: p_group_line_id_tbl(l_index) := l_group_line_id_tbl(i);
3344: END LOOP;
3345:
3346: IF (PO_LOG.d_proc) THEN
3347: PO_LOG.proc_end (d_module);
3348: END IF;
3349:
3350: EXCEPTION
3343: p_group_line_id_tbl(l_index) := l_group_line_id_tbl(i);
3344: END LOOP;
3345:
3346: IF (PO_LOG.d_proc) THEN
3347: PO_LOG.proc_end (d_module);
3348: END IF;
3349:
3350: EXCEPTION
3351: WHEN OTHERS THEN
3384:
3385: p_is_line_num_disp_valid := PO_TBL_VARCHAR1();
3386: d_position := 0;
3387:
3388: IF (PO_LOG.d_proc) THEN
3389: PO_LOG.proc_begin (d_module);
3390: END IF;
3391: -- initialize table containing the row number(index)
3392: PO_PDOI_UTL.generate_ordered_num_list
3385: p_is_line_num_disp_valid := PO_TBL_VARCHAR1();
3386: d_position := 0;
3387:
3388: IF (PO_LOG.d_proc) THEN
3389: PO_LOG.proc_begin (d_module);
3390: END IF;
3391: -- initialize table containing the row number(index)
3392: PO_PDOI_UTL.generate_ordered_num_list
3393: (
3449: RETURNING num1, char2 BULK COLLECT INTO l_index_tbl , l_is_line_num_disp_valid;
3450:
3451: d_position := 30;
3452:
3453: IF (PO_LOG.d_stmt) THEN
3454: PO_LOG.stmt(d_module, d_position, 'l_index_tbl', l_index_tbl);
3455: PO_LOG.stmt(d_module, d_position, 'l_is_line_num_disp_valid', l_is_line_num_disp_valid);
3456: END IF;
3457:
3450:
3451: d_position := 30;
3452:
3453: IF (PO_LOG.d_stmt) THEN
3454: PO_LOG.stmt(d_module, d_position, 'l_index_tbl', l_index_tbl);
3455: PO_LOG.stmt(d_module, d_position, 'l_is_line_num_disp_valid', l_is_line_num_disp_valid);
3456: END IF;
3457:
3458: p_is_line_num_disp_valid.extend(l_is_line_num_disp_valid.Count);
3451: d_position := 30;
3452:
3453: IF (PO_LOG.d_stmt) THEN
3454: PO_LOG.stmt(d_module, d_position, 'l_index_tbl', l_index_tbl);
3455: PO_LOG.stmt(d_module, d_position, 'l_is_line_num_disp_valid', l_is_line_num_disp_valid);
3456: END IF;
3457:
3458: p_is_line_num_disp_valid.extend(l_is_line_num_disp_valid.Count);
3459: FOR i IN 1..l_index_tbl.COUNT