DBA Data[Home] [Help]

APPS.PO_RCO_VALIDATION_PVT dependencies on FND_API

Line 881: x_return_status := fnd_api.g_ret_sts_success;

877: l_doc_type VARCHAR2(2000);
878: l_doc_num po_headers_all.segment1%TYPE;
879: l_err_po_line_num NUMBER;
880: BEGIN
881: x_return_status := fnd_api.g_ret_sts_success;
882:
883: l_err_po_line_num := p_doc_check_rec_type.line_num(p_po_error_index);
884:
885: IF(p_release_id IS NULL) THEN

Line 1147: x_return_status := fnd_api.g_ret_sts_unexp_error;

1143: l_api_name || '.others_exception',
1144: p_header_id || '*' || p_release_id || '*' || p_err_po_msg || ':' || SQLERRM);
1145: END IF;
1146: END IF;
1147: x_return_status := fnd_api.g_ret_sts_unexp_error;
1148: x_return_msg := 'DPE_UNEXP:' || p_header_id || '*' || p_release_id || '*' || p_err_po_msg || '*' || l_progress || ':' || SQLERRM;
1149: END decode_poerror;
1150:
1151: /*

Line 1353: l_main_loop_flag VARCHAR2(1) := fnd_api.g_true;

1349: IS
1350: l_api_name VARCHAR2(50) := 'Validate_Changes';
1351: l_po_change_table pos_chg_rec_tbl;
1352: l_error_table error_tbl_type;
1353: l_main_loop_flag VARCHAR2(1) := fnd_api.g_true;
1354: l_get_cur_id_loop_flag VARCHAR2(1) := fnd_api.g_true;
1355: i NUMBER := 2;
1356: j NUMBER;
1357: k NUMBER;

Line 1354: l_get_cur_id_loop_flag VARCHAR2(1) := fnd_api.g_true;

1350: l_api_name VARCHAR2(50) := 'Validate_Changes';
1351: l_po_change_table pos_chg_rec_tbl;
1352: l_error_table error_tbl_type;
1353: l_main_loop_flag VARCHAR2(1) := fnd_api.g_true;
1354: l_get_cur_id_loop_flag VARCHAR2(1) := fnd_api.g_true;
1355: i NUMBER := 2;
1356: j NUMBER;
1357: k NUMBER;
1358: l_table_index NUMBER;

Line 1386: x_return_status := fnd_api.g_ret_sts_success;

1382: l_err_count NUMBER;
1383: l_req_org_id NUMBER;
1384: BEGIN
1385: x_retmsg := 'VC000';
1386: x_return_status := fnd_api.g_ret_sts_success;
1387:
1388: j := 1;
1389: l_main_loop_flag := fnd_api.g_true;
1390:

Line 1389: l_main_loop_flag := fnd_api.g_true;

1385: x_retmsg := 'VC000';
1386: x_return_status := fnd_api.g_ret_sts_success;
1387:
1388: j := 1;
1389: l_main_loop_flag := fnd_api.g_true;
1390:
1391: --Main Loop Starts
1392: --Main Loop continues so as long there exists records with dirty_flag = 'N'
1393: WHILE(l_main_loop_flag = fnd_api.g_true)

Line 1393: WHILE(l_main_loop_flag = fnd_api.g_true)

1389: l_main_loop_flag := fnd_api.g_true;
1390:
1391: --Main Loop Starts
1392: --Main Loop continues so as long there exists records with dirty_flag = 'N'
1393: WHILE(l_main_loop_flag = fnd_api.g_true)
1394: LOOP
1395: x_retmsg := 'VC001';
1396: --Get First Clean Row => dirty_flag ='N'
1397: l_get_cur_id_loop_flag := fnd_api.g_true;

Line 1397: l_get_cur_id_loop_flag := fnd_api.g_true;

1393: WHILE(l_main_loop_flag = fnd_api.g_true)
1394: LOOP
1395: x_retmsg := 'VC001';
1396: --Get First Clean Row => dirty_flag ='N'
1397: l_get_cur_id_loop_flag := fnd_api.g_true;
1398: l_found_clean := fnd_api.g_true;
1399: WHILE(l_get_cur_id_loop_flag = fnd_api.g_true) LOOP
1400: IF(j = p_req_change_table.count + 1) THEN /*Cannot find any Clean Row, Thus End Procedure*/
1401: l_main_loop_flag := fnd_api.g_false;

Line 1398: l_found_clean := fnd_api.g_true;

1394: LOOP
1395: x_retmsg := 'VC001';
1396: --Get First Clean Row => dirty_flag ='N'
1397: l_get_cur_id_loop_flag := fnd_api.g_true;
1398: l_found_clean := fnd_api.g_true;
1399: WHILE(l_get_cur_id_loop_flag = fnd_api.g_true) LOOP
1400: IF(j = p_req_change_table.count + 1) THEN /*Cannot find any Clean Row, Thus End Procedure*/
1401: l_main_loop_flag := fnd_api.g_false;
1402: l_get_cur_id_loop_flag := fnd_api.g_false;

Line 1399: WHILE(l_get_cur_id_loop_flag = fnd_api.g_true) LOOP

1395: x_retmsg := 'VC001';
1396: --Get First Clean Row => dirty_flag ='N'
1397: l_get_cur_id_loop_flag := fnd_api.g_true;
1398: l_found_clean := fnd_api.g_true;
1399: WHILE(l_get_cur_id_loop_flag = fnd_api.g_true) LOOP
1400: IF(j = p_req_change_table.count + 1) THEN /*Cannot find any Clean Row, Thus End Procedure*/
1401: l_main_loop_flag := fnd_api.g_false;
1402: l_get_cur_id_loop_flag := fnd_api.g_false;
1403: l_found_clean := fnd_api.g_false;

Line 1401: l_main_loop_flag := fnd_api.g_false;

1397: l_get_cur_id_loop_flag := fnd_api.g_true;
1398: l_found_clean := fnd_api.g_true;
1399: WHILE(l_get_cur_id_loop_flag = fnd_api.g_true) LOOP
1400: IF(j = p_req_change_table.count + 1) THEN /*Cannot find any Clean Row, Thus End Procedure*/
1401: l_main_loop_flag := fnd_api.g_false;
1402: l_get_cur_id_loop_flag := fnd_api.g_false;
1403: l_found_clean := fnd_api.g_false;
1404: ELSIF(p_req_change_table(j).dirty_flag = 'N') THEN
1405: l_current_row_id := j;

Line 1402: l_get_cur_id_loop_flag := fnd_api.g_false;

1398: l_found_clean := fnd_api.g_true;
1399: WHILE(l_get_cur_id_loop_flag = fnd_api.g_true) LOOP
1400: IF(j = p_req_change_table.count + 1) THEN /*Cannot find any Clean Row, Thus End Procedure*/
1401: l_main_loop_flag := fnd_api.g_false;
1402: l_get_cur_id_loop_flag := fnd_api.g_false;
1403: l_found_clean := fnd_api.g_false;
1404: ELSIF(p_req_change_table(j).dirty_flag = 'N') THEN
1405: l_current_row_id := j;
1406: j := j + 1;

Line 1403: l_found_clean := fnd_api.g_false;

1399: WHILE(l_get_cur_id_loop_flag = fnd_api.g_true) LOOP
1400: IF(j = p_req_change_table.count + 1) THEN /*Cannot find any Clean Row, Thus End Procedure*/
1401: l_main_loop_flag := fnd_api.g_false;
1402: l_get_cur_id_loop_flag := fnd_api.g_false;
1403: l_found_clean := fnd_api.g_false;
1404: ELSIF(p_req_change_table(j).dirty_flag = 'N') THEN
1405: l_current_row_id := j;
1406: j := j + 1;
1407: l_get_cur_id_loop_flag := fnd_api.g_false;

Line 1407: l_get_cur_id_loop_flag := fnd_api.g_false;

1403: l_found_clean := fnd_api.g_false;
1404: ELSIF(p_req_change_table(j).dirty_flag = 'N') THEN
1405: l_current_row_id := j;
1406: j := j + 1;
1407: l_get_cur_id_loop_flag := fnd_api.g_false;
1408: ELSE
1409: j := j + 1;
1410: END IF;
1411: END LOOP;

Line 1417: IF(l_found_clean = fnd_api.g_true) THEN

1413: x_retmsg := 'VC002';
1414:
1415: --Obtained First Clean Row in l_current_row_id
1416:
1417: IF(l_found_clean = fnd_api.g_true) THEN
1418:
1419: --Get po_header_id/po_release_id for the current Clean Row
1420: SELECT
1421: plla.po_header_id,

Line 1520: p_init_msg_list => fnd_api.g_false,

