P_ClearingDocument

DDL: P_CLEARINGDOCUMENT SQL: PCLRGDOC Type: view CONSUMPTION

P_ClearingDocument is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (P_ClearedItem1, I_JournalEntry) and exposes 15 fields with key fields CompanyCode, ClearingJournalEntry, ClearingJournalEntryFiscalYear. It has 1 association to related views.

Data Sources (2)

SourceAliasJoin Type
P_ClearedItem1 ClrdItm inner
I_JournalEntry I_JournalEntry from

Associations (1)

CardinalityTargetAliasCondition
[0..1] P_ClearedItemCorrespondenceCnt _CorrespondenceCnt $projection.CompanyCode = _CorrespondenceCnt.CompanyCode and $projection.ClearingJournalEntry = _CorrespondenceCnt.ClearingJournalEntry and $projection.ClearingJournalEntryFiscalYear = _CorrespondenceCnt.ClearingJournalEntryFiscalYear

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PCLRGDOC view
AbapCatalog.compiler.compareFilter true view
VDM.viewType #CONSUMPTION view
VDM.private true view
AccessControl.authorizationCheck #NOT_ALLOWED view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view

Fields (15)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_JournalEntry CompanyCode Receiver Company Code
KEY ClearingJournalEntry
KEY ClearingJournalEntryFiscalYear
AccountingDocumentType I_JournalEntry AccountingDocumentType Journal Entry Type
AuthorizationGroup
IntercompanyTransaction I_JournalEntry IntercompanyTransaction Intercompany Transaction
DocumentDate I_JournalEntry DocumentDate Journal Entry Date
PostingDate I_JournalEntry PostingDate Posting Date for GR
ClearingFiscalPeriod
ClearingCreationDate
AccountingDocCreatedByUser I_JournalEntry AccountingDocCreatedByUser User which created overhead document
CompanyCodeCurrency I_JournalEntry CompanyCodeCurrency Local Currency
AccountingDocumentCategory I_JournalEntry AccountingDocumentCategory Journal Entry Category
_CompanyCode I_JournalEntry _CompanyCode
_CorrespondenceCnt _CorrespondenceCnt

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_ClearingDocument.
-- 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: PCLRGDOC

CREATE VIEW P_ClearingDocument AS
SELECT
  I_JournalEntry.CompanyCode AS CompanyCode,
  cast(I_JournalEntry.AccountingDocument as fis_augbl preserving type) AS ClearingJournalEntry,
  cast(I_JournalEntry.FiscalYear as fis_auggj_no_conv preserving type) AS ClearingJournalEntryFiscalYear,
  I_JournalEntry.AccountingDocumentType AS AccountingDocumentType,
  I_JournalEntry._AccountingDocumentType.AuthorizationGroup AS AuthorizationGroup,
  I_JournalEntry.IntercompanyTransaction AS IntercompanyTransaction,
  I_JournalEntry.DocumentDate AS DocumentDate,
  I_JournalEntry.PostingDate AS PostingDate,
  cast(I_JournalEntry.FiscalPeriod as fis_augperiod) AS ClearingFiscalPeriod,
  cast(I_JournalEntry.AccountingDocumentCreationDate as fis_augcp) AS ClearingCreationDate,
  I_JournalEntry.AccountingDocCreatedByUser AS AccountingDocCreatedByUser,
  I_JournalEntry.CompanyCodeCurrency AS CompanyCodeCurrency,
  I_JournalEntry.AccountingDocumentCategory AS AccountingDocumentCategory,
  I_JournalEntry._CompanyCode AS _CompanyCode
FROM I_JournalEntry
INNER JOIN P_ClearedItem1 AS ClrdItm ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_ClearedItemCorrespondenceCnt AS _CorrespondenceCnt ON CompanyCode = _CorrespondenceCnt.CompanyCode AND ClearingJournalEntry = _CorrespondenceCnt.ClearingJournalEntry AND ClearingJournalEntryFiscalYear = _CorrespondenceCnt.ClearingJournalEntryFiscalYear  -- association [0..1]
;