Thursday, November 7, 2013

Pending Receiving Query

select 'Pending Receiving'||'~'||
       to_char(rti.creation_date,'DD-MON-RRRR HH24:MI:SS') ||'~'||
       quantity ||'~'||
       ood.organization_id  l_out
  from rcv_transactions_interface rti,
       org_organization_definitions ood,
       mtl_system_items msi,
       po_headers_all pha,
       fnd_user fu
 where rti.to_organization_id = ood.organization_id
   and fu.user_id = rti.created_by
   and pha.po_header_id(+) = rti.po_header_id
   and msi.inventory_item_id = rti.item_id
   and msi.organization_id   = 28
   and rti.destination_type_code = 'INVENTORY'
   and ood.organization_id   = nvl(p_org_id,ood.organization_id)
   and (:p_minutes is null or rti.creation_date < SYSDATE - (:p_minutes/(24*60)) )
   order by ood.organization_code, rti.creation_date;

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.