Tuesday, June 21, 2011

SO PO Requesition Query

SELECT oh.order_number
,prh.segment1 req_number
,poh.segment1 po_number
FROM oe_order_headers_all oh
,oe_order_lines_all ol
,po_requisition_headers_all prh
,po_requisition_lines_all prl
,po_line_locations_all pol
,po_headers_all poh
,po_lines_all pl
WHERE ol.header_id = oh.header_id
AND prh.interface_source_line_id = ol.line_id
AND prh.interface_source_code = 'CTO'
AND prh.requisition_header_id = prl.requisition_header_id
AND prl.line_location_id = pol.line_location_id
AND pol.po_header_id = poh.po_header_id
AND pol.po_line_id = pl.po_line_id
AND ol.line_id = &sales_order_line_id;

No comments:

Post a Comment

Best Blogger TipsGet Flower Effect