Re: Link between Purchase Requisition and RFQ
The following sql script can be used to identify all req-rfq links (the order by clause can be changed according to your need)
Code sql:
SELECT rh.segment1 REQ_NUM,
rl.requisition_line_id,
rl.requisition_header_id,
ph.segment1 RFQ_NUM,
pl.po_header_id,
pl.po_line_id
FROM po_requisition_headers_all rh,
po_requisition_lines_all rl,
po_headers_all ph,
po_lines_all pl
WHERE rh.requisition_header_id = rl.requisition_header_id
AND rl.last_update_date = pl.creation_date
AND pl.po_header_id = ph.po_header_id
AND rl.on_rfq_flag = 'Y'
ORDER BY requisition_line_id DESC;
SELECT prha.segment1 "Requisition Number",
prha.type_lookup_code "Requisition Type",
pha.segment1 "Purchase Order Number",
pha.type_lookup_code "Purchase Order Type"
FROM po_headers_all pha,
po_distributions_all pda,
po_req_distributions_all rd,
po_requisition_lines_all prla,
po_requisition_headers_all prha
WHERE pha.po_header_id = pda.po_header_id
AND pda.req_distribution_id = rd.distribution_id
AND rd.requisition_line_id = prla.requisition_line_id
AND prla.requisition_header_id = prha.requisition_header_id