Query to Check Shipping Exceptions on a Sales Order Line

Shipping exceptions in Oracle Shipping Execution (for example a quantity change, an item not available, or a hold on a delivery) are logged in WSH_EXCEPTIONS and can stop a line from shipping or interfacing to Inventory. The query below takes an order line ID and returns each of its delivery details with the item, the inventory interface flag and a Y/N flag that says whether an open (not CLOSED) exception exists for it.

SQL: delivery details with shipping exception flag

select 
  organization_id, 
  INV_INTERFACED_FLAG, 
  SOURCE_HEADER_NUMBER, 
  SOURCE_LINE_NUMBER, 
  TRANSACTION_ID, 
  (
    select 
      segment1 
    from 
      mtl_system_items_b msib 
    where 
      msib.organization_id = wdd.organization_id 
      and msib.inventory_item_id = wdd.inventory_item_id
  ) item, 
  decode (
    nvl(
      (
        select 
          count(1) 
        from 
          apps.wsh_exceptions 
        where 
          STATUS != 'CLOSED' 
          and delivery_detail_id = wdd.delivery_detail_id
      ), 
      0
    ), 
    0, 
    'N', 
    'Y'
  ) shipping_exception, 
  wdd.* 
from 
  apps.wsh_delivery_details wdd 
where 
  source_line_id = 12440256;

Notes

  • Replace source_line_id = 12440256 with OE_ORDER_LINES_ALL.LINE_ID.
  • INV_INTERFACED_FLAG: Y interfaced to Inventory, N not interfaced, P pending. Lines stuck at N or P after ship confirm need the Interface Trip Stop program.
  • To read the exceptions themselves, query WSH_EXCEPTIONS by DELIVERY_DETAIL_ID and look at EXCEPTION_NAME, STATUS and MESSAGE.
  • Exceptions can be viewed and closed from the Shipping Exceptions window in the Shipping Transactions form.

Which table stores shipping exceptions in Oracle EBS?

WSH_EXCEPTIONS, linked to delivery details, deliveries or trip stops.

What does INV_INTERFACED_FLAG mean on WSH_DELIVERY_DETAILS?

It shows whether the shipped line has been interfaced to Inventory: Y yes, N no, P partially or pending.

Related queries

Related posts: Upload your own post and refer it anywhere anytime:

Leave a Comment