SELECT OOH.ORDER_NUMBER SO,
OOH.ORDERED_DATE,
OOH.ORG_ID,
PRH.SEGMENT1 REQ
FROM OE_ORDER_HEADERS_ALL OOH,
PO_REQUISITION_HEADERS_ALL PRH,
PO_REQUISITION_LINES_ALL PRL
WHERE 1 = 1
AND PRH.REQUISITION_HEADER_ID = PRL.REQUISITION_HEADER_ID
--AND PRH.SEGMENT1 = OOH.ORIG_SYS_DOCUMENT_REF
AND PRH.REQUISITION_HEADER_ID = OOH.SOURCE_DOCUMENT_ID
--AND ORDER_NUMBER = '66534' --SALES
ORDER NUMBER
AND PRH.SEGMENT1 = '300059130'-- REQUISITION NUMBER
AND PRH.TYPE_LOOKUP_CODE = 'INTERNAL'
ORDER BY
OOH.ORDERED_DATE DESC
No comments:
Post a Comment