Search Results as_territories_all




Overview

The AS_TERRITORIES_ALL table is a core data object within the Oracle E-Business Suite Sales Foundation module (AS). It serves as the central repository for storing territory definitions, which are fundamental for structuring sales organizations, assigning resources, and managing customer coverage. The table's primary role is to define the hierarchical and logical grouping of sales territories. Crucially, the provided ETRM documentation explicitly marks this table as "Obsolete Sales out to JTF Terr Core," indicating a significant architectural shift. This status denotes that territory management functionality has been migrated from the older AS (Sales) tables to the more centralized JTF (Trading Community) Territory Core module. In releases 12.1.1 and 12.2.2, this table likely exists for backward compatibility, data migration purposes, or to support specific legacy processes that have not been fully transitioned.

Key Information Stored

The table's structure is designed to encapsulate the essential attributes of a sales territory. The primary key is the TERRITORY_ID, a unique identifier for each territory record. Other critical foreign key columns define the territory's relationships and classification. The TERRITORY_TYPE_ID links to AS_TERRITORY_TYPES_ALL, classifying the territory (e.g., by geography, market segment). The SALESFORCE_ID associates the territory with a specific sales team or force defined in AS_SALESFORCE. The TERRITORY_GROUP_ID connects to AS_TERRITORY_GROUPS_ALL for higher-level aggregations. A self-referential relationship is established via the EXPANDED_FROM_TERR_ID column, which points to a parent or source territory from which the current record was expanded, enabling territory hierarchy and versioning.

Common Use Cases and Queries

Given its obsolete status, direct operational use in new developments is discouraged in favor of the JTF Territory Core APIs and tables. However, the table may be referenced for historical reporting, data validation during upgrades, or supporting customizations not yet migrated. A common query would involve joining to its related type and group tables to generate a comprehensive territory listing report. For example:

SELECT terr.territory_id, terr.name, typ.name territory_type, grp.name territory_group
FROM as_territories_all terr,
as_territory_types_all typ,
as_territory_groups_all grp
WHERE terr.territory_type_id = typ.territory_type_id
AND terr.territory_group_id = grp.territory_group_id
AND terr.salesforce_id = :p_salesforce_id;

Another use case is analyzing territory rollup hierarchies using the AS_TERRITORY_ROLLUPS table or tracking changes via AS_CHANGED_TERRITORIES_ALL.

Related Objects

AS_TERRITORIES_ALL maintains documented foreign key relationships with several key tables in the Sales Foundation schema, as per the provided metadata:

  • AS_TERRITORY_TYPES_ALL: Joined via TERRITORY_TYPE_ID to classify the territory.
  • AS_SALESFORCE: Joined via SALESFORCE_ID to assign the territory to a sales force.
  • AS_TERRITORY_GROUPS_ALL: Joined via TERRITORY_GROUP_ID for grouping territories.
  • AS_TERRITORIES_ALL (Self-Referential): Joined via EXPANDED_FROM_TERR_ID to track territory expansion or parentage.
  • AS_CHANGED_TERRITORIES_ALL: References TERRITORY_ID to log modifications to territory definitions.
  • AS_TERRITORY_ROLLUPS: References TERRITORY_ID and ROLLUP_TERRITORY_ID to define hierarchical rollup relationships between territories.