Query the Supply Order and supply lines created for a Sales Order
SELECT dsh.SUPPLY_ORDER_NUMBER ,
dsl.LINE_NUMBER ,
dsh.SUPPLY_ORDER_REFERENCE_NUMBER ,
dsl.SUPPLY_ORDER_REF_LINE_NUMBER, dsh.HEADER_ID ,
dsh.INTERFACE_SOURCE_CODE ,
dsh.INTERFACE_BATCH_NUMBER ,
dsh.SUPPLY_ORDER_NUMBER ,
dsh.SUPPLY_ORDER_SOURCE ,
dsh.SUPPLY_REQUEST_DATE ,
dsh.SUPPLY_ORDER_REFERENCE_NUMBER ,
dsh.SUPPLY_ORDER_REFERENCE_ID ,
dsh.STATUS_CODE ,
dsh.SUPPLY_ORDER_SOURCE ,
dsl.CUSTOMER_ORDER_SOURCE_SYSTEM ,
dsl.ITEM_TYPE ,
dsl.OBJECT_VERSION_NUMBER ,
dsl.PARENT_LINE_ID ,
dsl.LINE_NUMBER ,
dsl.SUPPLY_OPERATION ,
dsl.STATUS_CODE ,
dsl.SUPPLY_TYPE ,
dsl.SUPPLY_SOURCE_SYSTEM ,
dsl.SOURCE_SYSTEM_ID ,
dsl.INVENTORY_ITEM_ID ,
dsl.EXEC_SYSTEM_ITEM_NUMBER ,
dsl.QUANTITY ,
dsl.SUPPLY_ORDER_REFERENCE_LINE_ID ,
dsl.SECONDARY_QUANTITY ,
dsl.SECONDARY_UOM_CODE ,
dsl.NEED_BY_DATE ,
dsl.DESTINATION_ORGANIZATION_ID ,
dsl.DESTINATION_ORGANIZATION_CODE ,
dsl.DESTINATION_BU_ID ,
dsl.CHANGE_PENDING_FLAG ,
dsl.BACK_TO_BACK_FLAG ,
dsl.CONTRACT_MANUFACTURING_FLAG ,
dsl.CONFIG_ITEM_FLAG ,
dsl.CUSTOMER_ORDER_NUMBER ,
dsl.CUSTOMER_ORDER_LINE_NUMBER ,
dsl.CUSTOMER_ORDER_SCHEDULE_NUMBER ,
dsl.CUSTOMER_ID ,
dsl.CUSTOMER_SHIP_TO_ID ,
dsl.CUSTOMER_CONTACT_ID ,
dsl.SPLIT_LINE_REFERENCE_ID ,
dsl.PREPARER_ID ,
dsl.OUTSIDE_PROCESSING_FLAG ,
dsl.MOVEMENT_REQUEST_FLAG
FROM fusion.dos_supply_headers dsh ,
fusion.dos_supply_lines dsl
WHERE dsl.header_id = dsh.header_id
AND SUPPLY_ORDER_REFERENCE_NUMBER IN ('&SOURCE_ORDER')
ORDER BY dsh.header_id DESC ,
dsl.line_number