[Home] [Help]
153: po_asl_api_pvt.Log(p_tolerance_rec);
154: po_asl_api_pvt.Log('p_commit:' || p_commit);
155: --Empty GT tables
156: DELETE FROM po_approved_supplier_list_gt;
157: DELETE FROM po_asl_documents_gt ;
158: DELETE FROM chv_authorizations_gt;
159: DELETE FROM po_asl_attributes_gt;
160: DELETE FROM po_supplier_item_capacity_gt;
161: DELETE FROM po_supplier_item_tolerance_gt;
229: l_progress := 45;
230: --Raise exception in case user_key not found in parent table
231: SELECT Count(*)
232: INTO invalids
233: FROM po_asl_documents_gt
234: WHERE NOT EXISTS
235: (SELECT user_key
236: FROM po_approved_supplier_list_gt);
237:
377: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
378: x_return_msg := 'Unexpected while dumping to po_asl_attributes_gt';
379:
380: WHEN unexp_err_pad THEN
381: po_asl_api_pvt.log('Unexpected while dumping to po_asl_documents_gt');
382: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
383: x_return_msg := 'Unexpected while dumping to po_asl_documents_gt';
384:
385: WHEN unexp_err_chv THEN
379:
380: WHEN unexp_err_pad THEN
381: po_asl_api_pvt.log('Unexpected while dumping to po_asl_documents_gt');
382: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
383: x_return_msg := 'Unexpected while dumping to po_asl_documents_gt';
384:
385: WHEN unexp_err_chv THEN
386: po_asl_api_pvt.log('Unexpected while dumping to chv_authorizations_gt');
387: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
442: x_return_msg => x_return_msg
443: );
444: l_progress := 10;
445:
446: --updating po_asl_documents_gt to derive id fields
447: derive_ids_podoc(
448: x_return_status => x_return_status,
449: x_return_msg => x_return_msg
450: );
893:
894: --NAME: dump_to_asl_doc_gtt
895:
896: --FUNCTION:
897: -- this will dump all the data from p_asl_doc_rec to po_asl_documents_gt
898:
899: --parameters:
900:
901: --IN:
920: po_asl_api_pvt.log(p_asl_doc_rec);
921: x_return_msg := NULL;
922:
923: FORALL l_index IN 1 .. p_asl_doc_rec.user_key.Count
924: INSERT INTO po_asl_documents_gt (
925: session_key ,
926: user_key ,
927: process_action ,
928: asl_id ,
1495:
1496: --NAME: derive_ids_podoc
1497:
1498: --FUNCTION:
1499: -- this will derive ids for the display fields in po_asl_documents_gt
1500: -- which ever applicabale
1501:
1502: --parameters:
1503:
1516: l_progress NUMBER := 0;
1517: BEGIN
1518: po_asl_api_pvt.log('START ::: derive_ids_podoc');
1519:
1520: UPDATE po_asl_documents_gt padt
1521: SET padt.using_organization_id =
1522: (SELECT hout.organization_id
1523: FROM hr_all_organization_units_tl hout
1524: WHERE hout.name = padt.using_organization_dsp
1526: AND ROWNUM < 2)
1527: WHERE padt.using_organization_dsp IS NOT NULL;
1528: l_progress := 25;
1529:
1530: UPDATE po_asl_documents_gt padt
1531: SET padt.document_type_code =
1532: (SELECT polc.lookup_code
1533: FROM po_lookup_codes polc
1534: WHERE polc.lookup_type = 'SOURCE DOCUMENT TYPE'
1536: AND ROWNUM < 2)
1537: WHERE padt.document_type_dsp IS NOT NULL;
1538: l_progress := 50;
1539:
1540: UPDATE po_asl_documents_gt padt
1541: SET padt.document_header_id =
1542: get_doc_header (p_user_key => padt.user_key ,
1543: p_doc_type => padt.document_type_code ,
1544: p_using_org_id => padt.using_organization_id ,
1545: p_segment => padt.document_header_dsp)
1546: WHERE padt.document_header_dsp IS NOT NULL;
1547: l_progress := 75;
1548:
1549: UPDATE po_asl_documents_gt padt
1550: SET padt.document_line_id =
1551: get_doc_line_id(p_user_key => padt.user_key ,
1552: p_header_id => padt.document_header_id ,
1553: p_using_org_id => padt.using_organization_id ,
1553: p_using_org_id => padt.using_organization_id ,
1554: p_line_num => padt.document_line_num_dsp)
1555: WHERE document_line_num_dsp IS NOT NULL;
1556: l_progress := 100;
1557: po_asl_api_pvt.log('derive_ids_podoc UPDATE po_asl_documents_gt rowcount:'
1558: || SQL%ROWCOUNT);
1559: po_asl_api_pvt.log('END ::: derive_ids_podoc');
1560: EXCEPTION
1561:
2295:
2296: --FUNCTION:
2297: -- This will collect userkeys for which ids not found for the descriptions
2298: -- in chv_authorizations_gt, po_supplier_item_capacity_gt,
2299: -- po_supplier_item_tolerance_gt, po_asl_documents_gt tables.
2300:
2301: --PARAMETERS:
2302: --IN:
2303: -- p_user_key_tbl po_tbl_number
2345:
2346: UNION ALL
2347:
2348: SELECT user_key ,
2349: 'po_asl_documents_gt' AS entity ,
2350: fnd_message.get_string('PO','DOC_TYPE_NOT_FOUND') AS msg
2351: FROM po_asl_documents_gt
2352: WHERE document_type_dsp IS NOT NULL
2353: AND document_type_code IS NULL
2347:
2348: SELECT user_key ,
2349: 'po_asl_documents_gt' AS entity ,
2350: fnd_message.get_string('PO','DOC_TYPE_NOT_FOUND') AS msg
2351: FROM po_asl_documents_gt
2352: WHERE document_type_dsp IS NOT NULL
2353: AND document_type_code IS NULL
2354:
2355: UNION ALL
2354:
2355: UNION ALL
2356:
2357: SELECT user_key ,
2358: 'po_asl_documents_gt' AS entity ,
2359: fnd_message.get_string('PO','DOC_HEADER_NOT_FOUND') AS msg
2360: FROM po_asl_documents_gt
2361: WHERE document_header_dsp IS NOT NULL
2362: AND document_header_id IS NULL
2356:
2357: SELECT user_key ,
2358: 'po_asl_documents_gt' AS entity ,
2359: fnd_message.get_string('PO','DOC_HEADER_NOT_FOUND') AS msg
2360: FROM po_asl_documents_gt
2361: WHERE document_header_dsp IS NOT NULL
2362: AND document_header_id IS NULL
2363:
2364: UNION ALL
2363:
2364: UNION ALL
2365:
2366: SELECT user_key ,
2367: 'po_asl_documents_gt' AS entity ,
2368: fnd_message.get_string('PO','DOC_LINE_NOT_FOUND') AS msg
2369: FROM po_asl_documents_gt
2370: WHERE document_line_num_dsp IS NOT NULL
2371: AND document_line_id IS NULL
2365:
2366: SELECT user_key ,
2367: 'po_asl_documents_gt' AS entity ,
2368: fnd_message.get_string('PO','DOC_LINE_NOT_FOUND') AS msg
2369: FROM po_asl_documents_gt
2370: WHERE document_line_num_dsp IS NOT NULL
2371: AND document_line_id IS NULL
2372:
2373: );
2388: (
2389: --Reject records if ASL Process action is create and document's process
2390: --action is delete/update
2391: SELECT PAD.user_key ,
2392: 'po_asl_documents_gt' AS entity ,
2393: fnd_message.get_string('PO','INVALID_PAD_ACTION') AS msg
2394: FROM po_asl_documents_gt PAD,
2395: po_approved_supplier_list_gt ASL
2396: WHERE ASL.user_key = PAD.user_key
2390: --action is delete/update
2391: SELECT PAD.user_key ,
2392: 'po_asl_documents_gt' AS entity ,
2393: fnd_message.get_string('PO','INVALID_PAD_ACTION') AS msg
2394: FROM po_asl_documents_gt PAD,
2395: po_approved_supplier_list_gt ASL
2396: WHERE ASL.user_key = PAD.user_key
2397: AND ASL.process_action = PO_ASL_API_PUB.g_ACTION_CREATE
2398: AND PAD.process_action <> PO_ASL_API_PUB.g_ACTION_ADD
2449: l_rejection_reason
2450: FROM
2451: (
2452: SELECT user_key ,
2453: 'po_asl_documents_gt' AS entity ,
2454: fnd_message.get_string('PO','USING_ORG_NOT_FOUND') AS msg
2455: FROM po_asl_documents_gt
2456: WHERE using_organization_dsp IS NOT NULL
2457: AND using_organization_id IS NULL
2451: (
2452: SELECT user_key ,
2453: 'po_asl_documents_gt' AS entity ,
2454: fnd_message.get_string('PO','USING_ORG_NOT_FOUND') AS msg
2455: FROM po_asl_documents_gt
2456: WHERE using_organization_dsp IS NOT NULL
2457: AND using_organization_id IS NULL
2458:
2459: UNION ALL
2499: l_rejection_reason
2500: FROM
2501: (
2502: SELECT user_key ,
2503: 'po_asl_documents_gt' AS entity ,
2504: fnd_message.get_string('PO','INVALID_PROCESS_ACTION') AS msg
2505: FROM po_asl_documents_gt
2506: WHERE process_action NOT IN
2507: (PO_ASL_API_PUB.g_ACTION_ADD ,
2501: (
2502: SELECT user_key ,
2503: 'po_asl_documents_gt' AS entity ,
2504: fnd_message.get_string('PO','INVALID_PROCESS_ACTION') AS msg
2505: FROM po_asl_documents_gt
2506: WHERE process_action NOT IN
2507: (PO_ASL_API_PUB.g_ACTION_ADD ,
2508: PO_ASL_API_PUB.g_ACTION_UPDATE,
2509: PO_ASL_API_PUB.g_ACTION_DELETE)