Query Documents created for the Supply Order Lines.
SELECT dsh.SUPPLY_ORDER_NUMBER ,
dsl.LINE_NUMBER ,
dsh.SUPPLY_ORDER_REFERENCE_NUMBER ,
dsl.SUPPLY_ORDER_REF_LINE_NUMBER ,
dsl.quantity line_qty ,
dstl.quantity tl_qty ,
dstl.available_quantity avail_qty ,
dstld.document_line_quantity doc_qty ,
dstld.document_net_quantity doc_net_qty ,
dsh.header_id ,
dstld.document_type doc_type ,
DECODE (dstld.document_type,'ORA_PR','Purchase Requisition','ORA_PO','Purchase Order','ORA_RSV','Reservation','ORA_RCPT','Receipt','ORA_TO','Transfer Order','ORA_WO','Work Order','ORA_SH','Shipment') "Document Type",
dsl.supply_type suptype ,
dstld.document_number doc_num ,
dstld.document_line_number doc_line ,
dstld.document_header_id doc_id ,
dstld.document_line_id dline_id ,
dstld.document_status doc_sts ,
dsh.status_code hdr_status ,
dsl.status_code line_status ,
dstl.status_code tl_status ,
dsl.need_by_date line_date ,
dstl.need_by_date tline_date ,
dstld.status_as_of_date doc_date ,
dstld.creation_date doc_create_date ,
dsl.inventory_item_id item ,
dsl.back_to_back_flag b2b ,
dsl.contract_manufacturing_flag cm ,
dstl.exception_flag Excpn ,
dstl.change_pending_flag chg_flag ,
dstl.open_flag ,
dsh.supply_order_source so_src ,
dsh.supply_order_reference_number ,
dsh.supply_order_reference_id sup_ref_id ,
dsl.supply_order_reference_line_id sup_ref_line_id ,
dsl.line_id ,
dstl.tracking_line_id ,
dsl.destination_organization_id dest_org
FROM fusion.dos_supply_headers dsh ,
fusion.dos_supply_lines dsl ,
fusion.dos_supply_tracking_lines dstl,
fusion.dos_supply_tracking_line_docs dstld
WHERE dsl.header_id = dsh.header_id
AND dstl.line_id = dsl.line_id
AND dstld.tracking_line_id(+) = dstl.tracking_line_id
AND SUPPLY_ORDER_REFERENCE_NUMBER IN ('&SOURCE_ORDER')
ORDER BY dsh.header_id DESC ,
dsl.line_number ,
dstl.tracking_line_id,
dstld.creation_date