You may do the following in PO Shipment form
1=(select 1 from dual
where to_date(:PO_SHIPMENTS.NEED_BY_DATE,'DD-MM-YYYY HH24:MI:SS') NOT between SYSDATE-500 and SYSDATE+30660)
This will pick each shipment(There may be multiple shipment for a PO line) for a single PO_LINE.
Let know if this solved your issue.
Thanks for the given solution, but PO_SHIPMENTS.NEED_BY_DATE is empty, so it doesn't work for me.