LINK BETWEEN po_headers_all AND oe_order_headers_all ,link between sales order and purchase order in Oracle apps r12

--LINK BETWEEN po_headers_all AND oe_order_headers_all
--link BETWEEN po AND so IN oracle apps LINK BETWEEN po_headers_all AND oe_order_headers_all
OE_ORDER_LINES_ALL.SOURCE_DOCUMENT_LINE_ID==PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID
OE_ORDER_LINES_ALL.ORIG_SYS_DOCUMENT_REF=PO_REQUISITION_HEADERS_ALL.SEGMENT1(REQUISITION number)

select OOH.ORDER_NUMBER SALES_ORDER,
  PRH.SEGMENT1 REQ,
  PH.SEGMENT1 'PO Number'
from OE_ORDER_HEADERS_ALL OOH,
  PO_REQUISITION_HEADERS_ALL PRH,
  PO_REQUISITION_LINES_ALL PRL,
  PO_REQ_DISTRIBUTIONS_ALL RD,
  PO_HEADERS_ALL PH,
  PO_DISTRIBUTIONS_ALL D
where 1                       = 1
and PRH.REQUISITION_HEADER_ID = PRL.REQUISITION_HEADER_ID
and PRH.REQUISITION_HEADER_ID = OOH.SOURCE_DOCUMENT_ID
and ORDER_NUMBER              = '344444'  --Sales Order Number
and PRH.SEGMENT1              = 'WE23333' -- Requisition Number
and RD.REQUISITION_LINE_ID    = PRL.REQUISITION_LINE_ID
and D.REQ_DISTRIBUTION_ID     = RD.DISTRIBUTION_ID
and PH.PO_HEADER_ID           = D.PO_HEADER_ID link between PO REQUISITION and OE_ORDER_HEADERS_ALL
select OOH.ORDER_NUMBER SALES_ORDER,
  PRH.SEGMENT1 REQUISATION
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.REQUISITION_HEADER_ID = OOH.SOURCE_DOCUMENT_ID
and ORDER_NUMBER              = '344444'  --Sales Order Number
and PRH.SEGMENT1              = 'WE23333' -- Requisition Number
and PRH.TYPE_LOOKUP_CODE      = 'INTERNAL'

--JOIN BETWEEN rcv_shipment_lines AND oe_order_lines_all
select OOH.ORDER_NUMBER SALES_ORDER,
  PRH.SEGMENT1 REQUISATION,
  PH.SEGMENT1 PO_NUMBER,
  RSH.RECEIPT_NUM RECEIPT_NUM
from OE_ORDER_HEADERS_ALL OOH,
  PO_REQUISITION_HEADERS_ALL PRH,
  PO_REQUISITION_LINES_ALL PRL,
  PO_REQ_DISTRIBUTIONS_ALL RD,
  PO_HEADERS_ALL PH,
  PO_DISTRIBUTIONS_ALL D,
  RCV_SHIPMENT_LINES RSL,
  RCV_SHIPMENT_HEADERS RSH
where 1                       = 1
and PRH.REQUISITION_HEADER_ID = PRL.REQUISITION_HEADER_ID
and PRH.REQUISITION_HEADER_ID = OOH.SOURCE_DOCUMENT_ID
and ORDER_NUMBER              = '344444'  --Sales Order Number
and PRH.SEGMENT1              = 'WE23333' -- Requisition Number
and RD.REQUISITION_LINE_ID    = PRL.REQUISITION_LINE_ID
and D.REQ_DISTRIBUTION_ID     = RD.DISTRIBUTION_ID
and PH.PO_HEADER_ID           = D.PO_HEADER_ID
and PH.PO_HEADER_ID           =RSL.PO_HEADER_ID
and RSL.SHIPMENT_HEADER_ID    =RSH.SHIPMENT_HEADER_ID

Post a Comment