I_PT_SAFTBillgAcctgHeader

DDL: I_PT_SAFTBILLGACCTGHEADER Type: view_entity COMPOSITE

Accounting Document Header

I_PT_SAFTBillgAcctgHeader is a Composite CDS View that provides data about "Accounting Document Header" in SAP S/4HANA. It reads from 4 data sources (I_JournalEntry, I_PT_SAFTGenericSettings, I_JournalEntryItem, I_PT_AcctgDocDgtlSgntr) and exposes 27 fields with key fields CompanyCode, PT_SAFTDocumentNumber, PortugueseInvoiceDate. It has 2 associations to related views.

Data Sources (4)

SourceAliasJoin Type
I_JournalEntry Doc inner
I_PT_SAFTGenericSettings GenSet inner
I_JournalEntryItem JournalEntryItem inner
I_PT_AcctgDocDgtlSgntr Sig from

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_ReversalReason _RevReason _RevReason.ReversalReason = Doc.ReversalReason
[0..1] I_JournalEntry _ReversalDocument _ReversalDocument.AccountingDocument = Doc.ReverseDocument and _ReversalDocument.FiscalYear = Doc.ReverseDocumentFiscalYear and _ReversalDocument.CompanyCode = Doc.CompanyCode

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
EndUserText.label Accounting Document Header view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view

Fields (27)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_JournalEntry CompanyCode Receiver Company Code
KEY PT_SAFTDocumentNumber
KEY PortugueseInvoiceDate I_PT_AcctgDocDgtlSgntr PortugueseInvoiceDate Date
AccountingDocument I_JournalEntry AccountingDocument Journal Entry
FiscalYear I_JournalEntry FiscalYear G/L Fiscal Year
AccountingDocumentType I_JournalEntry AccountingDocumentType Journal Entry Type
PT_SeriesDocumentType I_PT_AcctgDocDgtlSgntr PT_SeriesDocumentType SAF-T Document Type
PortugueseDigitalSignature I_PT_AcctgDocDgtlSgntr PortugueseDigitalSignature Digital Signature
PortugueseDgtlSgntrKeyVersion I_PT_AcctgDocDgtlSgntr PortugueseDgtlSgntrKeyVersion Key Version
PT_SeriesDocumentNumber I_PT_AcctgDocDgtlSgntr PT_SeriesDocumentNumber ATCUD Code
PTDgtlSgntrSystemDateTimeText I_PT_AcctgDocDgtlSgntr PTDgtlSgntrSystemDateTimeText Sys. Date-Time
ReverseDocument I_JournalEntry ReverseDocument Reversed With
IsReversed I_JournalEntry IsReversed Reversed?
IsReversal I_JournalEntry IsReversal Reversal doc.
ReverseDocumentFiscalYear I_JournalEntry ReverseDocumentFiscalYear Year
AccountingDocumentCreationDate I_JournalEntry AccountingDocumentCreationDate Journal Entry Date
CreationTime I_JournalEntry CreationTime Time of Change
ReversalReason I_JournalEntry ReversalReason Reversal Reason
AccountingDocumentCategory I_JournalEntry AccountingDocumentCategory Journal Entry Category
FiscalPeriod I_JournalEntryItem FiscalPeriod Tax period
DocumentDate I_JournalEntry DocumentDate Journal Entry Date
PostingDate I_JournalEntry PostingDate Posting Date for GR
CompanyCodeCurrency I_JournalEntry CompanyCodeCurrency Local Currency
SpecialGLCode
CreatedByUser I_JournalEntry AccountingDocCreatedByUser User which created overhead document
_ReversalDocument _ReversalDocument
_RevReason _RevReason

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 I_PT_SAFTBillgAcctgHeader.
-- 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 I_PT_SAFTBillgAcctgHeader AS
SELECT
  Doc.CompanyCode AS CompanyCode,
  cast(Sig.PortugueseInvoiceNumber as abap.char(60)) AS PT_SAFTDocumentNumber,
  Sig.PortugueseInvoiceDate AS PortugueseInvoiceDate,
  Doc.AccountingDocument AS AccountingDocument,
  Doc.FiscalYear AS FiscalYear,
  Doc.AccountingDocumentType AS AccountingDocumentType,
  Sig.PT_SeriesDocumentType AS PT_SeriesDocumentType,
  Sig.PortugueseDigitalSignature AS PortugueseDigitalSignature,
  Sig.PortugueseDgtlSgntrKeyVersion AS PortugueseDgtlSgntrKeyVersion,
  Sig.PT_SeriesDocumentNumber AS PT_SeriesDocumentNumber,
  Sig.PTDgtlSgntrSystemDateTimeText AS PTDgtlSgntrSystemDateTimeText,
  Doc.ReverseDocument AS ReverseDocument,
  Doc.IsReversed AS IsReversed,
  Doc.IsReversal AS IsReversal,
  Doc.ReverseDocumentFiscalYear AS ReverseDocumentFiscalYear,
  Doc.AccountingDocumentCreationDate AS AccountingDocumentCreationDate,
  Doc.CreationTime AS CreationTime,
  Doc.ReversalReason AS ReversalReason,
  Doc.AccountingDocumentCategory AS AccountingDocumentCategory,
  JournalEntryItem.FiscalPeriod AS FiscalPeriod,
  Doc.DocumentDate AS DocumentDate,
  Doc.PostingDate AS PostingDate,
  Doc.CompanyCodeCurrency AS CompanyCodeCurrency,
  Doc._OperationalAcctgDocItem[FinancialAccountType = 'D'].SpecialGLCode AS SpecialGLCode,
  Doc.AccountingDocCreatedByUser AS CreatedByUser
FROM I_PT_AcctgDocDgtlSgntr AS Sig
INNER JOIN I_JournalEntry AS Doc ON /* join condition not captured in parsed metadata */
INNER JOIN I_PT_SAFTGenericSettings AS GenSet ON /* join condition not captured in parsed metadata */
INNER JOIN I_JournalEntryItem AS JournalEntryItem ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_ReversalReason AS _RevReason ON _RevReason.ReversalReason = Doc.ReversalReason  -- association [0..1]
LEFT OUTER JOIN I_JournalEntry AS _ReversalDocument ON _ReversalDocument.AccountingDocument = Doc.ReverseDocument AND _ReversalDocument.FiscalYear = Doc.ReverseDocumentFiscalYear AND _ReversalDocument.CompanyCode = Doc.CompanyCode  -- association [0..1]
;