I have requirement to fetch all the Open PO (Standard & BPA) for given specific item and fall under given specified date. I was able to develop below query, need your help in correcting or modifying it.
SELECT POH.segment1 into l_order_number
FROM PO_LINE_LOCATIONS_ALL POLL1,
POL.PO_LINE_ID = POLL1.PO_LINE_ID
AND NVL (POLL1.promised_date, POLL1.need_by_date) IN