Search This Blog

Thursday, 7 June 2012

Approved Requisition Report


Approved Requisition Report


SELECT PRHA.SEGMENT1 REQNUM,
       PRHA.TYPE_LOOKUP_CODE REQTYPE,
       PRHA.CREATION_DATE REQDATE,
       PAPF.FULL_NAME PREPARERNAME,
       PRLL.LINE_NUM,
       PRLL.QUANTITY,
       PRLL.UNIT_PRICE,
       MSI.SEGMENT1 ITEM,
       MSI.DESCRIPTION,
       (PRLL.QUANTITY * PRLL.UNIT_PRICE) AMOUNT,
       GCC.CONCATENATED_SEGMENTS CHARGEACCOUNT,
       OOD.ORGANIZATION_CODE ORGNAME,
       PAPF.FULL_NAME REQUESTOR,
       HL.LOCATION_CODE LOCATIONNAME
  FROM PO_REQUISITION_HEADERS_ALL PRHA,
       PO_REQUISITION_LINES_ALL PRLL,
       MTL_SYSTEM_ITEMS_B MSI,
       PO_REQ_DISTRIBUTIONS_ALL PRDA,
       GL_CODE_COMBINATIONS_KFV GCC,
       GL_SETS_OF_BOOKS GSB,
       ORG_ORGANIZATION_DEFINITIONS OOD,
       PER_ALL_PEOPLE_F PAPF,
       HR_LOCATIONS HL
 WHERE PRHA.REQUISITION_HEADER_ID=PRLL.REQUISITION_HEADER_ID
   AND PRLL.ITEM_ID=MSI.INVENTORY_ITEM_ID
   AND PRLL.DESTINATION_ORGANIZATION_ID=MSI.ORGANIZATION_ID
   AND PRLL.REQUISITION_LINE_ID=PRDA.REQUISITION_LINE_ID
   AND PRDA.CODE_COMBINATION_ID=GCC.CODE_COMBINATION_ID
   AND GCC.CHART_OF_ACCOUNTS_ID=GSB.CHART_OF_ACCOUNTS_ID
   AND GSB.SET_OF_BOOKS_ID=PRDA.SET_OF_BOOKS_ID
   AND OOD.ORGANIZATION_ID = MSI.ORGANIZATION_ID
   AND PAPF.PERSON_ID=PRHA.PREPARER_ID
   AND HL.LOCATION_ID=PRLL.DELIVER_TO_LOCATION_ID
   AND PRHA.AUTHORIZATION_STATUS = 'APPROVED'
   AND PRHA.ORG_ID=204
  -- AND  PRHA.SEGMENT1='2738'  
   AND ROWNUM<200
   ORDER BY 1,5 DESC
 

No comments:

Post a Comment