Search Results create_sca_rules_batch_dyn




Overview

CN_SCA_RULES_BATCH_GEN_PVT is a private PL/SQL package in the Oracle EBS Applications (APPS) schema that functions as a public API for processing Credit Rules and their associated allocation percentages within the Advanced Pricing/Channel Revenue Management domain. The "SCA" prefix denotes Supplier/Customer Agreement or "Schedule of Credit Allocation" style rule processing. This package is responsible for generating and populating credit rule batches dynamically based on attribute-driven conditions and operators defined against source transaction data.

The package is declared with AUTHID CURRENT_USER, meaning it executes with the privileges of the invoking user rather than the definer, which is significant for multi-org (MOAC) environments where p_org_id drives operating unit context. Its header history dates to 2003 (created by Rao Chenna) with the latest revision in 2005, indicating a mature component of the credit rules engine.

Key Procedures and Functions

The package exposes three documented program units:

  • GEN_SCA_RULES_BATCH_DYN — The primary driver procedure. It orchestrates dynamic generation of credit rule batches. It follows the standard EBS API parameter convention, accepting p_api_version, p_init_msg_list, p_commit, p_validation_level, and p_org_id, while returning x_return_status, x_msg_count, and x_msg_data. A x_transaction_source parameter ties generation to a specific source transaction type. The term "dyn" indicates the batch criteria are constructed at runtime.
  • POPULATE_MATCHES — Accepts spec_code and body_code (both typed via cn_utils.code_type) plus x_transaction_source. This procedure resolves and populates the set of credit rule matches derived from specification/body combinations for the given transaction source.
  • CREATE_SCA_RULES_BATCH_DYN — A BOOLEAN-returning function that accepts x_transaction_source. It encapsulates the actual creation of the dynamic credit rules batch, returning TRUE/FALSE to signal success or failure to the caller.

Tables Accessed

The package operates against the core credit rules schema, including:

Usage Notes

As a PVT (private) API classification, CN_SCA_RULES_BATCH_GEN_PVT is not intended for direct invocation by end users or arbitrary custom code. It is typically called by its parent public package(s) — the metadata notes it is "Referenced by 1 other package" — that wrap credit rule batch generation during pricing or credit processing flows. Invocation normally occurs from concurrent programs or forms that submit rule batch generation jobs, or from internal credit rules engine code. Because the package relies on DBMS_SQL for dynamic construction and honors p_org_id for MOAC filtering, callers must supply a valid operating unit context. The create_sca_rules_batch_dyn function referenced in the user's search returns a BOOLEAN rather than an EBS-standard x_return_status, so callers must handle exceptions carefully and check USER_ERRORS for compilation or runtime diagnostics.