Req는 작성되어 approved되었는데PO가 발행이 안된 List를 뽑는 View에요.PO하고 PR하고 묶는 방법을 알 수 있을거에요 ——————————————————————————– CREATE OR REPLACE VIEW SKIP_NOT_ISSUED_REQ_LIST_V( REQ_NUM, LINE_NUM, REQUESTER_NAME, REQ_ORG_NAME, REQ_DESCRIPTION, SUGGESTED_BUYER_NAME, ITEM_NUM, ITEM_DESCRIPTION, QUANTITY, APPROVED_DATE, NEED_BY_DATE)ASSELECT HEADERS.SEGMENT1, LINES.LINE_NUM, HRE.LAST_NAME, ORG.NAME, HEADERS.DESCRIPTION, HRE2.LAST_NAME, ITEM.SEGMENT1||’|’||ITEM.SEGMENT2, ITEM.DESCRIPTION, LINES.QUANTITY, HEADERS.LAST_UPDATE_DATE, LINES.NEED_BY_DATE FROM PO_REQUISITION_HEADERS_ALL HEADERS, PO_REQUISITION_LINES_ALL LINES, PO_REQ_DISTRIBUTIONS_ALL DIST, PER_EMPLOYEES_CURRENT_X HRE, PER_EMPLOYEES_CURRENT_X HRE2, PER_ORGANIZATION_UNITS_V ORG, MTL_SYSTEM_ITEMS_B ITEM WHERE not exists (select ‘a’ from po_distributions_all a where a.req_DISTRIBUTION_ID = DIST.DISTRIBUTION_ID) AND HEADERS.REQUISITION_HEADER_ID = LINES.REQUISITION_HEADER_ID AND LINES.REQUISITION_LINE_iD = DIST.REQUISITION_LINE_ID AND HEADERS.PREPARER_ID = HRE.EMPLOYEE_ID(+) AND LINES.DESTINATION_ORGANIZATION_ID = ORG.ORGANIZATION_ID(+) AND LINES.SUGGESTED_BUYER_ID = HRE2.EMPLOYEE_ID(+) AND LINES.ITEM_ID = ITEM.INVENTORY_ITEM_ID(+) AND ITEM.ORGANIZATION_ID(+) = 0 AND HEADERS.AUTHORIZATION_STATUS = ‘APPROVED’ /
top of page
bottom of page
Comments