Search Results get_delivery_info




Overview

WSH_PR_CREATE_DELIVERIES is an Oracle Work in Process and Shipping Execution (WSH) package body owned by APPS. Its business function is the automatic creation and assignment of deliveries during the picking process. When picking line details are staged for confirmation, the package resolves which delivery should own each line, ensuring that shipped lines are consolidated onto the correct delivery before the pick slip is confirmed. The package supports the "autocreate deliveries" behavior within Oracle Shipping Execution, where a delivery is derived programmatically rather than entered manually by a warehouse operator.

The package maintains session-scoped state: an initialization flag, a line counter, and the user and login identifiers inherited from WSH_PR_PICKING_SESSION. The delivery lookup results are cached in an in-memory PL/SQL table (delivery_table), which is cleared at the start of each session initialization.

Key Procedures and Functions

  • INIT — Initializes the package for the current session. It checks whether initialization has already occurred; if so, it logs a message via WSH_UTIL.Write_Log and returns success without re-initializing. Otherwise it clears the delivery_table, resets the current_line counter, and captures user_id and login_id from WSH_PR_PICKING_SESSION. It returns 0 for success and -1 for failure, trapping exceptions through WSH_UTIL.Default_Handler.
  • GET_DELIVERY — Determines the delivery_id to be used when inserting picking line details during autocreate delivery processing. The function accepts the order header, the ship-to site use, the ship method (freight carrier), and the organization, and returns -1 on failure or the resolved delivery_id on success. Internally it declares a cursor named get_delivery_info, which is the object surfaced when searching for "get_delivery_info". This cursor selects customer, FOB code, freight terms code, and currency code for the given header, defaulting null customer to -1 and null FOB/freight terms to a literal placeholder. The cursor is used to derive the delivery attributes that drive delivery matching or creation.

Tables Accessed

  • SO_HEADERS_ALL — Read to obtain order header attributes (customer, FOB code, freight terms, currency) that identify the correct delivery for a picking line.
  • MTL_UNITS_OF_MEASURE — Referenced for unit of measure validation or conversion related to picking line quantities.
  • PLITBLM — The picking line interface/transaction table through which picking line details are processed and associated with a delivery.

Usage Notes

This package is invoked indirectly by Oracle Shipping Execution picking and pick-confirmation flows rather than by end users directly. It is typically called when the picking process requires automatic delivery creation, including concurrent pick slip generation and pick confirmation, and it is referenced by one other APPS package. Custom extensions should not call it in isolation; callers must first invoke INIT so that user context and session state are established, then rely on GET_DELIVERY to resolve delivery identifiers. Because the package holds package-level global variables, it is session-stateful, and re-initialization within the same session resets cached delivery data. The header comment references version 115.4, indicating a legacy 11i-era source line carried forward into the 12.1.1 and 12.2.2 code lines.