Search Results set_message




Overview

APPS.PV_BATCH_ASSIGN_PUB is a public PL/SQL package body in the Oracle EBS Channel Revenue Management / Partner Management (formerly Oracle Partner Management) product family. Its primary business function is to automate the batch assignment of partner opportunities — the leads and opportunities that vendors create and then route to channel partners. In environments where opportunities are created but not immediately matched to a partner, they remain in an unassigned or timed-out state. This package provides the processing logic to sweep those unassigned opportunities and attempt to route them to the appropriate partners using the opportunity selection API.

The package resides in the APPS schema and is classified as a public (PUB) API. The $Header comment indicates a last revision in early 2006 (PVBTASNB.PLS 120.3), which is consistent with the shared code base carried across both the 12.1.1 and 12.2.2 releases. As a public package body, it is intended for invocation by other application modules, concurrent programs, or external integration code rather than being restricted to internal use.

Key Procedures and Functions

The ETRM documentation identifies a single public procedure for this package body: PROCESS_UNASSIGNED. Its documented purpose is to process all timed-out opportunities created by the vendor and to attempt to route them to partners via the opportunity selection API. It accepts a set of standard and business parameters, including an error buffer (ERRBUF) and return code (RETCODE) for concurrent-program-style execution, along with inputs such as country, username, and a from-date. These parameters suggest the procedure can be scoped to a specific country, initiated under a specific user identity, and limited to opportunities from a given date forward.

The package body also declares private helper procedures Debug and Set_Message. Set_Message is the routine most commonly searched for. It is a private utility that formats and raises a message using a message name, a message level, and up to three token/value pairs. This naming pattern is the standard Oracle EBS mechanism for retrieving a seeded or custom message from FND_MESSAGE and substituting runtime tokens into it. Because it is declared privately, Set_Message is not callable from outside the package; it exists solely to standardize error and status messaging raised by PROCESS_UNASSIGNED.

Tables Accessed

The documented table references reflect the opportunity-routing workflow the package governs. AS_LEADS_ALL holds the lead and opportunity records that are the subject of assignment. AS_STATUSES_B supplies the status definitions used to identify timed-out or unassigned opportunities. FND_USER resolves the invoked user context suggested by P_USERNAME. HZ_LOCATIONS and HZ_PARTY_SITES provide the geography data used to match opportunities to partners by location or country. JTF_RS_RESOURCE_EXTNS stores resource (partner/sales-rep) attributes for candidate assignment. PV_CHANNEL_TYPES and PV_LEAD_WORKFLOWS supply the channel and workflow configuration that determine eligible partners and routing rules. PLITBLM is a general-purpose PL/SQL index-by table utility used for internal data handling.

Usage Notes

This package is typically invoked when an opportunity assignment workflow fails to find a partner within its allotted time, leaving the opportunity in a timed-out state. The standard invocation pattern is a concurrent program that calls PROCESS_UNASSIGNED on a schedule, passing country, username, and from-date so the batch is bounded. On completion, ERRBUF and RETCODE carry the outcome back to the concurrent manager.

Because the metadata notes the package is referenced by zero other documented packages, PROCESS_UNASSIGNED should be treated as an entry point rather than a shared library. Custom code that requires the same message formatting used internally must implement its own equivalent of Set_Message, since the private routine is not exposed. Any custom code should call the public procedure only, and should respect the date and country scoping parameters to avoid re-processing already-assigned opportunities.