Search Results sc_online




Overview

APPS.WSH_UTIL is a utility package within the Oracle E-Business Suite Shipping Execution module (WSH). It provides a collection of general-purpose helper routines that support logging, session-context detection, and shared variable management for shipping-related programs. The package is classified as a UTIL API in the ETRM repository for Release 12.2.2, indicating that it is not a business-facing transaction API but rather an internal infrastructure component consumed by other shipping packages and forms. Its most common role is to supply consistent logging behavior so that diagnostic output can be captured, filtered by debug level, and retrieved programmatically. The package is declared with AUTHID CURRENT_USER, meaning its database objects and privileges resolve against the schema of the calling user. The header source carries an original revision marker dated 1999, reflecting the package's long-standing presence in the shipping codebase across 11i and R12 releases.

Key Procedures and Functions

The ETRM metadata documents fourteen procedures and functions. INIT initializes the internal log structure and accepts a flush indicator that determines whether log lines are written immediately to the output file. WSHSRC returns a single-character flag identifying the calling environment, distinguishing a form invocation from a concurrent program invocation; this allows downstream logic to branch based on execution context. WRITE_LOG appends a text line to the log, honoring a debug-level argument and an optional token used to tag specific lines for later retrieval. CLEAR_LOG and FLUSH_LOG manage the lifecycle of the in-memory log buffer.

  • Log Retrieval: GET_LOG returns the complete set of logged lines, GET_SIZE returns the number of lines currently held, and GET_LINE returns a specific line identified by its line number. These routines support post-execution diagnostic review of a shipping run.
  • Variable Management: GET_VAR and SET_VAR provide a simple in-package mechanism for storing and retrieving values across procedure calls within a session.
  • Error Handling: DEFAULT_HANDLER supplies a standardized exception routine used by calling programs.
  • Location Flexfield: UPDATE_LOCATOR_FLEX supports maintenance of the locator key flexfield associated with inventory item locations.
  • SC_ONLINE: This function, matching the user's search term, reports whether the shipping execution context is online. It is typically consulted to determine whether processing is occurring through an interactive forms session rather than a batch or concurrent request, and callers use the result to control transactional behavior accordingly.

Tables Accessed

Documented references via APPS synonyms include MTL_ITEM_LOCATIONS, DUAL, PLITBLM, and UTL_FILE. MTL_ITEM_LOCATIONS is read and potentially updated in support of locator flexfield maintenance, since item locations carry the locator flexfield segments in inventory. DUAL is used for single-row evaluations in helper functions such as SC_ONLINE. PLITBLM is the standard Oracle Forms table used to buffer multi-line log text displayed or written from a form. UTL_FILE provides the file I/O primitive used when flush behavior causes log lines to be written to disk.

Usage Notes

WSH_UTIL is invoked from shipping forms, concurrent programs, and custom PL/SQL that requires consistent logging or environment detection. The ETRM record shows it is referenced by seven other packages, confirming its role as shared infrastructure. Developers incorporating WSH_UTIL should call INIT before WRITE_LOG, set appropriate debug levels, and use tokens to make retrieval by GET_LINE efficient. Because AUTHID CURRENT_USER applies, callers require direct privileges on the underlying objects, and reliance on Oracle Forms-specific tables such as PLITBLM means certain routines, notably those returning log collections, are not usable outside the forms environment.