318: -- None
319: --OUT:
320: --x_return_status
321: -- The standard OUT parameter giving return status of the API call.
322: -- FND_API.G_RET_STS_ERROR - for expected error
323: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
324: -- FND_API.G_RET_STS_SUCCESS - for success
325: --Notes:
326: -- None
319: --OUT:
320: --x_return_status
321: -- The standard OUT parameter giving return status of the API call.
322: -- FND_API.G_RET_STS_ERROR - for expected error
323: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
324: -- FND_API.G_RET_STS_SUCCESS - for success
325: --Notes:
326: -- None
327: --Testing:
320: --x_return_status
321: -- The standard OUT parameter giving return status of the API call.
322: -- FND_API.G_RET_STS_ERROR - for expected error
323: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
324: -- FND_API.G_RET_STS_SUCCESS - for success
325: --Notes:
326: -- None
327: --Testing:
328: -- None
342: l_vs_ship_via_lookup_code PO_HEADERS_ALL.ship_via_lookup_code%TYPE;
343:
344: BEGIN
345: -- Initialize API return status to success
346: x_return_status := FND_API.G_RET_STS_SUCCESS;
347:
348: --Default all the required default po parameters from the financial system
349: --parameters,Po_system_parameters, receiving options and gl set of books.
350: --Using the procedure po_core_s.get_po_parameters
553: g_cpa_csr.confirming_order_flag := 'N';
554: g_cpa_csr.frozen_flag := 'N';
555:
556: EXCEPTION
557: WHEN FND_API.G_EXC_ERROR THEN
558: x_return_status := FND_API.G_RET_STS_ERROR;
559: g_progress := '210';
560: IF g_debug_stmt THEN
561: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
554: g_cpa_csr.frozen_flag := 'N';
555:
556: EXCEPTION
557: WHEN FND_API.G_EXC_ERROR THEN
558: x_return_status := FND_API.G_RET_STS_ERROR;
559: g_progress := '210';
560: IF g_debug_stmt THEN
561: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
562: p_token => g_progress,
561: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
562: p_token => g_progress,
563: p_message => 'Expected Error');
564: END IF;
565: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
566: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
567: g_progress := '211';
568: IF g_debug_unexp THEN
569: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
562: p_token => g_progress,
563: p_message => 'Expected Error');
564: END IF;
565: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
566: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
567: g_progress := '211';
568: IF g_debug_unexp THEN
569: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
570: p_token => g_progress,
570: p_token => g_progress,
571: p_message => 'Unexpected Error');
572: END IF;
573: WHEN OTHERS THEN
574: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
575: g_progress := '212';
576: IF g_debug_unexp THEN
577: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
578: p_token => g_progress,
600: -- None
601: --OUT:
602: --x_return_status
603: -- The standard OUT parameter giving return status of the API call.
604: -- FND_API.G_RET_STS_ERROR - for expected error
605: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
606: -- FND_API.G_RET_STS_SUCCESS - for success
607: --Notes:
608: -- None
601: --OUT:
602: --x_return_status
603: -- The standard OUT parameter giving return status of the API call.
604: -- FND_API.G_RET_STS_ERROR - for expected error
605: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
606: -- FND_API.G_RET_STS_SUCCESS - for success
607: --Notes:
608: -- None
609: --Testing:
602: --x_return_status
603: -- The standard OUT parameter giving return status of the API call.
604: -- FND_API.G_RET_STS_ERROR - for expected error
605: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
606: -- FND_API.G_RET_STS_SUCCESS - for success
607: --Notes:
608: -- None
609: --Testing:
610: -- None
621: l_freight_carrier ORG_FREIGHT.freight_code%TYPE;
622: l_terms_id AP_TERMS.term_id%TYPE;
623: BEGIN
624: -- Initialize API return status to success
625: x_return_status := FND_API.G_RET_STS_SUCCESS;
626:
627: -- validate document number
628: IF g_cpa_csr.document_num IS NOT NULL THEN
629: IF g_cpa_csr.document_num <> 'CPA 11.5.10+' THEN
658: Fnd_message.set_token( token => 'VALUE'
659: , VALUE => g_cpa_csr.document_num);
660: FND_MSG_PUB.Add;
661:
662: RAISE FND_API.G_EXC_ERROR;
663:
664: ELSIF (l_error_code = 'PO_PDOI_VALUE_NUMERIC') THEN
665: g_progress := '303';
666: IF g_debug_stmt THEN
673: , VALUE => 'Document Number');
674: Fnd_message.set_token( token => 'VALUE'
675: , VALUE => g_cpa_csr.document_num);
676: FND_MSG_PUB.Add;
677: RAISE FND_API.G_EXC_ERROR;
678: ELSIF (l_error_code = 'PO_PDOI_LT_ZERO') THEN
679: g_progress := '304';
680: IF g_debug_stmt THEN
681: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
687: , VALUE => 'Document Number');
688: Fnd_message.set_token( token => 'VALUE'
689: , VALUE => g_cpa_csr.document_num);
690: FND_MSG_PUB.Add;
691: RAISE FND_API.G_EXC_ERROR;
692: END IF;
693: END IF; -- If is_valid = FALSE
694: END IF; -- End of IF g_cpa_csr.document_num <> 'CPA 11.5.10+'
695: ELSE
704: Fnd_message.set_name('PO','PO_PDOI_COLUMN_NOT_NULL');
705: Fnd_message.set_token( token => 'COLUMN_NAME'
706: , VALUE => 'Document Number');
707: FND_MSG_PUB.Add;
708: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
709: END IF; -- End of IF g_cpa_csr.document_num IS NOT NULL
710:
711: -- Validate ship_to_location
712: IF g_cpa_csr.ship_to_location_id IS NOT NULL THEN
766: g_cpa_csr.bill_to_location_id := NULL;
767: END IF;
768: END IF; -- End of validate bill_to_location
769: EXCEPTION
770: WHEN FND_API.G_EXC_ERROR THEN
771: x_return_status := FND_API.G_RET_STS_ERROR;
772: g_progress := '320';
773: IF g_debug_stmt THEN
774: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
767: END IF;
768: END IF; -- End of validate bill_to_location
769: EXCEPTION
770: WHEN FND_API.G_EXC_ERROR THEN
771: x_return_status := FND_API.G_RET_STS_ERROR;
772: g_progress := '320';
773: IF g_debug_stmt THEN
774: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
775: p_token => g_progress,
774: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
775: p_token => g_progress,
776: p_message => 'Expected Error');
777: END IF;
778: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
779: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
780: g_progress := '321';
781: IF g_debug_unexp THEN
782: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
775: p_token => g_progress,
776: p_message => 'Expected Error');
777: END IF;
778: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
779: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
780: g_progress := '321';
781: IF g_debug_unexp THEN
782: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
783: p_token => g_progress,
783: p_token => g_progress,
784: p_message => 'Unexpected Error');
785: END IF;
786: WHEN OTHERS THEN
787: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
788: g_progress := '322';
789: IF g_debug_unexp THEN
790: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
791: p_token => g_progress,
827: --x_document_number
828: -- The document number that would uniquely identify a document in a given organization.
829: --x_return_status
830: -- The standard OUT parameter giving return status of the API call.
831: -- FND_API.G_RET_STS_ERROR - for expected error
832: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
833: -- FND_API.G_RET_STS_SUCCESS - for success
834: --Notes:
835: -- None
828: -- The document number that would uniquely identify a document in a given organization.
829: --x_return_status
830: -- The standard OUT parameter giving return status of the API call.
831: -- FND_API.G_RET_STS_ERROR - for expected error
832: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
833: -- FND_API.G_RET_STS_SUCCESS - for success
834: --Notes:
835: -- None
836: --Testing:
829: --x_return_status
830: -- The standard OUT parameter giving return status of the API call.
831: -- FND_API.G_RET_STS_ERROR - for expected error
832: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
833: -- FND_API.G_RET_STS_SUCCESS - for success
834: --Notes:
835: -- None
836: --Testing:
837: -- None
887: l_new_ame_appr_id_req varchar2(1);
888: BEGIN
889:
890: -- Initialize API return status to success
891: x_return_status := FND_API.G_RET_STS_SUCCESS;
892:
893: x_document_num := g_cpa_csr.document_num;
894: x_document_number := g_cpa_csr.document_num;
895:
1062: p_message => 'Before calling PO_GA_ORG_ASSIGN_PVT.Insert_Row');
1063: END IF;
1064:
1065: PO_GA_ORG_ASSIGN_PVT.insert_row(
1066: p_init_msg_list => FND_API.g_true,
1067: x_return_status => l_return_status,
1068: p_org_assign_rec => l_org_assign_rec,
1069: x_row_id => l_org_row_id);
1070: g_progress := '403';
1073: p_token => g_progress,
1074: p_message => 'After calling PO_GA_ORG_ASSIGN_PVT.Insert_Row');
1075: END IF;
1076:
1077: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1078: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1079: RAISE FND_API.G_EXC_ERROR;
1080: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1081: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1074: p_message => 'After calling PO_GA_ORG_ASSIGN_PVT.Insert_Row');
1075: END IF;
1076:
1077: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1078: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1079: RAISE FND_API.G_EXC_ERROR;
1080: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1081: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1082: END IF;
1075: END IF;
1076:
1077: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1078: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1079: RAISE FND_API.G_EXC_ERROR;
1080: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1081: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1082: END IF;
1083: END IF;
1076:
1077: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1078: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1079: RAISE FND_API.G_EXC_ERROR;
1080: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1081: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1082: END IF;
1083: END IF;
1084:
1077: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1078: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1079: RAISE FND_API.G_EXC_ERROR;
1080: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1081: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1082: END IF;
1083: END IF;
1084:
1085: END IF;
1509: END IF;
1510:
1511:
1512:
1513: IF l_return_status <> FND_API.G_RET_STS_SUCCESS then
1514: RAISE l_Contracts_call_exception;
1515: END IF; -- Return status from contracts
1516:
1517: END IF; -- if p_conterms_exist_flag = Y
1568:
1569: EXCEPTION
1570: WHEN l_Contracts_call_exception then
1571: g_progress := '418';
1572: x_return_status := FND_API.G_RET_STS_ERROR;
1573:
1574: -- put error messages in log
1575: IF g_debug_stmt THEN
1576: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
1603: END IF;
1604:
1605: fnd_message.set_name ('PO', 'PO_UDA_TEMPLATE_ID_NULL');
1606: fnd_msg_pub.ADD;
1607: x_return_status := FND_API.G_RET_STS_ERROR;
1608:
1609: WHEN OTHERS THEN
1610: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1611: g_progress := '419';
1606: fnd_msg_pub.ADD;
1607: x_return_status := FND_API.G_RET_STS_ERROR;
1608:
1609: WHEN OTHERS THEN
1610: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1611: g_progress := '419';
1612: IF g_debug_unexp THEN
1613: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
1614: p_token => g_progress,
1652: --x_document_number
1653: -- The document number that would uniquely identify a document in a given organization.
1654: --x_return_status
1655: -- The standard OUT parameter giving return status of the API call.
1656: -- FND_API.G_RET_STS_ERROR - for expected error
1657: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
1658: -- FND_API.G_RET_STS_SUCCESS - for success
1659: --Notes:
1660: -- None
1653: -- The document number that would uniquely identify a document in a given organization.
1654: --x_return_status
1655: -- The standard OUT parameter giving return status of the API call.
1656: -- FND_API.G_RET_STS_ERROR - for expected error
1657: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
1658: -- FND_API.G_RET_STS_SUCCESS - for success
1659: --Notes:
1660: -- None
1661: --Testing:
1654: --x_return_status
1655: -- The standard OUT parameter giving return status of the API call.
1656: -- FND_API.G_RET_STS_ERROR - for expected error
1657: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
1658: -- FND_API.G_RET_STS_SUCCESS - for success
1659: --Notes:
1660: -- None
1661: --Testing:
1662: -- None
1687: l_change_process_type PO_DOC_STYLE_HEADERS.change_process_type%TYPE;
1688:
1689: BEGIN
1690: -- Initialize API return status to success
1691: x_return_status := FND_API.G_RET_STS_SUCCESS;
1692:
1693: g_progress:='400';
1694: IF g_interface_cursor%ISOPEN THEN
1695: CLOSE g_interface_cursor;
1706: p_message => 'PO_ALL_NO_DRILLDOWN: '||SQLERRM);
1707: END IF;
1708: Fnd_message.set_name('PO','PO_ALL_NO_DRILLDOWN');
1709: FND_MSG_PUB.Add;
1710: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1711: END IF;
1712:
1713: l_document_type := g_cpa_csr.document_type_code;
1714: l_document_subtype := g_cpa_csr.document_subtype;
1793: p_token => g_progress,
1794: p_message => 'After calling po_sourcing_pvt.default_cpa');
1795: END IF;
1796:
1797: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1798: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1799: RAISE FND_API.G_EXC_ERROR;
1800: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1794: p_message => 'After calling po_sourcing_pvt.default_cpa');
1795: END IF;
1796:
1797: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1798: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1799: RAISE FND_API.G_EXC_ERROR;
1800: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1802: END IF;
1795: END IF;
1796:
1797: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1798: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1799: RAISE FND_API.G_EXC_ERROR;
1800: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1802: END IF;
1803: END IF;
1796:
1797: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1798: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1799: RAISE FND_API.G_EXC_ERROR;
1800: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1802: END IF;
1803: END IF;
1804:
1797: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1798: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1799: RAISE FND_API.G_EXC_ERROR;
1800: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1801: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1802: END IF;
1803: END IF;
1804:
1805: -- Validate the required fields in the record
1820: p_token => g_progress,
1821: p_message => 'After calling po_sourcing_pvt.validate_cpa');
1822: END IF;
1823:
1824: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1825: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1826: RAISE FND_API.G_EXC_ERROR;
1827: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1828: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1821: p_message => 'After calling po_sourcing_pvt.validate_cpa');
1822: END IF;
1823:
1824: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1825: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1826: RAISE FND_API.G_EXC_ERROR;
1827: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1828: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1829: END IF;
1822: END IF;
1823:
1824: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1825: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1826: RAISE FND_API.G_EXC_ERROR;
1827: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1828: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1829: END IF;
1830: END IF;
1823:
1824: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1825: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1826: RAISE FND_API.G_EXC_ERROR;
1827: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1828: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1829: END IF;
1830: END IF;
1831:
1824: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1825: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1826: RAISE FND_API.G_EXC_ERROR;
1827: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1828: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1829: END IF;
1830: END IF;
1831:
1832: -- Insert record in the po_headers table and add attachments and contract terms
1854: p_token => g_progress,
1855: p_message => 'After calling po_sourcing_pvt.insert_cpa');
1856: END IF;
1857:
1858: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1859: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1860: RAISE FND_API.G_EXC_ERROR;
1861: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1862: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1855: p_message => 'After calling po_sourcing_pvt.insert_cpa');
1856: END IF;
1857:
1858: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1859: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1860: RAISE FND_API.G_EXC_ERROR;
1861: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1862: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1863: END IF;
1856: END IF;
1857:
1858: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1859: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1860: RAISE FND_API.G_EXC_ERROR;
1861: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1862: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1863: END IF;
1864: END IF;
1857:
1858: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1859: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1860: RAISE FND_API.G_EXC_ERROR;
1861: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1862: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1863: END IF;
1864: END IF;
1865:
1858: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1859: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1860: RAISE FND_API.G_EXC_ERROR;
1861: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1862: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1863: END IF;
1864: END IF;
1865:
1866: ELSE
1873: Fnd_message.set_name('PO','PO_PDOI_INVALID_ACTION');
1874: Fnd_message.set_token( token => 'VALUE'
1875: , VALUE => g_cpa_csr.action);
1876: FND_MSG_PUB.Add;
1877: RAISE FND_API.G_EXC_ERROR;
1878: END IF; -- End of l_action = 'NEW'
1879: ELSE
1880: g_progress := '508';
1881: IF g_debug_stmt THEN
1889: Fnd_message.set_token( token => 'VALUE'
1890: , VALUE => 'CONTRACT');
1891: FND_MSG_PUB.Add;
1892:
1893: RAISE FND_API.G_EXC_ERROR;
1894: END IF; -- End of l_document_type = 'CONTRACT'
1895: EXCEPTION
1896: WHEN FND_API.G_EXC_ERROR THEN
1897: x_document_number := NULL;
1892:
1893: RAISE FND_API.G_EXC_ERROR;
1894: END IF; -- End of l_document_type = 'CONTRACT'
1895: EXCEPTION
1896: WHEN FND_API.G_EXC_ERROR THEN
1897: x_document_number := NULL;
1898: x_document_id := NULL;
1899: x_return_status := FND_API.G_RET_STS_ERROR;
1900: g_progress := '510';
1895: EXCEPTION
1896: WHEN FND_API.G_EXC_ERROR THEN
1897: x_document_number := NULL;
1898: x_document_id := NULL;
1899: x_return_status := FND_API.G_RET_STS_ERROR;
1900: g_progress := '510';
1901: IF g_debug_stmt THEN
1902: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
1903: p_token => g_progress,
1903: p_token => g_progress,
1904: p_message => 'Expected Error');
1905: END IF;
1906:
1907: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1908: x_document_number := NULL;
1909: x_document_id := NULL;
1910: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1911: g_progress := '511';
1906:
1907: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1908: x_document_number := NULL;
1909: x_document_id := NULL;
1910: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1911: g_progress := '511';
1912: IF g_debug_unexp THEN
1913: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
1914: p_token => g_progress,
1916: END IF;
1917: WHEN OTHERS THEN
1918: x_document_number := NULL;
1919: x_document_id := NULL;
1920: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1921: g_progress := '512';
1922: IF g_debug_unexp THEN
1923: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
1924: p_token => g_progress,
1949: -- The id that will be used to uniquely identify a row in the PO_HEADERS_INTERFACE table
1950: --OUT:
1951: --x_return_status
1952: -- The standard OUT parameter giving return status of the API call.
1953: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
1954: -- FND_API.G_RET_STS_SUCCESS - for success
1955: --Notes:
1956: -- None
1957: --Testing:
1950: --OUT:
1951: --x_return_status
1952: -- The standard OUT parameter giving return status of the API call.
1953: -- FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
1954: -- FND_API.G_RET_STS_SUCCESS - for success
1955: --Notes:
1956: -- None
1957: --Testing:
1958: -- None
1965: ) IS
1966: l_api_name CONSTANT VARCHAR2(30) := 'DELETE_INTERFACE_HEADER';
1967: BEGIN
1968: -- Initialize API return status to success
1969: x_return_status := FND_API.G_RET_STS_SUCCESS;
1970:
1971: DELETE po_headers_interface
1972: WHERE interface_header_id = p_interface_header_id;
1973:
1978: p_message => 'No of Records deleted from PO_HEADERS_INTERFACE'||SQL%rowcount);
1979: END IF;
1980: EXCEPTION
1981: WHEN OTHERS THEN
1982: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1983: g_progress := '601';
1984: IF g_debug_unexp THEN
1985: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
1986: p_token => g_progress,