Search Results get_last_few_messages




Overview

ARP_MESSAGE is a PL/SQL package owned by the APPS schema in Oracle E-Business Suite, classified under the generic API category "OTHER." It functions as the Receivables (AR) message-handling and logging utility, providing a centralized mechanism for concurrent programs and server-side PL/SQL routines to emit output messages, error notifications, and debugging information. The package abstracts the storage destination of these messages: depending on how it is initialized, text is either written to the database table AR_CONC_REQUEST_MESSAGES or accumulated in an in-memory message stack. This design allows a single instrumentation API to serve both concurrent programs (which require persistent, queryable log output) and lightweight runtime routines (which only need transient buffering). In the Oracle EBS releases referenced (12.1.1 and 12.2.2), ARP_MESSAGE is a long-standing utility, with source headers dating from 2002, and it is referenced by approximately ninety other packages, underscoring its role as a shared logging facility across the Receivables application and adjacent modules.

Key Procedures and Functions

The documented public interface exposes sixteen procedures and functions. Their documented purposes are as follows:

  • INITIALIZE — Must be the first call into the package. It sets the output code that controls whether messages are stored in the table or on the message stack, records the concurrent request identifier, and configures debug mode and debug output destination. If it is never called, output code defaults to the stack and the concatenated request ID defaults to zero.
  • PUT_LINE and SET_LINE — Write a non-translated message to the output buffer. The two routines are documented as functionally equivalent, with PUT_LINE noted as a candidate for eventual removal.
  • FLUSH — Emits or writes out pending buffered messages.
  • DEBUG — Writes diagnostic messages subject to the debug flag established during initialization.
  • SET_NAME and SET_TOKEN — Associate naming and token-substitution context used when composing or retrieving messages.
  • GET — Retrieves a message from the buffer or message store.
  • SET_ERROR and PUT_DB_ERROR — Record error conditions, with PUT_DB_ERROR intended to translate and log an Oracle database error.
  • CLEAR — Empties the output buffer or stack.
  • MESSAGE_COUNT — Returns the number of messages currently held.
  • PURGE_MESSAGES — Removes stored messages from the persistent destination.
  • LAST_MESSAGE_SEQUENCE — Returns the sequence identifier of the most recently written message.
  • GET_LAST_FEW_MESSAGES — The procedure corresponding to the user's search term; it returns the most recently generated messages, enabling callers to inspect recent log activity without scanning the full message store. The ABORT exception is declared so that a server program can terminate processing and return control to the client.

Tables Accessed

Through APPS synonyms, the package references AR_CONC_REQUEST_MESSAGES, AR_CONC_REQUEST_MESSAGES_S, and PLITBLM. AR_CONC_REQUEST_MESSAGES is the persistent repository for concurrent request output and is the target when output code is set to TABLE; the _S table is the corresponding sequence or shadow object used to generate message sequence identifiers. PLITBLM is the standard Oracle EBS PL/SQL table (index-by table) used for in-memory collections, supporting the stack-based storage mode. These tables explain the package's dual persistence model: durable messages for concurrent output review, and transient table-based buffering for high-performance runtime use.

Usage Notes

ARP_MESSAGE is typically invoked from concurrent programs and server-side PL/SQL to accumulate user-facing output and diagnostic text. The conventional pattern is to call INITIALIZE early in the program, selecting TABLE output when messages must be visible in the concurrent request log and STACK output otherwise, then to use SET_LINE or PUT_LINE for messages, DEBUG for diagnostics, and SET_ERROR or PUT_DB_ERROR for failures. The retrieval routines — GET, MESSAGE_COUNT, LAST_MESSAGE_SEQUENCE, and GET_LAST_FEW_MESSAGES — support custom callers that need to read back recent history for display in forms, OAF pages, or reports. Because the package is referenced by roughly ninety other packages, customizations should extend rather than modify it, and any direct use should preserve the documented initialization ordering to avoid unexpected defaults.