Wednesday, 7 December 2016

PO Action History Query

This Query will give you Action History for Standard PO, Blanket Release & Requisition.

/* Formatted on 12/7/2016 12:39:28 PM (QP5 v5.126.903.23003) */
SELECT   OBJECT_TYPE_CODE TYPE,
         SEGMENT1,
         COMMENTS DESCriptions,
         RELEASE_NUM,
         RELEASE_DATE,
         POH.AGENT_ID BUYER_REQ_ID,
         SEQUENCE_NUM,
         ACTION_CODE,
         ACTION_DATE,
         NOTE,
         POAH.EMPLOYEE_ID ACTION_OWNER_ID,
         POH.CREATION_DATE CREATION_DATE,
         POAH.LAST_UPDATE_DATE ACTION_LAST_UPDATE_DATE
  FROM   PO_RELEASES_ALL POR, po_headers_all POH, po_action_history POAH
 WHERE       POR.PO_HEADER_ID = POH.PO_HEADER_ID
         AND POR.PO_RELEASE_ID = POAH.OBJECT_ID
         AND OBJECT_TYPE_CODE = 'RELEASE'
UNION
SELECT   OBJECT_TYPE_CODE,
         SEGMENT1,
         COMMENTS PO_DESC,
         NULL RELEASE_NUM,
         NULL RELEASE_DATE,
         POH.AGENT_ID BUYER_ID,
         SEQUENCE_NUM,
         ACTION_CODE,
         ACTION_DATE,
         NOTE,
         POAH.EMPLOYEE_ID ACTION_OWNER_ID,
         POH.CREATION_DATE PO_CREATION_DATE,
         POAH.LAST_UPDATE_DATE ACTION_LAST_UPDATE_DATE
  FROM   po_headers_all POH, po_action_history POAH
 WHERE   POH.PO_HEADER_ID = POAH.OBJECT_ID AND OBJECT_TYPE_CODE = 'PO'
UNION
SELECT   OBJECT_TYPE_CODE,
         SEGMENT1,
         DESCRIPTION,
         NULL RELEASE_NUM,
         NULL RELEASE_DATE,
         POH.PREPARER_ID,
         SEQUENCE_NUM,
         ACTION_CODE,
         ACTION_DATE,
         NOTE,
         POAH.EMPLOYEE_ID ACTION_OWNER_ID,
         POH.CREATION_DATE PO_CREATION_DATE,
         POAH.LAST_UPDATE_DATE ACTION_LAST_UPDATE_DATE
  FROM   po_requisition_headers_all POH, po_action_history POAH
 WHERE   POH.REQUISITION_HEADER_ID = POAH.OBJECT_ID
         AND OBJECT_TYPE_CODE = 'REQUISITION'



Enjoy and Stay Well !! :)

No comments:

Post a Comment

Power BI: Show Last Data Refresh on Dashboard

 To show last data refresh on Power BI report follow the below steps. 1. Open Report Query Editor Mode. 2. Clink on Get Data -> Blank...