--Find Receipt based on PO Header_ID
select distinct pha.po_header_id , pha.segment1 po_num,
pha.creation_date,
pha.authorization_status,
plla. ship_to_organization_id,
(select organization_code
from apps.org_organization_definitions ood
where ood.organization_id=plla. ship_to_organization_id
) org_code,
pha.org_id,
(select name
from apps.hr_operating_units hou
where hou.organization_id=pha.org_id
) ou_name ,rsh. RECEIPT_NUM
from po.po_headers_all pha ,
po.po_line_locations_all plla ,
po.rcv_shipment_headers rsh ,
po.rcv_shipment_lines rsl
where plla.po_header_id = pha.po_header_id
and rsh.shipment_header_id = rsl.shipment_header_id
and pha.po_header_id = rsl.po_header_id
and pha.po_header_id in (308176, 310167, 309170, 308169,
297167, 296168, 293197, 293195, 293192, 294172, 295174, 293185,
294171, 293182, 293181, 295170, 293179, 293178, 294169, 293176,
285173, 288168, 285168, 281170, 280172, 279168, 278167)
select distinct pha.po_header_id , pha.segment1 po_num,
pha.creation_date,
pha.authorization_status,
plla. ship_to_organization_id,
(select organization_code
from apps.org_organization_definitions ood
where ood.organization_id=plla. ship_to_organization_id
) org_code,
pha.org_id,
(select name
from apps.hr_operating_units hou
where hou.organization_id=pha.org_id
) ou_name ,rsh. RECEIPT_NUM
from po.po_headers_all pha ,
po.po_line_locations_all plla ,
po.rcv_shipment_headers rsh ,
po.rcv_shipment_lines rsl
where plla.po_header_id = pha.po_header_id
and rsh.shipment_header_id = rsl.shipment_header_id
and pha.po_header_id = rsl.po_header_id
and pha.po_header_id in (308176, 310167, 309170, 308169,
297167, 296168, 293197, 293195, 293192, 294172, 295174, 293185,
294171, 293182, 293181, 295170, 293179, 293178, 294169, 293176,
285173, 288168, 285168, 281170, 280172, 279168, 278167)
No comments:
Post a Comment