ECC Project Manufacturing, Exceptions and Overdues, SQL11

Categories: Enterprise Command Center
Imported from Enterprise Command Center
Description: Project Manufacturing Exceptions and Overdues
Dataset Key: pjm-exceptions-overdues
Security Procedure: PJM_ECC_DATASECURITY_PKG_PUB.GetFilterAttributeValues
Run ECC Project Manufacturing, Exceptions and Overdues, SQL11 and other Oracle EBS reports with Blitz Report™ on our demo environment
select * from ( SELECT /* s62 */  /*+ leading(p3 pp) index(pp PA_PROJECTS_U1) no_push_pred(p3) */    'PROJ_PA_OVERDUE' || '-' ||  PP.PROJECT_ID || '-' || NVL( TO_CHAR(PT.TASK_ID), 'NO_TASK' ) || '-BR_' || TO_CHAR(PL.PO_LINE_ID) AS ECC_SPEC_ID, 'PROJ_EXC' AS RECORD_TYPE,  GREATEST( NVL( PD.last_update_date, to_date('01-01-1990', 'DD-MM-YYYY')) , NVL( PR.last_update_date, to_date('01-01-1990', 'DD-MM-YYYY')) ,  NVL( PLL.last_update_date, to_date('01-01-1990', 'DD-MM-YYYY')) , NVL( PL.last_update_date, to_date('01-01-1990', 'DD-MM-YYYY')) ,  NVL( PH.last_update_date, to_date('01-01-1990', 'DD-MM-YYYY')) , NVL( MIF.last_update_date, to_date('01-01-1990', 'DD-MM-YYYY')) ,  NVL( PP.last_update_date, to_date('01-01-1990', 'DD-MM-YYYY')) , NVL( PT.last_update_date, to_date('01-01-1990', 'DD-MM-YYYY')) ,  NVL( HOU.last_update_date, to_date('01-01-1990', 'DD-MM-YYYY')) ) AS ECC_LAST_UPDATE_DATE, 'Overdue Procurement Activities' AS EXCEPTION_TYPE,  PP.PROJECT_ID AS PROJECT_ID, PP.SEGMENT1 AS PROJECT_NUMBER, PP.ORG_ID AS ORG_ID, PT.TASK_ID AS TASK_ID,  PT.TASK_NUMBER AS TASK_NUMBER, 'Blanket Release' AS ACTIVITY_TYPE,  PH.SEGMENT1 || ',' || TO_CHAR(PR.RELEASE_NUM) AS ACTIVITY_NUMBER,  TO_CHAR(PH.PO_HEADER_ID) || ',' || TO_CHAR(PR.PO_RELEASE_ID) AS ACTIVITY_ID,  brstatus_lkup.meaning AS po_status,  MIF.SEGMENT1 AS ITEM_NUMBER,  HOU.NAME AS PO_SHIP_TO_LOCATION_NAME,  pv.vendor_name        AS po_supplier_name,       pvs.vendor_site_code  AS po_supplier_site_name,  PD.QUANTITY_ORDERED AS QUANTITY_ORDERED, PD.QUANTITY_DELIVERED AS QUANTITY_DELIVERED,  PD.QUANTITY_CANCELLED AS QUANTITY_CANCELLED, PL.UNIT_MEAS_LOOKUP_CODE AS UOM, PLL.PROMISED_DATE AS PA_PROMISED_DATE,  PLL.NEED_BY_DATE AS PA_NEED_BY_DATE, NULL AS PA_DUE_DATE, NULL AS PA_EFFE_START_DATE, NULL AS PA_EFFE_END_DATE,  NVL( PT.START_DATE, PP.START_DATE ) AS START_DATE, NVL( PT.COMPLETION_DATE, PP.COMPLETION_DATE ) AS END_DATE,  HOU.LANGUAGE AS LANGUAGE  FROM PO_DISTRIBUTIONS_ALL PD, PO_RELEASES_ALL PR, PO_LINE_LOCATIONS_ALL PLL, PO_LINES_ALL PL,  		PO_HEADERS_ALL PH,  		po_vendors           pv,   		po_vendor_sites_all  pvs,  		MTL_SYSTEM_ITEMS_B MIF, PA_PROJECTS_ALL PP, PA_TASKS PT, HR_ALL_ORGANIZATION_UNITS_TL HOU,        fnd_lookup_values brstatus_lkup  		,(select distinct project_id from pjm_project_parameters ) p3  		   WHERE pp.start_date >= NVL(to_date('2021/12/12','RRRR/MM/DD HH24:MI:SS'), pp.start_date) and pp.project_id = p3.project_id  and PP.PROJECT_TYPE <> 'AWARD_PROJECT'  AND PP.TEMPLATE_FLAG = 'N'  AND PP.PROJECT_ID = PD.PROJECT_ID  AND PT.TASK_ID(+) = PD.TASK_ID  AND PD.PO_RELEASE_ID IS NOT NULL  AND PR.PO_RELEASE_ID = PD.PO_RELEASE_ID  AND PLL.LINE_LOCATION_ID = PD.LINE_LOCATION_ID  AND PL.PO_LINE_ID = PLL.PO_LINE_ID  AND PH.PO_HEADER_ID = PL.PO_HEADER_ID  AND pvs.vendor_site_id(+) = ph.vendor_site_id   AND pvs.vendor_id(+) = ph.vendor_id             AND pvs.vendor_id = pv.vendor_id(+)             AND NVL( PH.CLOSED_CODE, 'OPEN' ) NOT LIKE '%CLOSED%'  AND NVL( PH.AUTHORIZATION_STATUS, 'N' ) NOT IN ('CANCELLED', 'REJECTED')  AND NVL( PR.CLOSED_CODE, 'OPEN' ) NOT LIKE '%CLOSED%'  AND NVL( PR.AUTHORIZATION_STATUS, 'N' ) NOT IN ('CANCELLED', 'REJECTED')  AND NVL( PR.CANCEL_FLAG, 'N' ) < > 'Y'  AND MIF.ORGANIZATION_ID = PD.DESTINATION_ORGANIZATION_ID  AND MIF.INVENTORY_ITEM_ID = PL.ITEM_ID  AND HOU.ORGANIZATION_ID = PD.DESTINATION_ORGANIZATION_ID  AND NVL( PD.QUANTITY_DELIVERED, 0 ) + NVL( PD.QUANTITY_CANCELLED, 0 ) < NVL( PD.QUANTITY_ORDERED, 0 )  AND SYSDATE > NVL( PT.COMPLETION_DATE, NVL( PP.COMPLETION_DATE, SYSDATE ) )  AND brstatus_lkup.lookup_type = 'DOCUMENT STATE'  AND ((ph.authorization_status IS NOT NULL AND brstatus_lkup.lookup_code = ph.authorization_status)        OR (ph.authorization_status IS NULL AND brstatus_lkup.lookup_code = 'INCOMPLETE'))  AND brstatus_lkup.view_application_id = 201  AND brstatus_lkup.security_group_id = 0  AND brstatus_lkup.language = hou.language  AND HOU.LANGUAGE in ('US')  AND brstatus_lkup.language IN ('US') )  PIVOT ( MAX(PO_SHIP_TO_LOCATION_NAME) AS PO_SHIP_TO_LOCATION_NAME,  MAX (po_status) AS po_status FOR LANGUAGE IN ('US' "US"))
) x
Parameter Name SQL text Validation
Operating Unit
x.org_id in (select haouv.organization_id from hr_all_organization_units_vl haouv where