P_LegalTrMainEntityAggr
P_LegalTrMainEntityAggr is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_LegalTransactionEntity, I_PurchasingOrganization, I_CompanyCode) and exposes 10 fields with key field LegalTransactionEntityUUID. It has 6 associations to related views.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| I_LegalTransactionEntity | _LglTrEnt | from |
| I_PurchasingOrganization | _PurchasingOrganization | left_outer |
| I_CompanyCode | _PurOrgCompanyCode | left_outer |
Associations (6)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_Supplier | _Supplier | _Supplier.Supplier = $projection.LglCntntMEntity |
| [0..1] | I_SalesOrganization | _SalesOrganization | _SalesOrganization.SalesOrganization = $projection.LglCntntMEntity |
| [0..1] | I_Customer | _Customer | _Customer.Customer = $projection.LglCntntMEntity |
| [0..1] | I_CompanyCode | _CompanyCode | _CompanyCode.CompanyCode = $projection.LglCntntMEntity |
| [0..1] | I_BusinessPartner | _BusinessPartner | _BusinessPartner.BusinessPartner = $projection.LglCntntMEntity |
| [0..1] | I_LCMEntityType | _LCMEntityType | _LCMEntityType.LglCntntMEntityType = $projection.LglCntntMEntityType |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PLEGALTRMENTAGGR | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| VDM.viewType | #COMPOSITE | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| AccessControl.personalData.blocking | #REQUIRED | view | |
| ObjectModel.representativeKey | LegalTransactionEntityUUID | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| ObjectModel.usageType.dataClass | #MASTER | view | |
| VDM.private | true | view |
Fields (10)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | LegalTransactionEntityUUID | LegalTransactionEntityUUID | Universal Unique ID | |
| LglCntntMEntity | LglCntntMEntity | Entity ID | ||
| LglCntntMEntityType | LglCntntMEntityType | Entity Type | ||
| LglCntntMTechEntityType | _LCMEntityType | LglCntntMTechEntityType | Entity Techn. Type | |
| CountryelseendasLglCntntMEntityCountry | ||||
| _Supplier | _Supplier | |||
| _Customer | _Customer | |||
| _BusinessPartner | _BusinessPartner | |||
| LegalTransactionUUID | I_LegalTransactionEntity | LegalTransactionUUID | Universal Unique ID | |
| _LegalTransaction | I_LegalTransactionEntity | _LegalTransaction |
Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view P_LegalTrMainEntityAggr.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PLEGALTRMENTAGGR
CREATE VIEW P_LegalTrMainEntityAggr AS
SELECT
LegalTransactionEntityUUID,
LglCntntMEntity,
LglCntntMEntityType,
_LCMEntityType.LglCntntMTechEntityType AS LglCntntMTechEntityType,
case _LCMEntityType.LglCntntMTechEntityType when '01' then _Supplier.Country when '02' then _Customer.Country when '03' then _CompanyCode.Country when '04' then _SalesOrganization._CompanyCode.Country when '05' then _PurOrgCompanyCode.Country when '06' then _BusinessPartner._CurrentDefaultAddress._AddressDefaultRepresentation.Country else '' end as LglCntntMEntityCountry AS CountryelseendasLglCntntMEntityCountry,
_LglTrEnt.LegalTransactionUUID AS LegalTransactionUUID,
_LglTrEnt._LegalTransaction AS _LegalTransaction
FROM I_LegalTransactionEntity AS _LglTrEnt
LEFT OUTER JOIN I_PurchasingOrganization AS _PurchasingOrganization ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_CompanyCode AS _PurOrgCompanyCode ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Supplier AS _Supplier ON _Supplier.Supplier = LglCntntMEntity -- association [0..1]
LEFT OUTER JOIN I_SalesOrganization AS _SalesOrganization ON _SalesOrganization.SalesOrganization = LglCntntMEntity -- association [0..1]
LEFT OUTER JOIN I_Customer AS _Customer ON _Customer.Customer = LglCntntMEntity -- association [0..1]
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON _CompanyCode.CompanyCode = LglCntntMEntity -- association [0..1]
LEFT OUTER JOIN I_BusinessPartner AS _BusinessPartner ON _BusinessPartner.BusinessPartner = LglCntntMEntity -- association [0..1]
LEFT OUTER JOIN I_LCMEntityType AS _LCMEntityType ON _LCMEntityType.LglCntntMEntityType = LglCntntMEntityType -- association [0..1]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA