P_LegalDocLatestVersionCube
Legal Document TopVer Header Data
P_LegalDocLatestVersionCube is a Consumption CDS View that provides data about "Legal Document TopVer Header Data" in SAP S/4HANA. It reads from 1 data source (I_LegalDocument) and exposes 43 fields with key field LglCntntMDocumentUUID. It has 9 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_LegalDocument | _LegalDocument | from |
Associations (9)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_LglCntntMDocTemplateInfo | _LglCntntMDocTemplateInfo | $projection.LglCntntMDocumentUUID = _LglCntntMDocTemplateInfo.LglCntntMDocumentUUID |
| [1..1] | I_LglCntntMTemplate | _LglCntntMTemplate | $projection.LglCntntMTmplUUID = _LglCntntMTemplate.LglCntntMTmplUUID |
| [0..1] | I_LglCntntMDocContentTypeText | _ContentTypeText | $projection.LglCntntMDocContentType = _ContentTypeText.LglCntntMDocContentType and $projection.LglCntntMLanguage = _ContentTypeText.Language |
| [0..1] | I_LglCntntMProfileText | _LglCntntMProfileText | $projection.LglCntntMProfile = _LglCntntMProfileText.LglCntntMProfile and _LglCntntMProfileText.Language = $session.system_language |
| [1..1] | I_LglCntntMDocAssemblyInfo | _LglCntntMDocAssemblyInfo | $projection.LglCntntMDocumentUUID = _LglCntntMDocAssemblyInfo.LglCntntMDocumentUUID and $projection.LglCntntMVirtualDocVersKey = _LglCntntMDocAssemblyInfo.LglCntntMVirtualDocVersKey |
| [0..1] | I_LglCntntMDocAssemblyStsText | _AssemblyStsText | $projection.LglCntntMDocAssemblyStatus = _AssemblyStsText.LglCntntMDocAssemblyStatus and _AssemblyStsText.Language = $session.system_language |
| [0..1] | I_LglCntntMDocLowTouchLvlTxt | _LglCntntMDocLowTouchLvlTxt | $projection.LglCntntMDocLowTouchLevel = _LglCntntMDocLowTouchLvlTxt.LglCntntMDocLowTouchLevel and _LglCntntMDocLowTouchLvlTxt.Language = $session.system_language |
| [0..1] | I_LegalTrEntityAggr | _LegalTrEntityAggr | $projection.LegalTransactionUUID = _LegalTrEntityAggr.LegalTransactionUUID |
| [0..1] | I_LglCntntMDocStatusText | _LGLCNTNTMDOCSTATUSTEXT | $projection.InternalDocumentStatus = _LGLCNTNTMDOCSTATUSTEXT.InternalDocumentStatus and _LGLCNTNTMDOCSTATUSTEXT.Language = $session.system_language |
Annotations (14)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PLCMPLGLDOC | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Legal Document TopVer Header Data | view | |
| AbapCatalog.preserveKey | true | view | |
| VDM.viewType | #CONSUMPTION | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| Metadata.allowExtensions | false | view | |
| VDM.private | true | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.representativeKey | LglCntntMDocumentUUID | view |
Fields (43)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | LglCntntMDocumentUUID | LglCntntMDocumentUUID | Universal Unique ID | |
| LglCntntMDocument | LglCntntMDocument | Document ID | ||
| DocumentDescription | DocumentDescription | Doc. Name | ||
| LglCntntMDocumentLinkedObject | LglCntntMDocumentLinkedObject | Object | ||
| LglCntntMDocumentLinkedObjKey | LglCntntMDocumentLinkedObjKey | UUID Char32 | ||
| LglCntntMDocumentIsTopVersion | LglCntntMDocumentIsTopVersion | TRUE | ||
| LegalTransaction | LegalTransaction | Legal Transaction ID | ||
| LegalTransactionTitle | _LegalTransaction | LegalTransactionTitle | Title | |
| LegalTransactionUUID | LegalTransactionUUID | Universal Unique ID | ||
| LglCntntMSignatureDocStatus | LglCntntMSignatureDocStatus | Sign Document Status | ||
| LglCntntMDocLowTouchLevel | LglCntntMDocLowTouchLevel | Doc Low touch level | ||
| LglCntntMDocType | LglCntntMDocType | Document Type | ||
| LglCntntMDocTemplateName | _LglCntntMDocTemplateInfo | LglCntntMDocTemplateName | Templ. Name | |
| LglCntntMTmplUUID | _LglCntntMDocTemplateInfo | LglCntntMDocTemplateInfoUUID | Universal Unique ID | |
| LglCntntMDocTemplateVersion | _LglCntntMDocTemplateInfo | LglCntntMDocTemplateVersion | Templ. Vers. | |
| LegalDocumentVersion | LegalDocumentVersion | Docu. Version | ||
| InternalDocumentStatus | InternalDocumentStatus | Status | ||
| LglCntntMDocStatusName | _LGLCNTNTMDOCSTATUSTEXT | LglCntntMDocStatusName | Long Text | |
| LglCntntMDocContentType | LglCntntMDocContentType | Content Type | ||
| LglCntntMDocContentTypeName | _ContentTypeText | LglCntntMDocContentTypeName | Long Text | |
| LglCntntMDocAccessLvl | LglCntntMDocAccessLvl | Acs. Level | ||
| LglCntntMLanguage | LglCntntMLanguage | Language | ||
| IsEndOfPurposeBlocked | IsEndOfPurposeBlocked | Busin. Purp. Cmpltd. | ||
| LglCntntMCreatedDate | Created On | |||
| LglCntntMChangedDate | Changed On | |||
| LglCntntMVirtualDocVersKey | LglCntntMVirtualDocVersKey | Virtual Doc Version | ||
| LglCntntMDocReferenceNumber | LglCntntMDocReferenceNumber | Reference Number | ||
| LglCntntMDocAssemblyStatus | _LglCntntMDocAssemblyInfo | LglCntntMDocAssemblyStatus | Assembly Status | |
| LglCntntMProfile | _LegalTransaction | LglCntntMProfile | Profile | |
| LglCntntMEntityName | _LegalTrEntityAggr | LglCntntMEntityName | ||
| LglTransAccessLvl | _LegalTransaction | LglTransAccessLvl | Acs. Level | |
| LegalTransactionHealth | _LegalTransaction | LegalTransactionHealth | LT Status | |
| LegalTransactionHealthName | ||||
| LglCntntMMainOrgTypeName | ||||
| LglCntntMEntityType | ||||
| LglCntntMEntityTypeName | ||||
| LglCntntMDocLowTouchLevelTxt | _LglCntntMDocLowTouchLvlTxt | LglCntntMDocLowTouchLevelTxt | ||
| CompanyCodeNameendasLglCntntMMainOrgName | ||||
| int410endasLegalDocTotNrOfAcceptedStatus | ||||
| _LegalTransaction | _LegalTransaction | |||
| _LglCntntMTemplate | _LglCntntMTemplate | |||
| _LglCntntMProfileText | _LglCntntMProfileText | |||
| _AssemblyStsText | _AssemblyStsText |
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_LegalDocLatestVersionCube.
-- 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: PLCMPLGLDOC
CREATE VIEW P_LegalDocLatestVersionCube AS
SELECT
LglCntntMDocumentUUID,
LglCntntMDocument,
DocumentDescription,
LglCntntMDocumentLinkedObject,
LglCntntMDocumentLinkedObjKey,
LglCntntMDocumentIsTopVersion,
LegalTransaction,
_LegalTransaction.LegalTransactionTitle AS LegalTransactionTitle,
LegalTransactionUUID,
LglCntntMSignatureDocStatus,
LglCntntMDocLowTouchLevel,
LglCntntMDocType,
_LglCntntMDocTemplateInfo.LglCntntMDocTemplateName AS LglCntntMDocTemplateName,
_LglCntntMDocTemplateInfo.LglCntntMDocTemplateInfoUUID AS LglCntntMTmplUUID,
_LglCntntMDocTemplateInfo.LglCntntMDocTemplateVersion AS LglCntntMDocTemplateVersion,
LegalDocumentVersion,
InternalDocumentStatus,
_LGLCNTNTMDOCSTATUSTEXT.LglCntntMDocStatusName AS LglCntntMDocStatusName,
LglCntntMDocContentType,
_ContentTypeText.LglCntntMDocContentTypeName AS LglCntntMDocContentTypeName,
LglCntntMDocAccessLvl,
LglCntntMLanguage,
IsEndOfPurposeBlocked,
cast(SUBSTRING(cast( LglCntntMCreatedUTCDateTime as abap.char(28)),1,8) as abap.dats) AS LglCntntMCreatedDate,
cast(SUBSTRING(cast( LglCntntMChangedUTCDateTime as abap.char(28)),1,8) as abap.dats) AS LglCntntMChangedDate,
LglCntntMVirtualDocVersKey,
LglCntntMDocReferenceNumber,
_LglCntntMDocAssemblyInfo.LglCntntMDocAssemblyStatus AS LglCntntMDocAssemblyStatus,
_LegalTransaction.LglCntntMProfile AS LglCntntMProfile,
_LegalTrEntityAggr.LglCntntMEntityName AS LglCntntMEntityName,
_LegalTransaction.LglTransAccessLvl AS LglTransAccessLvl,
_LegalTransaction.LegalTransactionHealth AS LegalTransactionHealth,
_LegalTransaction._LegalTransactionHealthText.LegalTransactionHealthName AS LegalTransactionHealthName,
_LegalTransaction._LglCntntMMainOrgTypeText.LglCntntMMainOrgTypeName AS LglCntntMMainOrgTypeName,
_LegalTransaction._MainLegalTransactionEntity.LglCntntMEntityType AS LglCntntMEntityType,
_LegalTransaction._MainLegalTransactionEntity.LglCntntMEntityTypeName AS LglCntntMEntityTypeName,
_LglCntntMDocLowTouchLvlTxt.LglCntntMDocLowTouchLevelTxt AS LglCntntMDocLowTouchLevelTxt,
case when _LegalTransaction.LglCntntMMainOrgType = '04' then _LegalTransaction._SalesOrganizationText.SalesOrganizationName when _LegalTransaction.LglCntntMMainOrgType = '05' then _LegalTransaction._PurchasingOrganization.PurchasingOrganizationName else _LegalTransaction._CompanyCode.CompanyCodeName end as LglCntntMMainOrgName AS CompanyCodeNameendasLglCntntMMainOrgName,
case when InternalDocumentStatus = 'AC' then cast (1 as abap.int4(10) ) else cast (0 as abap.int4(10) ) end as LegalDocTotNrOfAcceptedStatus AS int410endasLegalDocTotNrOfAcceptedStatus
FROM I_LegalDocument AS _LegalDocument
LEFT OUTER JOIN I_LglCntntMDocTemplateInfo AS _LglCntntMDocTemplateInfo ON LglCntntMDocumentUUID = _LglCntntMDocTemplateInfo.LglCntntMDocumentUUID -- association [1..1]
LEFT OUTER JOIN I_LglCntntMTemplate AS _LglCntntMTemplate ON LglCntntMTmplUUID = _LglCntntMTemplate.LglCntntMTmplUUID -- association [1..1]
LEFT OUTER JOIN I_LglCntntMDocContentTypeText AS _ContentTypeText ON LglCntntMDocContentType = _ContentTypeText.LglCntntMDocContentType AND LglCntntMLanguage = _ContentTypeText.Language -- association [0..1]
LEFT OUTER JOIN I_LglCntntMProfileText AS _LglCntntMProfileText ON LglCntntMProfile = _LglCntntMProfileText.LglCntntMProfile AND _LglCntntMProfileText.Language = $session.system_language -- association [0..1]
LEFT OUTER JOIN I_LglCntntMDocAssemblyInfo AS _LglCntntMDocAssemblyInfo ON LglCntntMDocumentUUID = _LglCntntMDocAssemblyInfo.LglCntntMDocumentUUID AND LglCntntMVirtualDocVersKey = _LglCntntMDocAssemblyInfo.LglCntntMVirtualDocVersKey -- association [1..1]
LEFT OUTER JOIN I_LglCntntMDocAssemblyStsText AS _AssemblyStsText ON LglCntntMDocAssemblyStatus = _AssemblyStsText.LglCntntMDocAssemblyStatus AND _AssemblyStsText.Language = $session.system_language -- association [0..1]
LEFT OUTER JOIN I_LglCntntMDocLowTouchLvlTxt AS _LglCntntMDocLowTouchLvlTxt ON LglCntntMDocLowTouchLevel = _LglCntntMDocLowTouchLvlTxt.LglCntntMDocLowTouchLevel AND _LglCntntMDocLowTouchLvlTxt.Language = $session.system_language -- association [0..1]
LEFT OUTER JOIN I_LegalTrEntityAggr AS _LegalTrEntityAggr ON LegalTransactionUUID = _LegalTrEntityAggr.LegalTransactionUUID -- association [0..1]
LEFT OUTER JOIN I_LglCntntMDocStatusText AS _LGLCNTNTMDOCSTATUSTEXT ON InternalDocumentStatus = _LGLCNTNTMDOCSTATUSTEXT.InternalDocumentStatus AND _LGLCNTNTMDOCSTATUSTEXT.Language = $session.system_language -- 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