664: l_progress := '003';
665: --Get the unique id to be used for this document
666: SELECT PO_ONLINE_REPORT_TEXT_S.nextval
667: INTO l_online_report_id
668: FROM sys.dual;
669:
670: l_progress := '004';
671: --Get User ID and Login ID
672: l_user_id := FND_GLOBAL.USER_ID;
1499:
1500: --Get the unique id to be used for this document
1501: SELECT PO_ONLINE_REPORT_TEXT_S.nextval
1502: INTO l_online_report_id
1503: FROM sys.dual;
1504:
1505: l_progress := '004';
1506:
1507: --Get User ID and Login ID
3650: 0,
3651: p_sequence + ROWNUM,
3652: substr(l_textline,1,240),
3653: 'PO_PDOI_INVALID_VENDOR'
3654: FROM dual
3655: where not exists (select 'Y'
3656: from PO_HEADERS_GT POH, po_vendors pov
3657: WHERE POH.po_header_id = l_agreement_id
3658: AND pov.vendor_id = poh.vendor_id
3695: 0,
3696: p_sequence + ROWNUM,
3697: substr(l_textline,1,240),
3698: 'PO_PDOI_INVALID_VENDOR_SITE'
3699: FROM dual
3700: where not exists (select 'Y'
3701: from PO_HEADERS_GT POH, po_vendor_sites povs
3702: WHERE POH.po_header_id = l_agreement_id
3703: AND povs.vendor_site_id = poh.vendor_site_id
3739: 0,
3740: p_sequence + ROWNUM,
3741: substr(l_textline,1,240),
3742: 'PO_PDOI_INVALID_VDR_CNTCT'
3743: FROM dual
3744: WHERE NOT EXISTS (SELECT 'Y'
3745: FROM PO_VENDOR_CONTACTS pvc, po_headers_gt poh
3746: WHERE POH.po_header_id = l_agreement_id
3747: AND pvc.vendor_contact_id =poh.vendor_contact_id
4056: ** passed to the UomC function.
4057: */
4058:
4059: /*Bug4302950 :The shipments were updated with wrong price when supplier submits
4060: change request from ISP to split shipment quantity between two individual shipments.
4061: As the ISP doesnot handle change in distributions,replacing the shipments
4062: quantity with the sum of the distributions quantity in the calculation
4063: of price override so that the shipment price will reflect the correct value.*/
4064:
5343: , NULL
5344: , p_sequence + ROWNUM
5345: , l_textline
5346: , 'PO_SUB_USER_RATE_TYPE'
5347: FROM dual
5348: WHERE exists ( SELECT 'Rate-based lines exist'
5349: FROM po_lines_gt POL
5350: , po_line_types_b PLT
5351: WHERE p_document_id = POL.po_header_id
5446: 0,
5447: p_sequence + ROWNUM,
5448: substr(l_textline,1,240),
5449: 'PO_PDOI_INVALID_VENDOR'
5450: FROM dual
5451: where not exists (select 'Y'
5452: from PO_HEADERS_GT POH, po_vendors pov
5453: WHERE POH.po_header_id = p_document_id
5454: AND pov.vendor_id = poh.vendor_id
5490: 0,
5491: p_sequence + ROWNUM,
5492: substr(l_textline,1,240),
5493: 'PO_PDOI_INVALID_VENDOR_SITE'
5494: FROM dual
5495: where not exists (select 'Y'
5496: from PO_HEADERS_GT POH, po_vendor_sites povs
5497: WHERE POH.po_header_id = p_document_id
5498: AND povs.vendor_site_id = poh.vendor_site_id
5533: 0,
5534: p_sequence + ROWNUM,
5535: substr(l_textline,1,240),
5536: 'PO_PDOI_INVALID_VDR_CNTCT'
5537: FROM dual
5538: WHERE NOT EXISTS (SELECT 'Y'
5539: FROM PO_VENDOR_CONTACTS pvc, po_headers_gt poh
5540: WHERE POH.po_header_id = p_document_id
5541: AND pvc.vendor_contact_id =poh.vendor_contact_id
5999: 0,
6000: p_sequence + ROWNUM,
6001: substr(l_textline,1,240),
6002: 'PO_SUB_STD_CONTRACT_AMT_LIMIT'
6003: FROM DUAL;
6004:
6005: --Increment the p_sequence with number of errors reported in last query
6006: p_sequence := p_sequence + SQL%ROWCOUNT;
6007:
8391: NVL(l_asl_consigned_flag(i), 'N') = 'Y')
8392: THEN
8393: SELECT count('Y')
8394: INTO l_count_expense_dist
8395: FROM DUAL
8396: WHERE EXISTS(SELECT 'Y'
8397: FROM PO_DISTRIBUTIONS_GT
8398: WHERE LINE_LOCATION_ID = l_line_location_id(i)
8399: AND DESTINATION_TYPE_CODE = 'EXPENSE');
12660: -- Indicates API return status as 'S', 'E' or 'U'.
12661: --x_po_status_rec
12662: -- Table x_po_status_rec.updateable_flag will be 'Y' or 'N' for each input entity
12663: --Notes:
12664: -- The implementation of updatable_flag involves a fake "update dual" statement to
12665: -- optimize performance.
12666: --End of Comments
12667: -------------------------------------------------------------------------------
12668:
12712: || l_progress, 'Entering Procedure '||l_api_name);
12713: END IF;
12714: END IF;
12715:
12716: --To obtimize performance, Execute a fake "update dual" in BULK. The WHERE clause
12717: -- of the fake update statement checks if the current entity is updatable or not.
12718: -- One dual row updated <==> where clause is true <==> current entity is updatable.
12719: -- Later, Examine BULK_ROWCOUNT in a loop to determine updatable_flag
12720: l_progress := '010';
12714: END IF;
12715:
12716: --To obtimize performance, Execute a fake "update dual" in BULK. The WHERE clause
12717: -- of the fake update statement checks if the current entity is updatable or not.
12718: -- One dual row updated <==> where clause is true <==> current entity is updatable.
12719: -- Later, Examine BULK_ROWCOUNT in a loop to determine updatable_flag
12720: l_progress := '010';
12721:
12722: -- bug3592160 START
12735: );
12736:
12737: l_progress := '015';
12738:
12739: -- The original approach was to do a fake UPDATE on DUAL table. However, this
12740: -- is causing locking issue. Therefore, BULK INSERT is used instead of
12741: -- BULK UPDATE
12742: l_procedure_id := PO_CORE_S.get_session_gt_nextval;
12743:
12747: num1
12748: )
12749: SELECT l_procedure_id,
12750: 1 -- Dummy Value
12751: FROM DUAL
12752: WHERE (p_release_id(i) IS NOT NULL
12753: --Case 1: No Release is specified, PO Header has to be specified
12754: -- Through any of HeaderId, DocNum-and-SubType, or VendorOrderNum
12755: OR EXISTS (select null from po_headers_all h
12791: l_progress := '030';
12792: FOR i IN 1..p_count LOOP
12793:
12794: IF SQL%BULK_ROWCOUNT(i) > 0 THEN
12795: -- Updateable Header/Line/Shipment found in the fake "update dual" stmt
12796: x_po_status_rec.updatable_flag(i) := 'Y';
12797:
12798: -- This document is updatable, lock the document if p_lock_flag=Y
12799: l_progress := '040';
12897: -- Indicates API return status as 'S', 'E' or 'U'.
12898: --x_po_status_rec
12899: -- Table x_po_status_rec.updateable_flag will be 'Y' or 'N' for each input entity
12900: --Notes:
12901: -- The implementation of reservable_flag involves a fake "update dual" statement to
12902: -- optimize performance.
12903: --End of Comments
12904: -------------------------------------------------------------------------------
12905:
12937: || l_progress, 'Entering Procedure '||l_api_name);
12938: END IF;
12939: END IF;
12940:
12941: --To obtimize performance, Execute a fake "update dual" in BULK. The WHERE clause
12942: -- of the fake update statement checks if the current entity is reservable or not.
12943: -- One dual row updated <==> where clause is true <==> current entity is reservable.
12944: -- Later, Examine BULK_ROWCOUNT in a loop to determine reservable_flag
12945: l_progress := '010';
12939: END IF;
12940:
12941: --To obtimize performance, Execute a fake "update dual" in BULK. The WHERE clause
12942: -- of the fake update statement checks if the current entity is reservable or not.
12943: -- One dual row updated <==> where clause is true <==> current entity is reservable.
12944: -- Later, Examine BULK_ROWCOUNT in a loop to determine reservable_flag
12945: l_progress := '010';
12946:
12947: -- bug3592160 START
12961:
12962: l_progress := '015';
12963:
12964:
12965: -- The original approach was to do a fake UPDATE on DUAL table. However, this
12966: -- is causing locking issue. Therefore, BULK INSERT is used instead of
12967: -- BULK UPDATE
12968: l_procedure_id := PO_CORE_S.get_session_gt_nextval;
12969:
12973: num1
12974: )
12975: SELECT l_procedure_id,
12976: 1 -- Dummy Value
12977: FROM DUAL
12978: WHERE (p_release_id(i) IS NOT NULL
12979: --Case 1: No Release is specified, PO Header has to be specified
12980: -- Through any of HeaderId, DocNum-and-SubType, or VendorOrderNum
12981: -- Bug 3407980: Modified closed_code condition so that it only discards 'FINALLY CLOSED'
13019: l_progress := '030';
13020: FOR i IN 1..p_count LOOP
13021:
13022: IF SQL%BULK_ROWCOUNT(i) > 0 THEN
13023: -- Reservable Header/Line/Shipment found in the fake "update dual" stmt
13024: x_po_status_rec.reservable_flag(i) := 'Y';
13025: ELSE
13026: x_po_status_rec.reservable_flag(i) := 'N';
13027: END IF; --END of IF SQL%BULK_ROWCOUNT(i) > 0
13070: -- Indicates API return status as 'S', 'E' or 'U'.
13071: --x_po_status_rec
13072: -- Table x_po_status_rec.updateable_flag will be 'Y' or 'N' for each input entity
13073: --Notes:
13074: -- The implementation of unreservable_flag involves a fake "update dual" statement to
13075: -- optimize performance.
13076: --End of Comments
13077: -------------------------------------------------------------------------------
13078:
13110: || l_progress, 'Entering Procedure '||l_api_name);
13111: END IF;
13112: END IF;
13113:
13114: --To obtimize performance, Execute a fake "update dual" in BULK. The WHERE clause
13115: -- of the fake update statement checks if the current entity is unreservable or not.
13116: -- One dual row updated <==> where clause is true <==> current entity is unreservable.
13117: -- Later, Examine BULK_ROWCOUNT in a loop to determine unreservable_flag
13118: l_progress := '010';
13112: END IF;
13113:
13114: --To obtimize performance, Execute a fake "update dual" in BULK. The WHERE clause
13115: -- of the fake update statement checks if the current entity is unreservable or not.
13116: -- One dual row updated <==> where clause is true <==> current entity is unreservable.
13117: -- Later, Examine BULK_ROWCOUNT in a loop to determine unreservable_flag
13118: l_progress := '010';
13119:
13120: -- bug3592160 START
13134:
13135: l_progress := '015';
13136:
13137: -- SQL What: Checks if current PO Header/Line/Shipment is in unreservable status
13138: -- The original approach was to do a fake UPDATE on DUAL table. However, this
13139: -- is causing locking issue. Therefore, BULK INSERT is used instead of
13140: -- BULK UPDATE
13141: l_procedure_id := PO_CORE_S.get_session_gt_nextval;
13142:
13146: num1
13147: )
13148: SELECT l_procedure_id,
13149: 1 -- Dummy Value
13150: FROM DUAL
13151: WHERE (p_release_id(i) IS NOT NULL
13152: --Case 1: No Release is specified, PO Header has to be specified
13153: -- Through any of HeaderId, DocNum-and-SubType, or VendorOrderNum
13154: -- Bug 3407980: Modified closed_code condition so that it only discards 'FINALLY CLOSED'
13188: l_progress := '030';
13189: FOR i IN 1..p_count LOOP
13190:
13191: IF SQL%BULK_ROWCOUNT(i) > 0 THEN
13192: -- Unreservable Header/Line/Shipment found in the fake "update dual" stmt
13193: x_po_status_rec.unreservable_flag(i) := 'Y';
13194: ELSE
13195: x_po_status_rec.unreservable_flag(i) := 'N';
13196: END IF; --END of IF SQL%BULK_ROWCOUNT(i) > 0
14870: -----------------------------------------
14871:
14872: SELECT PO_SESSION_GT_S.nextval
14873: INTO l_dates_key
14874: FROM DUAL
14875: ;
14876:
14877: l_progress := '220';
14878: