This content has been marked as final. Show 5 replies
843714 wrote:Check this script..I think it will return all the associated requistions on PO..so change the query accordingly
Plz reply asap.....it's urgent
Note i have taken ex of standard PO only here..and the agent_id is the particular buyer associated with it..
select pha.PO_HEADER_ID, pha.SEGMENT1 ,pha.CREATION_DATE,pha.CREATED_BY,pha.AGENT_ID,prha.SEGMENT1 as req
order by pha.SEGMENT1
Let me know if it has helped you in anyway
SELECT prha.segment1 req#, prla.line_num, prda.requisition_line_id FROM po_req_distributions_all prda, po_requisition_lines_all prla, po_requisition_headers_all prha WHERE prda.requisition_line_id = prla.requisition_line_id AND prla.requisition_header_id = prha.requisition_header_id AND NOT EXISTS (SELECT 1 FROM po_distributions_all pda WHERE pda.req_distribution_id = prda.distribution_id)
If the PO was created from a req., then the req gets linked to the PO with the req_distribution_id.
Such requisitions will not show up on the query.
If the user simply typed in the requisition number in the distribution area when creating a PO, then there is no link. And therefore the req. will show up.
You should stop users from doing that.