1516: x_retmsg := 'VC0031-1';
1517:
1518: po_chg_request_pvt.validate_change_request(
1519: p_api_version => 1.0,
1520: p_init_msg_list => fnd_api.g_false,
1521: x_return_status => l_return_status,
1522: x_msg_data => l_return_msg,
1523: p_po_header_id => l_current_hdr_id,
1524: p_po_release_id => l_current_rel_id,

Line 1543: IF(l_return_status = fnd_api.g_ret_sts_error) THEN

1539:
1540: -- set org context back to req's org
1541: po_moac_utils_pvt.set_org_context(l_req_org_id) ; --
1542:
1543: IF(l_return_status = fnd_api.g_ret_sts_error) THEN
1544: x_retmsg := 'VC0d31:' || l_return_msg;
1545: l_err_count := l_doc_check_rec_type.online_report_id.count;
1546: IF(l_err_count > 0) THEN
1547: FOR y IN 1..l_err_count

Line 1559: IF(l_decode_status <> fnd_api.g_ret_sts_success) THEN

1555: p_errortable,
1556: l_error_index,
1557: l_decode_status,
1558: l_decode_msg);
1559: IF(l_decode_status <> fnd_api.g_ret_sts_success) THEN
1560: x_retmsg := 'VC0d41:' || l_decode_msg;
1561: x_return_status := fnd_api.g_ret_sts_error;
1562: RETURN;
1563: END IF;

Line 1561: x_return_status := fnd_api.g_ret_sts_error;

1557: l_decode_status,
1558: l_decode_msg);
1559: IF(l_decode_status <> fnd_api.g_ret_sts_success) THEN
1560: x_retmsg := 'VC0d41:' || l_decode_msg;
1561: x_return_status := fnd_api.g_ret_sts_error;
1562: RETURN;
1563: END IF;
1564: END LOOP;
1565: END IF;

Line 1566: ELSIF(l_return_status = fnd_api.g_ret_sts_unexp_error) THEN

1562: RETURN;
1563: END IF;
1564: END LOOP;
1565: END IF;
1566: ELSIF(l_return_status = fnd_api.g_ret_sts_unexp_error) THEN
1567: x_retmsg := 'VC0f31:' || l_return_msg;
1568: x_return_status := fnd_api.g_ret_sts_unexp_error;
1569: RETURN;
1570: END IF;

Line 1568: x_return_status := fnd_api.g_ret_sts_unexp_error;

1564: END LOOP;
1565: END IF;
1566: ELSIF(l_return_status = fnd_api.g_ret_sts_unexp_error) THEN
1567: x_retmsg := 'VC0f31:' || l_return_msg;
1568: x_return_status := fnd_api.g_ret_sts_unexp_error;
1569: RETURN;
1570: END IF;
1571:
1572: END IF;

Line 1580: x_return_status := fnd_api.g_ret_sts_error;

1576: x_retmsg := 'VC004';
1577:
1578: IF(p_errortable.req_line_id.count>0) THEN
1579:
1580: x_return_status := fnd_api.g_ret_sts_error;
1581: ELSE
1582:
1583: x_return_status := fnd_api.g_ret_sts_success;
1584: END IF;

Line 1583: x_return_status := fnd_api.g_ret_sts_success;

1579:
1580: x_return_status := fnd_api.g_ret_sts_error;
1581: ELSE
1582:
1583: x_return_status := fnd_api.g_ret_sts_success;
1584: END IF;
1585:
1586:
1587: EXCEPTION WHEN OTHERS THEN

Line 1588: x_return_status := fnd_api.g_ret_sts_unexp_error;

1584: END IF;
1585:
1586:
1587: EXCEPTION WHEN OTHERS THEN
1588: x_return_status := fnd_api.g_ret_sts_unexp_error;
1589: x_retmsg := 'VC_Exp:' || x_retmsg || ':' || SQLERRM;
1590: IF g_fnd_debug = 'Y' THEN
1591: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
1592: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||

Line 1736: x_return_status := fnd_api.g_ret_sts_success;

1732: l_new_total NUMBER;
1733: l_rec_tax NUMBER;
1734: l_nonrec_tax NUMBER;
1735: BEGIN
1736: x_return_status := fnd_api.g_ret_sts_success;
1737:
1738: SELECT
1739: decode(prl.matching_basis, 'AMOUNT', prd.req_line_amount, prl.unit_price * prd.req_line_quantity),
1740: decode(prl.matching_basis, 'AMOUNT', p_dist_amount, nvl(p_price, prl.unit_price) * nvl(p_quantity, prd.req_line_quantity)),

Line 1764: x_return_status := fnd_api.g_ret_sts_unexp_error;

1760: (l_nonrec_tax / l_dist_total) *
1761: l_new_total;
1762: END IF;
1763: EXCEPTION WHEN OTHERS THEN
1764: x_return_status := fnd_api.g_ret_sts_unexp_error;
1765: IF g_fnd_debug = 'Y' THEN
1766: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
1767: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||
1768: l_api_name || '.others_exception', SQLERRM);

Line 2656: x_return_status := fnd_api.g_ret_sts_unexp_error;

2652: END IF;
2653:
2654: EXCEPTION
2655: WHEN OTHERS THEN
2656: x_return_status := fnd_api.g_ret_sts_unexp_error;
2657: fnd_msg_pub.add_exc_msg(g_module_prefix, l_api_name);
2658: END is_on_complex_work_order;
2659:
2660:

Line 2709: x_return_status := fnd_api.g_ret_sts_success;

2705: is_so_cancel varchar2(1):='N';
2706: l_sts varchar2(3);
2707: BEGIN
2708:
2709: x_return_status := fnd_api.g_ret_sts_success;
2710: /*
2711: * If called directly from the UI, we will need to make some extra validations,
2712: * which are also included in IS_REQ_LINE_CHANGEABLE.
2713: */

Line 2754: x_return_status := fnd_api.g_ret_sts_error;

2750: 'Req Line ID:' || p_req_line_id || ' ' ||
2751: 'is Already cancelled');
2752: END IF;
2753: END IF;
2754: x_return_status := fnd_api.g_ret_sts_error;
2755: RETURN;
2756: END IF;
2757:
2758:

Line 2776: IF( l_sts <> fnd_api.g_ret_sts_success OR ( l_sts = fnd_api.g_ret_sts_success AND is_so_cancel = 'N') )THEN

2772: 'Req Line ID:' || p_req_line_id || ' ' ||
2773: 'transferred to so ='||is_so_cancel||' status'||l_sts);
2774: END IF;
2775: END IF;
2776: IF( l_sts <> fnd_api.g_ret_sts_success OR ( l_sts = fnd_api.g_ret_sts_success AND is_so_cancel = 'N') )THEN
2777: x_return_status := fnd_api.g_ret_sts_error;
2778: END IF;
2779: Else
2780: is_internal_line_cancellable(1.0, x_return_status, p_req_line_id);

Line 2777: x_return_status := fnd_api.g_ret_sts_error;

2773: 'transferred to so ='||is_so_cancel||' status'||l_sts);
2774: END IF;
2775: END IF;
2776: IF( l_sts <> fnd_api.g_ret_sts_success OR ( l_sts = fnd_api.g_ret_sts_success AND is_so_cancel = 'N') )THEN
2777: x_return_status := fnd_api.g_ret_sts_error;
2778: END IF;
2779: Else
2780: is_internal_line_cancellable(1.0, x_return_status, p_req_line_id);
2781: END IF;

Line 2806: x_return_status := fnd_api.g_ret_sts_error;

2802: -- If the line is linked to a complex work PO, is not cancellable.
2803: IF(l_po_line_loc_id IS NOT NULL) THEN
2804: is_on_complex_work_order(l_po_line_loc_id, l_is_on_complex_work_po);
2805: IF(l_is_on_complex_work_po = 'Y') THEN
2806: x_return_status := fnd_api.g_ret_sts_error;
2807: END IF;
2808: END IF;
2809:
2810: -- Line is placed on PO. Check if the req is in change pending status

Line 2812: x_return_status := fnd_api.g_ret_sts_error;

2808: END IF;
2809:
2810: -- Line is placed on PO. Check if the req is in change pending status
2811: IF (l_req_change_pending_flag = 'Y' AND l_po_line_loc_id IS NOT NULL) THEN
2812: x_return_status := fnd_api.g_ret_sts_error;
2813: END IF;
2814:
2815: IF (l_modified_by_agent = 'Y') THEN
2816: x_return_status := fnd_api.g_ret_sts_error;

Line 2816: x_return_status := fnd_api.g_ret_sts_error;

2812: x_return_status := fnd_api.g_ret_sts_error;
2813: END IF;
2814:
2815: IF (l_modified_by_agent = 'Y') THEN
2816: x_return_status := fnd_api.g_ret_sts_error;
2817: END IF;
2818:
2819: l_progress := '001';
2820:

Line 2825: IF (x_return_status = fnd_api.g_ret_sts_success AND l_po_line_loc_id IS NOT NULL) THEN

2821: /*
2822: * Final Validation to check if a line can be cancelled will be done by
2823: * calling PO Cancel API to check if the corresponding shipment can be cancelled
2824: */
2825: IF (x_return_status = fnd_api.g_ret_sts_success AND l_po_line_loc_id IS NOT NULL) THEN
2826: IF (p_origin IS NULL) THEN
2827: SELECT COUNT(DISTINCT nvl(prda.requisition_line_id, - 1))
2828: INTO l_count
2829: FROM

Line 2838: x_return_status := fnd_api.g_ret_sts_error;

2834: AND prla.requisition_line_id = p_req_line_id
2835: AND pda.req_distribution_id = prda.distribution_id(+ );
2836:
2837: IF (l_count > 1) THEN
2838: x_return_status := fnd_api.g_ret_sts_error;
2839: RETURN;
2840: END IF;
2841: END IF;
2842:

Line 2897: x_return_status := fnd_api.g_ret_sts_error;

2893: 'Shipment Fully Received');
2894: END IF;
2895: END IF;
2896:
2897: x_return_status := fnd_api.g_ret_sts_error;
2898: RETURN;
2899: END IF;
2900:
2901: l_progress := '004';

Line 2916: x_return_status := fnd_api.g_ret_sts_error;

2912: 'Shipment Fully Billed');
2913: END IF;
2914: END IF;
2915:
2916: x_return_status := fnd_api.g_ret_sts_error;
2917: RETURN;
2918: END IF;
2919:
2920: l_progress := '005';

Line 2939: x_return_status := fnd_api.g_ret_sts_error;

2935: 'Shipment Over Billed');
2936: END IF;
2937: END IF;
2938:
2939: x_return_status := fnd_api.g_ret_sts_error;
2940: RETURN;
2941: END IF;
2942:
2943: l_progress := '006';

Line 2965: x_return_status := fnd_api.g_ret_sts_error;

2961: 'RCV transaction exists for Shipment');
2962: END IF;
2963: END IF;
2964:
2965: x_return_status := fnd_api.g_ret_sts_error;
2966: RETURN;
2967: END IF;
2968:
2969: EXCEPTION

Line 2998: x_return_status := fnd_api.g_ret_sts_error;

2994: 'ASN not Fully Received');
2995: END IF;
2996: END IF;
2997:
2998: x_return_status := fnd_api.g_ret_sts_error;
2999: RETURN;
3000: END IF;
3001:
3002: EXCEPTION

Line 3037: x_return_status := fnd_api.g_ret_sts_error;

3033: 'Shipment Received but not Delivered');
3034: END IF;
3035: END IF;
3036:
3037: x_return_status := fnd_api.g_ret_sts_error;
3038: RETURN;
3039: END IF;
3040:
3041: EXCEPTION

Line 3087: x_return_status := fnd_api.g_ret_sts_error;

3083: 'Distribution Checks Failed');
3084: END IF;
3085: END IF;
3086:
3087: x_return_status := fnd_api.g_ret_sts_error;
3088: RETURN;
3089: END IF;
3090:
3091: EXCEPTION

Line 3131: p_init_msg_list => fnd_api.g_true,

3127: l_progress := '012';
3128:
3129: po_document_control_grp.check_control_action(
3130: p_api_version => 1.0,
3131: p_init_msg_list => fnd_api.g_true,
3132: x_return_status => l_return_status,
3133: p_doc_type => l_po_doc_type,
3134: p_doc_subtype => l_po_doc_subtype,
3135: p_doc_id => l_po_header_id,

Line 3158: IF (l_return_status = fnd_api.g_ret_sts_success) THEN

3154: 'PO_Document_Control_GRP.check_control_action result:' || l_return_status);
3155: END IF;
3156: END IF;
3157:
3158: IF (l_return_status = fnd_api.g_ret_sts_success) THEN
3159: x_return_status := fnd_api.g_ret_sts_success;
3160: ELSE
3161: x_return_status := fnd_api.g_ret_sts_error;
3162: END IF;

Line 3159: x_return_status := fnd_api.g_ret_sts_success;

3155: END IF;
3156: END IF;
3157:
3158: IF (l_return_status = fnd_api.g_ret_sts_success) THEN
3159: x_return_status := fnd_api.g_ret_sts_success;
3160: ELSE
3161: x_return_status := fnd_api.g_ret_sts_error;
3162: END IF;
3163:

Line 3161: x_return_status := fnd_api.g_ret_sts_error;

3157:
3158: IF (l_return_status = fnd_api.g_ret_sts_success) THEN
3159: x_return_status := fnd_api.g_ret_sts_success;
3160: ELSE
3161: x_return_status := fnd_api.g_ret_sts_error;
3162: END IF;
3163:
3164: END IF;
3165: EXCEPTION WHEN OTHERS THEN

Line 3166: x_return_status := fnd_api.g_ret_sts_unexp_error;

3162: END IF;
3163:
3164: END IF;
3165: EXCEPTION WHEN OTHERS THEN
3166: x_return_status := fnd_api.g_ret_sts_unexp_error;
3167: IF (g_fnd_debug = 'Y') THEN
3168: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
3169: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||
3170: l_api_name || '.others_exception',

Line 3229: x_return_status := fnd_api.g_ret_sts_success;

3225: l_transferred_to_oe_flag varchar2(1);
3226: BEGIN
3227:
3228:
3229: x_return_status := fnd_api.g_ret_sts_success;
3230: l_line_changeable_flag := 'Y';
3231: p_price_changeable_flag := 'Y';
3232: p_date_changeable_flag := 'Y';
3233: p_qty_changeable_flag := 'Y';

Line 3410: l_return_status := FND_API.G_RET_STS_ERROR;

3406: IF (l_source_type_code = 'INVENTORY') THEN
3407: l_line_changeable_flag := 'N';
3408:
3409: IF ( nvl(l_transferred_to_oe_flag,'N') = 'Y' ) THEN
3410: l_return_status := FND_API.G_RET_STS_ERROR;
3411: Else
3412: is_internal_line_cancellable(1.0, l_return_status, p_req_line_id);
3413: END IF;
3414:

Line 3415: IF (l_return_status <> fnd_api.g_ret_sts_success) THEN

3411: Else
3412: is_internal_line_cancellable(1.0, l_return_status, p_req_line_id);
3413: END IF;
3414:
3415: IF (l_return_status <> fnd_api.g_ret_sts_success) THEN
3416: p_cancellable_flag := 'N';
3417: END IF;
3418:
3419: --Is there any PO associated with line?(Validation #1 in DLD)

Line 3596: IF(l_return_status = fnd_api.g_ret_sts_error) THEN

3592: * can be cancelled.
3593: */
3594: IF(p_cancellable_flag = 'Y') THEN
3595: is_req_line_cancellable(1.0, l_return_status, p_req_line_id, 'Y');
3596: IF(l_return_status = fnd_api.g_ret_sts_error) THEN
3597: p_cancellable_flag := 'N';
3598: END IF;
3599: END IF;
3600:

Line 3609: x_return_status := fnd_api.g_ret_sts_unexp_error;

3605: l_api_name || '.others_exception',
3606: p_req_line_id || '*' || l_progress || ':' || SQLERRM);
3607: END IF;
3608: END IF;
3609: x_return_status := fnd_api.g_ret_sts_unexp_error;
3610: END is_req_line_changeable;
3611:
3612: /*-------------------------------------------------------------------------------------------------
3613: *This API is called directly from the UI. It will have PLSQL tables as input, which contain change/cancel requests

Line 3616: *x_return_status = FND_API.G_RET_STS_SUCCESS => Everything is Valid, and records are saved into change table

3612: /*-------------------------------------------------------------------------------------------------
3613: *This API is called directly from the UI. It will have PLSQL tables as input, which contain change/cancel requests
3614: *1. Validate the requests
3615: *2. If ALL valid, same them into PO_CHANGE_REQUESTS table
3616: *x_return_status = FND_API.G_RET_STS_SUCCESS => Everything is Valid, and records are saved into change table
3617: * FND_API.G_RET_STS_ERROR => Caught Errors, thus no records are saved into change table
3618: * FND_API.G_RET_STS_UNEXP_ERROR => Unexpected Errors Occur in the API
3619: *x_retMsg will indicate details/location of errors.
3620: ---------------------------------------------------------------------------------------------------*/

Line 3617: * FND_API.G_RET_STS_ERROR => Caught Errors, thus no records are saved into change table

3613: *This API is called directly from the UI. It will have PLSQL tables as input, which contain change/cancel requests
3614: *1. Validate the requests
3615: *2. If ALL valid, same them into PO_CHANGE_REQUESTS table
3616: *x_return_status = FND_API.G_RET_STS_SUCCESS => Everything is Valid, and records are saved into change table
3617: * FND_API.G_RET_STS_ERROR => Caught Errors, thus no records are saved into change table
3618: * FND_API.G_RET_STS_UNEXP_ERROR => Unexpected Errors Occur in the API
3619: *x_retMsg will indicate details/location of errors.
3620: ---------------------------------------------------------------------------------------------------*/
3621: PROCEDURE save_reqchange(p_api_version IN NUMBER,

Line 3618: * FND_API.G_RET_STS_UNEXP_ERROR => Unexpected Errors Occur in the API

3614: *1. Validate the requests
3615: *2. If ALL valid, same them into PO_CHANGE_REQUESTS table
3616: *x_return_status = FND_API.G_RET_STS_SUCCESS => Everything is Valid, and records are saved into change table
3617: * FND_API.G_RET_STS_ERROR => Caught Errors, thus no records are saved into change table
3618: * FND_API.G_RET_STS_UNEXP_ERROR => Unexpected Errors Occur in the API
3619: *x_retMsg will indicate details/location of errors.
3620: ---------------------------------------------------------------------------------------------------*/
3621: PROCEDURE save_reqchange(p_api_version IN NUMBER,
3622: x_return_status OUT NOCOPY VARCHAR2,

Line 3634: l_change_result VARCHAR2(1) := fnd_api.g_ret_sts_success;

3630: l_api_name VARCHAR2(50) := 'Save_ReqChange';
3631: l_req_change_table change_tbl_type;
3632: l_dummy NUMBER;
3633: y NUMBER := 1;
3634: l_change_result VARCHAR2(1) := fnd_api.g_ret_sts_success;
3635: l_cancel_result VARCHAR2(1);
3636: l_err_line_id_tbl po_tbl_number;
3637: l_err_line_num_tbl po_tbl_number;
3638: l_err_dist_id_tbl po_tbl_number;

Line 3787: IF(l_change_result = fnd_api.g_ret_sts_success) THEN

3783: validate_changes(p_req_hdr_id, l_req_change_table, l_change_result, x_retmsg, x_errtable);
3784: END IF;
3785:
3786: --If ALL changes are valid, we will insert change records, and insert cancel records(if any)
3787: IF(l_change_result = fnd_api.g_ret_sts_success) THEN
3788: x_retmsg := 'SRCH004';
3789: SELECT po_chg_request_seq.nextval INTO p_change_request_group_id FROM dual;
3790:
3791: insert_reqchange(l_req_change_table, p_change_request_group_id);

Line 3806: l_cancel_result := fnd_api.g_ret_sts_success;

3802:
3803: x_retmsg := 'SRCH0062';
3804:
3805: --Process Cancellation Requests
3806: l_cancel_result := fnd_api.g_ret_sts_success;
3807:
3808: IF(p_cancel_table IS NOT NULL) THEN
3809: save_reqcancel(1.0, l_cancel_result, p_req_hdr_id, p_cancel_table, l_dummy, x_retmsg, p_change_request_group_id);
3810: END IF;

Line 3813: ELSIF(l_change_result = fnd_api.g_ret_sts_error) THEN

3809: save_reqcancel(1.0, l_cancel_result, p_req_hdr_id, p_cancel_table, l_dummy, x_retmsg, p_change_request_group_id);
3810: END IF;
3811:
3812: x_return_status := l_cancel_result;
3813: ELSIF(l_change_result = fnd_api.g_ret_sts_error) THEN
3814: x_return_status := fnd_api.g_ret_sts_error;
3815: x_retmsg := 'SRCH007';
3816: ELSE
3817: x_return_status := fnd_api.g_ret_sts_error;

Line 3814: x_return_status := fnd_api.g_ret_sts_error;

3810: END IF;
3811:
3812: x_return_status := l_cancel_result;
3813: ELSIF(l_change_result = fnd_api.g_ret_sts_error) THEN
3814: x_return_status := fnd_api.g_ret_sts_error;
3815: x_retmsg := 'SRCH007';
3816: ELSE
3817: x_return_status := fnd_api.g_ret_sts_error;
3818:

Line 3817: x_return_status := fnd_api.g_ret_sts_error;

3813: ELSIF(l_change_result = fnd_api.g_ret_sts_error) THEN
3814: x_return_status := fnd_api.g_ret_sts_error;
3815: x_retmsg := 'SRCH007';
3816: ELSE
3817: x_return_status := fnd_api.g_ret_sts_error;
3818:
3819: END IF;
3820:
3821: EXCEPTION

Line 3824: x_return_status := fnd_api.g_ret_sts_unexp_error;

3820:
3821: EXCEPTION
3822: WHEN OTHERS THEN
3823: x_retmsg := 'SRCHUNEXP:' || x_retmsg || ':' || SQLERRM;
3824: x_return_status := fnd_api.g_ret_sts_unexp_error;
3825: IF g_fnd_debug = 'Y' THEN
3826: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
3827: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||
3828: l_api_name || '.others_exception', x_retmsg);

Line 4003: x_return_status := fnd_api.g_ret_sts_success;

3999:
4000: END LOOP;
4001:
4002:
4003: x_return_status := fnd_api.g_ret_sts_success;
4004: EXCEPTION WHEN OTHERS THEN
4005: x_return_status := fnd_api.g_ret_sts_unexp_error;
4006: IF g_fnd_debug = 'Y' THEN
4007: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN

Line 4005: x_return_status := fnd_api.g_ret_sts_unexp_error;

4001:
4002:
4003: x_return_status := fnd_api.g_ret_sts_success;
4004: EXCEPTION WHEN OTHERS THEN
4005: x_return_status := fnd_api.g_ret_sts_unexp_error;
4006: IF g_fnd_debug = 'Y' THEN
4007: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
4008: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||
4009: l_api_name || '.others_exception', x_retmsg || ':' || SQLERRM);

Line 4054: l_price_changed_flag VARCHAR2(1) := fnd_api.g_false;

4050: l_old_quantity NUMBER;
4051: l_old_tax NUMBER;
4052: l_ship_to_org_id NUMBER;
4053: l_ship_to_loc_id NUMBER;
4054: l_price_changed_flag VARCHAR2(1) := fnd_api.g_false;
4055: l_qty_changed_flag VARCHAR2(1) := fnd_api.g_false;
4056: l_change_exist VARCHAR2(1);
4057: l_cancel_exist VARCHAR2(1);
4058: l_new_price NUMBER;

Line 4055: l_qty_changed_flag VARCHAR2(1) := fnd_api.g_false;

4051: l_old_tax NUMBER;
4052: l_ship_to_org_id NUMBER;
4053: l_ship_to_loc_id NUMBER;
4054: l_price_changed_flag VARCHAR2(1) := fnd_api.g_false;
4055: l_qty_changed_flag VARCHAR2(1) := fnd_api.g_false;
4056: l_change_exist VARCHAR2(1);
4057: l_cancel_exist VARCHAR2(1);
4058: l_new_price NUMBER;
4059: l_new_quantity NUMBER;

Line 4234: x_return_status := fnd_api.g_ret_sts_success;

4230:
4231:
4232: BEGIN
4233: x_retmsg := 'SMRCH000';
4234: x_return_status := fnd_api.g_ret_sts_success;
4235:
4236: --Check if Funds Check is needed
4237: SELECT
4238: nvl(fsp.req_encumbrance_flag, 'N'),

Line 4305: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN

4301: p_make_new_copies_flag => po_document_funds_grp.g_parameter_yes,
4302: p_check_only_flag => po_document_funds_grp.g_parameter_yes);
4303:
4304: -- error handling after calling populate_encumbrance_gt
4305: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
4306: x_retmsg := 'After calling populate_encumbrance_gt';
4307: x_errcode := 'FC_FAIL';
4308: RETURN;
4309: END IF;

Line 4335: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN

4331: p_make_new_copies_flag => po_document_funds_grp.g_parameter_yes,
4332: p_check_only_flag => po_document_funds_grp.g_parameter_yes);
4333:
4334: -- error handling after calling populate_encumbrance_gt
4335: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
4336: x_retmsg := 'After calling populate_encumbrance_gt (release)';
4337: x_errcode := 'FC_FAIL';
4338: RETURN;
4339: END IF;

Line 4537: IF (l_fc_result_status = fnd_api.g_ret_sts_unexp_error) THEN

4533: 'FUNDS CHECK:' || l_fc_result_status ||' PO RETURN CODE:' || l_po_return_code);
4534: END IF;
4535: END IF;
4536:
4537: IF (l_fc_result_status = fnd_api.g_ret_sts_unexp_error) THEN
4538: x_errcode := 'FC_ERROR';
4539: x_return_status := fnd_api.g_ret_sts_error;
4540: RETURN;
4541:

Line 4539: x_return_status := fnd_api.g_ret_sts_error;

4535: END IF;
4536:
4537: IF (l_fc_result_status = fnd_api.g_ret_sts_unexp_error) THEN
4538: x_errcode := 'FC_ERROR';
4539: x_return_status := fnd_api.g_ret_sts_error;
4540: RETURN;
4541:
4542: ELSE
4543:

Line 4545: x_return_status := fnd_api.g_ret_sts_success;

4541:
4542: ELSE
4543:
4544: IF (l_po_return_code = po_document_funds_grp.g_return_success) THEN
4545: x_return_status := fnd_api.g_ret_sts_success;
4546:
4547: ELSE -- there can be warning/error message for other cases
4548:
4549: x_errcode := 'FC_FAIL';

Line 4550: x_return_status := fnd_api.g_ret_sts_error;

4546:
4547: ELSE -- there can be warning/error message for other cases
4548:
4549: x_errcode := 'FC_FAIL';
4550: x_return_status := fnd_api.g_ret_sts_error;
4551:
4552: -- populate x_errTable (output PLSQL table) with the corresponding
4553: -- funds check error messages.
4554:

Line 4702: p_commit => fnd_api.g_false,

4698: --Kick Off Workflow
4699: x_retmsg := 'SMRCH009';
4700: po_reqchangerequestwf_pvt.submit_req_change(
4701: p_api_version => 1.0,
4702: p_commit => fnd_api.g_false,
4703:
4704: p_req_header_id => l_req_hdr_id,
4705: p_note_to_approver => p_note_to_approver,
4706: p_initiator => p_initiator,

Line 4710: x_return_status := fnd_api.g_ret_sts_error;

4706: p_initiator => p_initiator,
4707: x_return_status => l_wf_status);
4708: ELSE
4709: x_errcode := 'VC_FAIL';
4710: x_return_status := fnd_api.g_ret_sts_error;
4711: END IF;
4712: EXCEPTION WHEN OTHERS THEN
4713: x_return_status := fnd_api.g_ret_sts_unexp_error;
4714: x_retmsg := x_retmsg || ':' || SQLERRM;

Line 4713: x_return_status := fnd_api.g_ret_sts_unexp_error;

4709: x_errcode := 'VC_FAIL';
4710: x_return_status := fnd_api.g_ret_sts_error;
4711: END IF;
4712: EXCEPTION WHEN OTHERS THEN
4713: x_return_status := fnd_api.g_ret_sts_unexp_error;
4714: x_retmsg := x_retmsg || ':' || SQLERRM;
4715: IF g_fnd_debug = 'Y' THEN
4716: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
4717: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||

Line 4807: x_return_status := fnd_api.g_ret_sts_success;

4803: END LOOP;
4804:
4805: CLOSE l_cancels_csr;
4806:
4807: x_return_status := fnd_api.g_ret_sts_success;
4808:
4809: --If all requests are valid, update status to "NEW", and kick off Workflow
4810:
4811: IF(p_errtable.req_line_id.count = 0) THEN

Line 4821: p_commit => fnd_api.g_false,

4817: IF (p_origin IS NULL AND l_workflow_needed = 'Y') THEN
4818:
4819: po_reqchangerequestwf_pvt.submit_req_change(
4820: p_api_version => 1.0,
4821: p_commit => fnd_api.g_false,
4822: x_return_status => l_wf_status,
4823: p_req_header_id => l_req_hdr_id,
4824: p_note_to_approver => NULL,
4825: p_initiator => 'REQUESTER');

Line 4828: x_return_status := fnd_api.g_ret_sts_error;

4824: p_note_to_approver => NULL,
4825: p_initiator => 'REQUESTER');
4826: END IF;
4827: ELSE
4828: x_return_status := fnd_api.g_ret_sts_error;
4829: END IF;
4830:
4831: EXCEPTION WHEN OTHERS THEN
4832: x_return_status := fnd_api.g_ret_sts_unexp_error ;

Line 4832: x_return_status := fnd_api.g_ret_sts_unexp_error ;

4828: x_return_status := fnd_api.g_ret_sts_error;
4829: END IF;
4830:
4831: EXCEPTION WHEN OTHERS THEN
4832: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4833: IF g_fnd_debug = 'Y' THEN
4834: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
4835: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||
4836: l_api_name || '.others_exception', SQLERRM);

Line 4856: x_return_status := FND_API.G_RET_STS_SUCCESS;

4852: l_api_name varchar2(50):= 'Is_Internal_Line_Cancellable';
4853: BEGIN
4854: BEGIN
4855:
4856: x_return_status := FND_API.G_RET_STS_SUCCESS;
4857:
4858: SELECT
4859: prl.requisition_line_id,
4860: prh.requisition_header_id

Line 4890: x_return_status := FND_API.G_RET_STS_ERROR;

4886:
4887: EXCEPTION
4888:
4889: WHEN NO_DATA_FOUND THEN
4890: x_return_status := FND_API.G_RET_STS_ERROR;
4891: RETURN;
4892:
4893: WHEN OTHERS THEN
4894: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

Line 4894: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

4890: x_return_status := FND_API.G_RET_STS_ERROR;
4891: RETURN;
4892:
4893: WHEN OTHERS THEN
4894: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4895: IF (g_fnd_debug = 'Y') THEN
4896: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_UNEXPECTED) THEN
4897: FND_LOG.string(FND_LOG.level_unexpected, g_module_prefix ||
4898: l_api_name || '.others_exception',

Line 4911: x_return_status := FND_API.G_RET_STS_ERROR;

4907: BEGIN
4908: IF po_req_lines_sv.val_oe_shipment_in_proc(l_req_header_id,
4909: p_req_line_id) = FALSE
4910: THEN
4911: x_return_status := FND_API.G_RET_STS_ERROR;
4912: RETURN;
4913: END IF;
4914: EXCEPTION
4915: WHEN NO_DATA_FOUND THEN

Line 4916: x_return_status := FND_API.G_RET_STS_ERROR;

4912: RETURN;
4913: END IF;
4914: EXCEPTION
4915: WHEN NO_DATA_FOUND THEN
4916: x_return_status := FND_API.G_RET_STS_ERROR;
4917: RETURN;
4918: END;
4919:
4920: /* Bug : 4639448

Line 4927: x_return_status := FND_API.G_RET_STS_ERROR;

4923: BEGIN
4924: IF po_req_lines_sv.val_reqs_qty_received (l_req_header_id,
4925: p_req_line_id ) = FALSE
4926: THEN
4927: x_return_status := FND_API.G_RET_STS_ERROR;
4928: RETURN;
4929: END IF;
4930: EXCEPTION
4931: WHEN NO_DATA_FOUND THEN

Line 4932: x_return_status := FND_API.G_RET_STS_ERROR;

4928: RETURN;
4929: END IF;
4930: EXCEPTION
4931: WHEN NO_DATA_FOUND THEN
4932: x_return_status := FND_API.G_RET_STS_ERROR;
4933: RETURN;
4934: END;
4935:
4936: END IS_INTERNAL_LINE_CANCELLABLE;

Line 4956: x_return_status := fnd_api.g_ret_sts_success;

4952: X_msg_data varchar2(3000);
4953: l_orgid number;
4954: l_api_version CONSTANT NUMBER := 1.0;
4955: BEGIN
4956: x_return_status := fnd_api.g_ret_sts_success;
4957:
4958: IF g_debug_stmt THEN
4959: po_debug.debug_begin(l_log_head);
4960: po_debug.debug_var(l_log_head, l_progress, 'p_api_version', p_api_version);

Line 4965: IF NOT FND_API.Compatible_API_Call ( l_api_version ,

4961: po_debug.debug_var(l_log_head, l_progress, 'p_req_line_id', p_req_line_id);
4962: po_debug.debug_var(l_log_head, l_progress, 'p_req_header_id', p_req_header_id);
4963: END IF;
4964:
4965: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
4966: p_api_version,
4967: l_api_name ,
4968: G_PKG_NAME )
4969: THEN

Line 4970: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

4966: p_api_version,
4967: l_api_name ,
4968: G_PKG_NAME )
4969: THEN
4970: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4971: END IF;
4972:
4973: IF (p_req_line_id is null and p_req_header_id is null ) then
4974: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

Line 4974: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

4970: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4971: END IF;
4972:
4973: IF (p_req_line_id is null and p_req_header_id is null ) then
4974: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4975: END if;
4976:
4977: IF (p_req_line_id is null and p_req_header_id is not null ) then
4978: l_progress := '001';

Line 5008: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN

5004: IF l_orgid is NOT NULL THEN
5005: PO_MOAC_UTILS_PVT.set_org_context(l_orgid) ; --
5006: END IF;
5007:
5008: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
5009: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5010: ElsE
5011: x_cancellable := por_util_pkg.bool_to_varchar(X_Cancel_Allowed);
5012: END IF;

Line 5009: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

5005: PO_MOAC_UTILS_PVT.set_org_context(l_orgid) ; --
5006: END IF;
5007:
5008: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
5009: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5010: ElsE
5011: x_cancellable := por_util_pkg.bool_to_varchar(X_Cancel_Allowed);
5012: END IF;
5013:

Line 5056: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN

5052: IF l_orgid is NOT NULL THEN
5053: PO_MOAC_UTILS_PVT.set_org_context(l_orgid) ; --
5054: END IF;
5055:
5056: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
5057: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5058: ElsE
5059: x_cancellable := por_util_pkg.bool_to_varchar(X_Cancel_Allowed);
5060: END IF;

Line 5057: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

5053: PO_MOAC_UTILS_PVT.set_org_context(l_orgid) ; --
5054: END IF;
5055:
5056: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
5057: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5058: ElsE
5059: x_cancellable := por_util_pkg.bool_to_varchar(X_Cancel_Allowed);
5060: END IF;
5061: end if;

Line 5069: x_return_status := fnd_api.g_ret_sts_error;

5065: po_debug.debug_end(l_log_head);
5066: end if;
5067: EXCEPTION
5068: WHEN no_data_found THEN
5069: x_return_status := fnd_api.g_ret_sts_error;
5070: RETURN;
5071:
5072: WHEN OTHERS THEN
5073: x_return_status := fnd_api.g_ret_sts_unexp_error;

Line 5073: x_return_status := fnd_api.g_ret_sts_unexp_error;

5069: x_return_status := fnd_api.g_ret_sts_error;
5070: RETURN;
5071:
5072: WHEN OTHERS THEN
5073: x_return_status := fnd_api.g_ret_sts_unexp_error;
5074: IF (g_fnd_debug = 'Y') THEN
5075: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
5076: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||
5077: l_api_name || '.others_exception',

Line 5108: IF NOT FND_API.Compatible_API_Call ( l_api_version ,

5104: l_api_version CONSTANT NUMBER := 1.0;
5105: l_orgid number;
5106: BEGIN
5107:
5108: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
5109: p_api_version,
5110: l_api_name ,
5111: G_PKG_NAME )
5112: THEN

Line 5113: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

5109: p_api_version,
5110: l_api_name ,
5111: G_PKG_NAME )
5112: THEN
5113: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5114: END IF;
5115:
5116: x_return_status := fnd_api.g_ret_sts_success;
5117: l_update_allowed := FALSE;

Line 5116: x_return_status := fnd_api.g_ret_sts_success;

5112: THEN
5113: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5114: END IF;
5115:
5116: x_return_status := fnd_api.g_ret_sts_success;
5117: l_update_allowed := FALSE;
5118: l_cancel_allowed := FALSE;
5119:
5120: IF g_debug_stmt THEN

Line 5176: x_return_status := fnd_api.g_ret_sts_error;

5172: END IF;
5173: EXCEPTION
5174:
5175: WHEN no_data_found THEN
5176: x_return_status := fnd_api.g_ret_sts_error;
5177: RETURN;
5178:
5179: WHEN OTHERS THEN
5180: x_return_status := fnd_api.g_ret_sts_unexp_error;

Line 5180: x_return_status := fnd_api.g_ret_sts_unexp_error;

5176: x_return_status := fnd_api.g_ret_sts_error;
5177: RETURN;
5178:
5179: WHEN OTHERS THEN
5180: x_return_status := fnd_api.g_ret_sts_unexp_error;
5181: IF (g_fnd_debug = 'Y') THEN
5182: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
5183: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||
5184: l_api_name || '.others_exception',

Line 5393: x_return_status := fnd_api.g_ret_sts_success;

5389:
5390: END LOOP;
5391:
5392:
5393: x_return_status := fnd_api.g_ret_sts_success;
5394: EXCEPTION WHEN OTHERS THEN
5395: x_return_status := fnd_api.g_ret_sts_unexp_error;
5396: IF g_fnd_debug = 'Y' THEN
5397: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN

Line 5395: x_return_status := fnd_api.g_ret_sts_unexp_error;

5391:
5392:
5393: x_return_status := fnd_api.g_ret_sts_success;
5394: EXCEPTION WHEN OTHERS THEN
5395: x_return_status := fnd_api.g_ret_sts_unexp_error;
5396: IF g_fnd_debug = 'Y' THEN
5397: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
5398: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||
5399: l_api_name || '.others_exception', l_progress || ':' || SQLERRM);

Line 5408: *x_return_status = FND_API.G_RET_STS_SUCCESS => Everything is Valid, and records are saved into change table

5404: /*-------------------------------------------------------------------------------------------------
5405: *This API is called directly from the UI. It will have PLSQL tables as input, which contain change/cancel requests
5406: *1. Validate the requests
5407: *2. If ALL valid, same them into PO_CHANGE_REQUESTS table
5408: *x_return_status = FND_API.G_RET_STS_SUCCESS => Everything is Valid, and records are saved into change table
5409: * FND_API.G_RET_STS_ERROR => Caught Errors, thus no records are saved into change table
5410: * FND_API.G_RET_STS_UNEXP_ERROR => Unexpected Errors Occur in the API
5411: *x_retMsg will indicate details/location of errors.
5412: ---------------------------------------------------------------------------------------------------*/

Line 5409: * FND_API.G_RET_STS_ERROR => Caught Errors, thus no records are saved into change table

5405: *This API is called directly from the UI. It will have PLSQL tables as input, which contain change/cancel requests
5406: *1. Validate the requests
5407: *2. If ALL valid, same them into PO_CHANGE_REQUESTS table
5408: *x_return_status = FND_API.G_RET_STS_SUCCESS => Everything is Valid, and records are saved into change table
5409: * FND_API.G_RET_STS_ERROR => Caught Errors, thus no records are saved into change table
5410: * FND_API.G_RET_STS_UNEXP_ERROR => Unexpected Errors Occur in the API
5411: *x_retMsg will indicate details/location of errors.
5412: ---------------------------------------------------------------------------------------------------*/
5413: PROCEDURE save_ireqchange(p_api_version IN NUMBER,

Line 5410: * FND_API.G_RET_STS_UNEXP_ERROR => Unexpected Errors Occur in the API

5406: *1. Validate the requests
5407: *2. If ALL valid, same them into PO_CHANGE_REQUESTS table
5408: *x_return_status = FND_API.G_RET_STS_SUCCESS => Everything is Valid, and records are saved into change table
5409: * FND_API.G_RET_STS_ERROR => Caught Errors, thus no records are saved into change table
5410: * FND_API.G_RET_STS_UNEXP_ERROR => Unexpected Errors Occur in the API
5411: *x_retMsg will indicate details/location of errors.
5412: ---------------------------------------------------------------------------------------------------*/
5413: PROCEDURE save_ireqchange(p_api_version IN NUMBER,
5414: x_return_status OUT NOCOPY VARCHAR2,

Line 5426: l_change_result VARCHAR2(1) := fnd_api.g_ret_sts_success;

5422: l_api_name VARCHAR2(50) := 'Save_IReqChange';
5423: l_req_change_table change_tbl_type;
5424: l_dummy NUMBER;
5425: y NUMBER := 1;
5426: l_change_result VARCHAR2(1) := fnd_api.g_ret_sts_success;
5427: l_cancel_result VARCHAR2(1);
5428: l_err_line_id_tbl po_tbl_number;
5429: l_err_line_num_tbl po_tbl_number;
5430: l_err_dist_id_tbl po_tbl_number;

Line 5603: --if(l_change_result = FND_API.G_RET_STS_SUCCESS) then

5599: -- these validations are done online
5600: END IF;
5601:
5602: --If ALL changes are valid, we will insert change records, and insert cancel records(if any)
5603: --if(l_change_result = FND_API.G_RET_STS_SUCCESS) then
5604: x_retmsg := 'SRCH004';
5605: SELECT po_chg_request_seq.nextval INTO p_change_request_group_id FROM dual;
5606:
5607:

Line 5622: l_change_result := fnd_api.g_ret_sts_success;

5618:
5619:
5620:
5621: ---Insert_LineQuantityOrAmount(p_change_request_group_id); not inserting derived record in po_change_request
5622: l_change_result := fnd_api.g_ret_sts_success;
5623: x_retmsg := 'SRCH0061';
5624:
5625: -- Insert_PriceBreakRows(p_change_request_group_id);
5626:

Line 5630: l_cancel_result := fnd_api.g_ret_sts_success;

5626:
5627: x_retmsg := 'SRCH0062';
5628:
5629: --Process Cancellation Requests
5630: l_cancel_result := fnd_api.g_ret_sts_success;
5631:
5632: IF(p_cancel_table IS NOT NULL) THEN
5633: save_ireqcancel(1.0, l_cancel_result, p_req_hdr_id, p_cancel_table, l_dummy, x_retmsg, p_change_request_group_id);
5634: END IF;

Line 5637: x_return_status := fnd_api.g_ret_sts_success;

5633: save_ireqcancel(1.0, l_cancel_result, p_req_hdr_id, p_cancel_table, l_dummy, x_retmsg, p_change_request_group_id);
5634: END IF;
5635:
5636: --x_return_status := l_cancel_result;
5637: x_return_status := fnd_api.g_ret_sts_success;
5638:
5639: IF(l_change_result = fnd_api.g_ret_sts_error) THEN
5640: x_return_status := fnd_api.g_ret_sts_error;
5641: x_retmsg := 'SRCH007';

Line 5639: IF(l_change_result = fnd_api.g_ret_sts_error) THEN

5635:
5636: --x_return_status := l_cancel_result;
5637: x_return_status := fnd_api.g_ret_sts_success;
5638:
5639: IF(l_change_result = fnd_api.g_ret_sts_error) THEN
5640: x_return_status := fnd_api.g_ret_sts_error;
5641: x_retmsg := 'SRCH007';
5642: ELSE
5643: x_return_status := fnd_api.g_ret_sts_success;

Line 5640: x_return_status := fnd_api.g_ret_sts_error;

5636: --x_return_status := l_cancel_result;
5637: x_return_status := fnd_api.g_ret_sts_success;
5638:
5639: IF(l_change_result = fnd_api.g_ret_sts_error) THEN
5640: x_return_status := fnd_api.g_ret_sts_error;
5641: x_retmsg := 'SRCH007';
5642: ELSE
5643: x_return_status := fnd_api.g_ret_sts_success;
5644:

Line 5643: x_return_status := fnd_api.g_ret_sts_success;

5639: IF(l_change_result = fnd_api.g_ret_sts_error) THEN
5640: x_return_status := fnd_api.g_ret_sts_error;
5641: x_retmsg := 'SRCH007';
5642: ELSE
5643: x_return_status := fnd_api.g_ret_sts_success;
5644:
5645: END IF;
5646:
5647: EXCEPTION

Line 5650: x_return_status := fnd_api.g_ret_sts_unexp_error;

5646:
5647: EXCEPTION
5648: WHEN OTHERS THEN
5649: x_retmsg := 'SRCHUNEXP:' || x_retmsg || ':' || SQLERRM;
5650: x_return_status := fnd_api.g_ret_sts_unexp_error;
5651:
5652:
5653:
5654: IF g_fnd_debug = 'Y' THEN

Line 5748: x_return_status := fnd_api.g_ret_sts_success;

5744: END LOOP;
5745:
5746: CLOSE l_cancels_csr;
5747:
5748: x_return_status := fnd_api.g_ret_sts_success;
5749:
5750: --If all requests are valid, update status to "NEW", and kick off Workflow
5751:
5752: IF(p_errtable.req_line_id.count = 0) THEN

Line 5769: p_commit => fnd_api.g_false,

5765: IF (p_origin IS NULL AND l_workflow_needed = 'Y') THEN
5766:
5767: po_reqchangerequestwf_pvt.submit_internal_req_change(
5768: p_api_version => 1.0,
5769: p_commit => fnd_api.g_false,
5770: x_return_status => l_wf_status,
5771: p_req_header_id => l_req_hdr_id,
5772: p_note_to_approver => NULL,
5773: p_initiator => 'REQUESTER');

Line 5780: x_return_status := fnd_api.g_ret_sts_error;

5776:
5777:
5778:
5779: ELSE
5780: x_return_status := fnd_api.g_ret_sts_error;
5781: END IF;
5782:
5783: EXCEPTION WHEN OTHERS THEN
5784: x_return_status := fnd_api.g_ret_sts_unexp_error ;

Line 5784: x_return_status := fnd_api.g_ret_sts_unexp_error ;

5780: x_return_status := fnd_api.g_ret_sts_error;
5781: END IF;
5782:
5783: EXCEPTION WHEN OTHERS THEN
5784: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5785: IF g_fnd_debug = 'Y' THEN
5786: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
5787: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||
5788: l_api_name || '.others_exception', SQLERRM);

Line 5814: x_return_status := fnd_api.g_ret_sts_success;

5810: x_preparer_name,
5811: x_preparer_display_name);
5812:
5813:
5814: x_return_status := fnd_api.g_ret_sts_success;
5815: END get_preparer_name;
5816:
5817:
5818:

Line 5864: x_return_status := FND_API.G_RET_STS_ERROR;

5860: END;
5861:
5862: IF (l_count <> 0 ) THEN
5863:
5864: x_return_status := FND_API.G_RET_STS_ERROR;
5865: IF g_debug_stmt THEN
5866: po_debug.debug_begin(l_log_head);
5867: po_debug.debug_var(l_log_head, l_progress, 'p_req_hdr_id', p_req_hdr_id);
5868: po_debug.debug_var(l_log_head, l_progress, 'p_req_line_id', p_req_line_id);

Line 5882: l_return_status := fnd_api.g_ret_sts_success;

5878: Step 1: Retrive the open receiving quantity INTO l_open_quantity
5879: Step 2 : Retrive the REQ LINE quantity INTO l_quantity
5880: */
5881:
5882: l_return_status := fnd_api.g_ret_sts_success;
5883: l_progress:='001';
5884:
5885: IF g_debug_stmt THEN
5886: po_debug.debug_begin(l_log_head);

Line 5918: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

5914: EXCEPTION
5915: WHEN NO_DATA_FOUND THEN
5916: l_open_quantity := 0;
5917: WHEN OTHERS THEN
5918: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5919: END;
5920: BEGIN
5921: SELECT QUANTITY, nvl(QUANTITY_DELIVERED,0)
5922: INTO l_quantity, l_quantity_delivered

Line 5927: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

5923: FROM po_requisition_lines_all
5924: WHERE REQUISITION_LINE_ID=l_req_line_id;
5925: EXCEPTION
5926: WHEN OTHERS THEN
5927: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5928: END;
5929: l_progress:='003';
5930:
5931: IF g_debug_stmt THEN

Line 5938: x_return_status:= FND_API.G_RET_STS_ERROR;

5934: po_debug.debug_var(l_log_head, l_progress, 'l_open_quantity', l_open_quantity);
5935: END IF;
5936: IF (l_open_quantity IS NOT NULL AND l_quantity IS NOT NULL ) THEN
5937: IF (l_quantity - l_open_quantity = 0) THEN
5938: x_return_status:= FND_API.G_RET_STS_ERROR;
5939: RETURN;
5940: ELSE
5941: IF (l_quantity - l_open_quantity > 0) THEN
5942: -- THIS CAN BE EITHER CANCELLATION OR UPDATE

Line 5993: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

5989: EXCEPTION
5990: WHEN NO_DATA_FOUND THEN
5991: l_open_quantity := 0;
5992: WHEN OTHERS THEN
5993: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5994: END;
5995: BEGIN
5996: SELECT QUANTITY, nvl(QUANTITY_DELIVERED,0)
5997: INTO l_quantity, l_quantity_delivered

Line 6002: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

5998: FROM po_requisition_lines_all
5999: WHERE REQUISITION_LINE_ID=p_req_line_id;
6000: EXCEPTION
6001: WHEN OTHERS THEN
6002: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6003: END;
6004:
6005: IF g_debug_stmt THEN
6006: po_debug.debug_var(l_log_head, l_progress, 'l_quantity', l_quantity);

Line 6013: x_return_status:= FND_API.G_RET_STS_ERROR;

6009: END IF;
6010:
6011: IF (l_open_quantity IS NOT NULL AND l_quantity IS NOT NULL ) THEN
6012: IF (l_quantity - l_open_quantity = 0) THEN
6013: x_return_status:= FND_API.G_RET_STS_ERROR;
6014: IF g_debug_stmt THEN
6015: po_debug.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
6016: END IF;
6017:

Line 6049: x_return_status := fnd_api.g_ret_sts_success;

6045: IF g_debug_stmt THEN
6046: po_debug.debug_var(l_log_head, l_progress, 'l_return_status', l_return_status);
6047: END IF;
6048:
6049: x_return_status := fnd_api.g_ret_sts_success;
6050:
6051: EXCEPTION
6052: WHEN OTHERS THEN
6053: x_return_status:= FND_API.G_RET_STS_ERROR;

Line 6053: x_return_status:= FND_API.G_RET_STS_ERROR;

6049: x_return_status := fnd_api.g_ret_sts_success;
6050:
6051: EXCEPTION
6052: WHEN OTHERS THEN
6053: x_return_status:= FND_API.G_RET_STS_ERROR;
6054: ROLLBACK TO update_reqcancel_from_so_sp;
6055: END update_reqcancel_from_so;
6056:
6057:

Line 6092: x_return_status := FND_API.G_RET_STS_ERROR;

6088: l_count :=0;
6089: END;
6090:
6091: IF (l_count <> 0 ) THEN
6092: x_return_status := FND_API.G_RET_STS_ERROR;
6093: return;
6094: END IF;
6095:
6096: -- have save point

Line 6098: l_return_status := fnd_api.g_ret_sts_success;

6094: END IF;
6095:
6096: -- have save point
6097: SAVEPOINT update_reqchange_from_so_s;
6098: l_return_status := fnd_api.g_ret_sts_success;
6099:
6100: --algo
6101: -- for the given req line the given attribute needs to be chnaged
6102: -- for quantity .. input is the delta qunatity = new qunatity-old quantity

Line 6144: x_return_status := fnd_api.g_ret_sts_success;

6140: ROLLBACK TO update_reqchange_from_so_s;
6141: END;
6142:
6143: END IF;
6144: x_return_status := fnd_api.g_ret_sts_success;
6145:
6146: END update_reqchange_from_so;
6147:
6148:

Line 6181: l_qty_changed_flag VARCHAR2(1) := fnd_api.g_false;

6177: l_budget_account_id NUMBER;
6178: l_gl_date DATE;
6179: l_old_quantity NUMBER;
6180: l_old_tax NUMBER;
6181: l_qty_changed_flag VARCHAR2(1) := fnd_api.g_false;
6182: l_change_exist VARCHAR2(1);
6183: l_cancel_exist VARCHAR2(1);
6184: l_new_quantity NUMBER;
6185: l_new_so_quantity NUMBER;

Line 6341: x_return_status := fnd_api.g_ret_sts_error;

6337: prla.requisition_line_id = prda.requisition_line_id AND
6338: pcr.document_line_id = prla.requisition_line_id ;
6339:
6340: BEGIN
6341: x_return_status := fnd_api.g_ret_sts_error;
6342: x_retmsg := 'SMRCH000';
6343: x_return_status := fnd_api.g_ret_sts_success;
6344:
6345: --Check if Funds Check is needed

Line 6343: x_return_status := fnd_api.g_ret_sts_success;

6339:
6340: BEGIN
6341: x_return_status := fnd_api.g_ret_sts_error;
6342: x_retmsg := 'SMRCH000';
6343: x_return_status := fnd_api.g_ret_sts_success;
6344:
6345: --Check if Funds Check is needed
6346: SELECT
6347: nvl(fsp.req_encumbrance_flag, 'N')

Line 6441: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN

6437: p_make_new_copies_flag => po_document_funds_grp.g_parameter_yes,
6438: p_check_only_flag => po_document_funds_grp.g_parameter_yes);
6439:
6440: -- error handling after calling populate_encumbrance_gt
6441: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
6442: x_retmsg := 'After calling populate_encumbrance_gt';
6443: x_errcode := 'FC_FAIL';
6444: IF g_debug_stmt THEN
6445: po_debug.debug_stmt(l_log_head, x_retmsg,'error exists with funds check');

