C_PT_SAFTPaymentDocumentC

DDL: C_PT_SAFTPAYMENTDOCUMENTC Type: view_entity CONSUMPTION

Payment Document Header - Cube

C_PT_SAFTPaymentDocumentC is a Consumption CDS View (Cube) that provides data about "Payment Document Header - Cube" in SAP S/4HANA. It reads from 4 data sources (I_AccountingDocumentType, I_PT_SAFTPaytSignatureCheck, I_ClrgInfoRelationForAcctgDoc, I_PT_DgtlSgntrNmbrRngeAcctg) and exposes 34 fields with key fields CompanyCode, ClearingAccountingDocument, FiscalYear. It has 4 associations to related views.

Data Sources (4)

SourceAliasJoin Type
I_AccountingDocumentType AcctDoc inner
I_PT_SAFTPaytSignatureCheck check inner
I_ClrgInfoRelationForAcctgDoc Clear inner
I_PT_DgtlSgntrNmbrRngeAcctg NrRange inner

Associations (4)

CardinalityTargetAliasCondition
[0..1] I_SAFTAccountingTaxCheck _TotalItems _TotalItems.AccountingDocument = Document.AccountingDocument and _TotalItems.CompanyCode = Document.CompanyCode and _TotalItems.FiscalYear = Document.FiscalYear
[0..1] I_ReversalReason _RevReason _RevReason.ReversalReason = Document.ReversalReason
[0..1] I_AccountingDocument _ReversalDocument _ReversalDocument.AccountingDocument = Document.ReverseDocument and _ReversalDocument.FiscalYear = Document.ReverseDocumentFiscalYear and _ReversalDocument.CompanyCode = Document.CompanyCode
[0..1] I_ClrgInfoRelationForAcctgDoc _Clearing _Clearing.ClearingInfoCompanyCode = Document.CompanyCode and _Clearing.ClearingAccountingDocument = Document.AccountingDocument and _Clearing.ClearingFiscalYear = Document.FiscalYear and _Clearing.AccountType = 'D' and _Clearing.SpecialGLCode <> 'F'

Annotations (10)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
VDM.viewType #CONSUMPTION view
Analytics.internalName #LOCAL view
Metadata.allowExtensions true view
Analytics.dataCategory #CUBE view
EndUserText.label Payment Document Header - Cube view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #S view
ObjectModel.usageType.dataClass #MIXED view

Fields (34)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode Document CompanyCode Receiver Company Code
KEY ClearingAccountingDocument Document AccountingDocument Journal Entry
KEY FiscalYear Document FiscalYear G/L Fiscal Year
char30asPaymentReference
ReverseDocument Document ReverseDocument Reversed With
IsReversed Document IsReversed Reversed?
IsReversal Document IsReversal Reversal doc.
ReverseDocumentFiscalYear Document ReverseDocumentFiscalYear Year
char70asDocumentTransaction
AccountingDocumentCreationDate Document AccountingDocumentCreationDate Journal Entry Date
CreationTime Document CreationTime Time of Change
ReversalReason Document ReversalReason Reversal Reason
CreationTime52asLastChangeDateTimeText
CreationTime52endasPaymentStatusDateText
AccountingDocumentCategory Document AccountingDocumentCategory Journal Entry Category
FiscalPeriod Document FiscalPeriod Tax period
DocumentDate Document DocumentDate Journal Entry Date
PostingDate Document PostingDate Posting Date for GR
AccountingDocumentType Document AccountingDocumentType Journal Entry Type
CompanyCodeCurrency Document CompanyCodeCurrency Local Currency
CreatedByUser Document AccountingDocCreatedByUser User which created overhead document
DownPaymentType
ReferenceDocumentType Document ReferenceDocumentType Reference Document Type
OriginalReferenceDocument Document OriginalReferenceDocument Reference Key
_CompanyCodeCurrency Document _CompanyCodeCurrency
_TotalItems _TotalItems
_AccountingDocumentCategory Document _AccountingDocumentCategory
_CompanyCode Document _CompanyCode
_AccountingDocumentType Document _AccountingDocumentType
_OperationalAcctgDocItem Document _OperationalAcctgDocItem
_ReversalDocument _ReversalDocument
_RevReason _RevReason
_FiscalYear Document _FiscalYear
_Clearing _Clearing

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 C_PT_SAFTPaymentDocumentC.
-- 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.

