The join between osp PO and work order is thru' po_distributions_all.
The PDA table has wip_entity_id and operation_seq_num.
You can try something like this
SELECT pla.po_line_id, pda.wip_entity_id, wro.operation_seq_num,
wro.inventory_item_id
FROM po_distributions_all pda,
wip_requirement_operations wro,
po_lines_all pla,
wip_discrete_jobs
WHERE pda.wip_entity_id = wro.wip_entity_id
AND wdj.wip_entity_id = wro.wip_entity_id
AND wdj.status_type != 7
AND pda.wip_operation_seq_num = wro.operation_seq_num
AND pla.po_line_id = pda.po_line_id
AND NVL (pda.quantity_ordered, 0) > NVL (pda.quantity_delivered, 0)
AND NVL (pla.cancel_flag, 'N') = 'N'
AND pda.wip_entity_id = &wip_entity_id
The PDA table has wip_entity_id and operation_seq_num.
You can try something like this
SELECT pla.po_line_id, pda.wip_entity_id, wro.operation_seq_num,
wro.inventory_item_id
FROM po_distributions_all pda,
wip_requirement_operations wro,
po_lines_all pla,
wip_discrete_jobs
WHERE pda.wip_entity_id = wro.wip_entity_id
AND wdj.wip_entity_id = wro.wip_entity_id
AND wdj.status_type != 7
AND pda.wip_operation_seq_num = wro.operation_seq_num
AND pla.po_line_id = pda.po_line_id
AND NVL (pda.quantity_ordered, 0) > NVL (pda.quantity_delivered, 0)
AND NVL (pla.cancel_flag, 'N') = 'N'
AND pda.wip_entity_id = &wip_entity_id
No comments:
Post a Comment