Line 6537: IF (l_fc_result_status = fnd_api.g_ret_sts_unexp_error) THEN

6533: 'FUNDS CHECK:' || l_fc_result_status ||' PO RETURN CODE:' || l_po_return_code);
6534: END IF;
6535: END IF;
6536:
6537: IF (l_fc_result_status = fnd_api.g_ret_sts_unexp_error) THEN
6538: x_errcode := 'FC_ERROR';
6539: x_return_status := fnd_api.g_ret_sts_error;
6540: RETURN;
6541:

Line 6539: x_return_status := fnd_api.g_ret_sts_error;

6535: END IF;
6536:
6537: IF (l_fc_result_status = fnd_api.g_ret_sts_unexp_error) THEN
6538: x_errcode := 'FC_ERROR';
6539: x_return_status := fnd_api.g_ret_sts_error;
6540: RETURN;
6541:
6542: ELSE
6543: IF g_debug_stmt THEN

Line 6549: x_return_status := fnd_api.g_ret_sts_success;

6545: END IF;
6546:
6547:
6548: IF (l_po_return_code = po_document_funds_grp.g_return_success) THEN
6549: x_return_status := fnd_api.g_ret_sts_success;
6550:
6551: ELSE -- there can be warning/error message for other cases
6552:
6553: x_errcode := 'FC_FAIL';

Line 6554: x_return_status := fnd_api.g_ret_sts_error;

6550:
6551: ELSE -- there can be warning/error message for other cases
6552:
6553: x_errcode := 'FC_FAIL';
6554: x_return_status := fnd_api.g_ret_sts_error;
6555:
6556: -- populate x_errTable (output PLSQL table) with the corresponding
6557: -- funds check error messages.
6558:

Line 6717: p_commit => fnd_api.g_false,

6713: x_retmsg := 'SMRCH009';
6714:
6715: po_reqchangerequestwf_pvt.submit_internal_req_change(
6716: p_api_version => 1.0,
6717: p_commit => fnd_api.g_false,
6718: p_req_header_id => l_req_hdr_id,
6719: p_note_to_approver => p_note_to_approver,
6720: p_initiator => p_initiator,
6721: x_return_status => l_wf_status);

Line 6724: x_return_status := fnd_api.g_ret_sts_error;

6720: p_initiator => p_initiator,
6721: x_return_status => l_wf_status);
6722: ELSE
6723: x_errcode := 'VC_FAIL';
6724: x_return_status := fnd_api.g_ret_sts_error;
6725: END IF;
6726: EXCEPTION WHEN OTHERS THEN
6727: x_return_status := fnd_api.g_ret_sts_unexp_error;
6728: x_retmsg := x_retmsg || ':' || SQLERRM;

Line 6727: x_return_status := fnd_api.g_ret_sts_unexp_error;

6723: x_errcode := 'VC_FAIL';
6724: x_return_status := fnd_api.g_ret_sts_error;
6725: END IF;
6726: EXCEPTION WHEN OTHERS THEN
6727: x_return_status := fnd_api.g_ret_sts_unexp_error;
6728: x_retmsg := x_retmsg || ':' || SQLERRM;
6729: IF g_fnd_debug = 'Y' THEN
6730: IF (fnd_log.g_current_runtime_level <= fnd_log.level_unexpected) THEN
6731: fnd_log.string(fnd_log.level_unexpected, g_module_prefix ||

Line 6800: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

6796: EXCEPTION
6797: WHEN NO_DATA_FOUND THEN
6798: l_open_quantity := 0;
6799: WHEN OTHERS THEN
6800: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6801: END;
6802:
6803: IF ( p_new_quantity < l_open_quantity ) THEN
6804: RAISE FND_API.G_EXC_ERROR;

Line 6804: RAISE FND_API.G_EXC_ERROR;

6800: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6801: END;
6802:
6803: IF ( p_new_quantity < l_open_quantity ) THEN
6804: RAISE FND_API.G_EXC_ERROR;
6805: END IF;
6806: END IF;
6807: l_delta_quantity := p_new_quantity-p_old_quantity;
6808:

Line 6866: X_return_status:=FND_API.G_RET_STS_ERROR;

6862:
6863: END IF;
6864: exception
6865: when others then
6866: X_return_status:=FND_API.G_RET_STS_ERROR;
6867: IF g_debug_stmt THEN
6868: po_debug.debug_stmt(l_log_head, l_progress, ' Validating the changes in exception'|| sqlerrm);
6869: po_debug.debug_var(l_log_head, l_progress, 'l_orgid', l_orgid);
6870: po_debug.debug_var(l_log_head, l_progress, 'L_msg_data', L_msg_data);