CREATE VIEW C_PT_SAFTPaymentDocumentC AS
SELECT
  Document.CompanyCode AS CompanyCode,
  Document.AccountingDocument AS ClearingAccountingDocument,
  Document.FiscalYear AS FiscalYear,
  cast(concat( concat( concat_with_space(Document.AccountingDocumentType, NrRange.PortugueseDgtlSignatureSeries, 1), '/'), Document.AccountingDocument) as abap.char(30)) as PaymentReference AS char30asPaymentReference,
  Document.ReverseDocument AS ReverseDocument,
  Document.IsReversed AS IsReversed,
  Document.IsReversal AS IsReversal,
  Document.ReverseDocumentFiscalYear AS ReverseDocumentFiscalYear,
  cast(concat_with_space(concat(substring(Document.DocumentDate,1,4), concat('-', concat(substring(Document.DocumentDate,5,2), concat('-', substring(Document.DocumentDate,7,2))))), concat_with_space(Document.AccountingDocumentType, Document.AccountingDocument, 1), 1) as abap.char(70)) as DocumentTransaction AS char70asDocumentTransaction,
  Document.AccountingDocumentCreationDate AS AccountingDocumentCreationDate,
  Document.CreationTime AS CreationTime,
  Document.ReversalReason AS ReversalReason,
  concat(substring(Document.AccountingDocumentCreationDate,1,4), concat('-', concat(substring(Document.AccountingDocumentCreationDate,5,2), concat('-', concat(substring(Document.AccountingDocumentCreationDate,7,2), concat('T', concat(substring(Document.CreationTime,1,2), concat(':', concat(substring(Document.CreationTime,3,2), concat(':', substring(Document.CreationTime,5,2))))))))))) as LastChangeDateTimeText AS CreationTime52asLastChangeDateTimeText,
  case when Document.ReverseDocument is not initial and Document.IsReversed <> '' then concat(substring(Document.AccountingDocumentCreationDate,1,4), concat('-', concat(substring(_ReversalDocument.AccountingDocumentCreationDate,5,2), concat('-', concat(substring(_ReversalDocument.AccountingDocumentCreationDate,7,2), concat('T', concat(substring(_ReversalDocument.CreationTime,1,2), concat(':', concat(substring(_ReversalDocument.CreationTime,3,2), concat(':', substring(_ReversalDocument.CreationTime,5,2))))))))))) else concat(substring(Document.AccountingDocumentCreationDate,1,4), concat('-', concat(substring(Document.AccountingDocumentCreationDate,5,2), concat('-', concat(substring(Document.AccountingDocumentCreationDate,7,2), concat('T', concat(substring(Document.CreationTime,1,2), concat(':', concat(substring(Document.CreationTime,3,2), concat(':', substring(Document.CreationTime,5,2))))))))))) end as PaymentStatusDateText AS CreationTime52endasPaymentStatusDateText,
  Document.AccountingDocumentCategory AS AccountingDocumentCategory,
  Document.FiscalPeriod AS FiscalPeriod,
  Document.DocumentDate AS DocumentDate,
  Document.PostingDate AS PostingDate,
  Document.AccountingDocumentType AS AccountingDocumentType,
  Document.CompanyCodeCurrency AS CompanyCodeCurrency,
  Document.AccountingDocCreatedByUser AS CreatedByUser,
  cast(coalesce(DownPay.DownPaymentType, ' ') as char4) AS DownPaymentType,
  Document.ReferenceDocumentType AS ReferenceDocumentType,
  Document.OriginalReferenceDocument AS OriginalReferenceDocument,
  Document._CompanyCodeCurrency AS _CompanyCodeCurrency,
  Document._AccountingDocumentCategory AS _AccountingDocumentCategory,
  Document._CompanyCode AS _CompanyCode,
  Document._AccountingDocumentType AS _AccountingDocumentType,
  Document._OperationalAcctgDocItem AS _OperationalAcctgDocItem,
  Document._FiscalYear AS _FiscalYear
INNER JOIN I_ClrgInfoRelationForAcctgDoc AS Clear ON /* join condition not captured in parsed metadata */
INNER JOIN I_AccountingDocumentType AS AcctDoc ON /* join condition not captured in parsed metadata */
INNER JOIN I_PT_DgtlSgntrNmbrRngeAcctg AS NrRange ON /* join condition not captured in parsed metadata */
INNER JOIN I_PT_SAFTPaytSignatureCheck AS check ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_SAFTAccountingTaxCheck AS _TotalItems ON _TotalItems.AccountingDocument = Document.AccountingDocument AND _TotalItems.CompanyCode = Document.CompanyCode AND _TotalItems.FiscalYear = Document.FiscalYear  -- association [0..1]
LEFT OUTER JOIN I_ReversalReason AS _RevReason ON _RevReason.ReversalReason = Document.ReversalReason  -- association [0..1]
LEFT OUTER JOIN I_AccountingDocument AS _ReversalDocument ON _ReversalDocument.AccountingDocument = Document.ReverseDocument AND _ReversalDocument.FiscalYear = Document.ReverseDocumentFiscalYear AND _ReversalDocument.CompanyCode = Document.CompanyCode  -- association [0..1]
LEFT OUTER JOIN I_ClrgInfoRelationForAcctgDoc AS _Clearing ON _Clearing.ClearingInfoCompanyCode = Document.CompanyCode AND _Clearing.ClearingAccountingDocument = Document.AccountingDocument AND _Clearing.ClearingFiscalYear = Document.FiscalYear AND _Clearing.AccountType = 'D' AND _Clearing.SpecialGLCode <> 'F'  -- association [0..1]
;