Wednesday, March 30, 2016

SQL -shipped orders



EXEC apps.mo_global.set_policy_context('S','83');

  select ooh.order_number , ool.ordered_item , ool.shipping_quantity_uom , ool.shipped_quantity  , ooh.customer_number, ooh.booked_date , ool.ship_from , wdd.source_header_id
    from   oe_order_lines_v ool
    , oe_order_headers_v ooh
    ,wsh_delivery_details wdd
  where ool.header_id = ooh.header_id
  and   ool.header_id              =  wdd.source_header_id
  AND    ool.line_id                =  wdd.source_line_id
  AND    ool.inventory_item_id      =  wdd.inventory_item_id
  AND    wdd.released_status        =  'C'
   and ool.shipping_quantity_uom = 'EA'
   and ooh.customer_number in ('1000', '1020')
  AND    trunc(ool.actual_shipment_date) >   trunc(sysdate)-2 ;
  and    trunc(ooh.ordered_date) >   trunc(sysdate)-2 ;

No comments: