P_RU_AcctgDocReferenceID

DDL: P_RU_ACCTGDOCREFERENCEID SQL: PRUACCDOCREFID Type: view CONSUMPTION Package: GLO_FIN_IS_VAT_RU

S/P Ledgers: Primary Document Selection

P_RU_AcctgDocReferenceID is a Consumption CDS View that provides data about "S/P Ledgers: Primary Document Selection" in SAP S/4HANA. It reads from 1 data source (I_JournalEntry) and exposes 29 fields with key fields CompanyCode, AccountingDocument, FiscalYear. Part of development package GLO_FIN_IS_VAT_RU.

Data Sources (1)

SourceAliasJoin Type
I_JournalEntry I_JournalEntry from

Annotations (7)

NameValueLevelField
VDM.private true view
VDM.viewType #CONSUMPTION view
AbapCatalog.sqlViewName PRUACCDOCREFID view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (29)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode CompanyCode Receiver Company Code
KEY AccountingDocument AccountingDocument Journal Entry
KEY FiscalYear FiscalYear G/L Fiscal Year
AccountingDocumentType AccountingDocumentType Journal Entry Type
DocumentDate DocumentDate Journal Entry Date
PostingDate PostingDate Posting Date for GR
TaxReportingDate TaxReportingDate Tax Reporting Date
BusinessTransactionType BusinessTransactionType Bus.transaction
AccountingDocumentCategory AccountingDocumentCategory Journal Entry Category
LedgerGroup LedgerGroup Ledger Group
ReverseDocument ReverseDocument Reversed With
ReverseDocumentFiscalYear ReverseDocumentFiscalYear Year
ReferenceDocumentType ReferenceDocumentType Reference Document Type
OriginalReferenceDocument OriginalReferenceDocument Reference Key
OriginalReferenceDocumentNum
OriginalReferenceDocumentCntxt
DocumentReferenceID DocumentReferenceID Reference
ReferenceIDType
ReferenceIDDocumentNumber
ReferenceIDDocumentYear
AccountingDocumentHeaderText AccountingDocumentHeaderText Doc.Header Text
HeaderTextType
HeaderTextDocumentNumber
HeaderTextDocumentYear
IsReversal IsReversal Reversal doc.
IsReversed IsReversed Reversed?
ReversalReferenceDocument ReversalReferenceDocument Reversal Reference Document
ReversalReferenceDocumentCntxt ReversalReferenceDocumentCntxt Reversal Reference Document Context
SenderLogicalSystem SenderLogicalSystem Sender Logical System

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_RU_AcctgDocReferenceID.
-- 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: PRUACCDOCREFID

CREATE VIEW P_RU_AcctgDocReferenceID AS
SELECT
  CompanyCode,
  AccountingDocument,
  FiscalYear,
  AccountingDocumentType,
  DocumentDate,
  PostingDate,
  TaxReportingDate,
  BusinessTransactionType,
  AccountingDocumentCategory,
  LedgerGroup,
  ReverseDocument,
  ReverseDocumentFiscalYear,
  ReferenceDocumentType,
  OriginalReferenceDocument,
  substring(OriginalReferenceDocument,1,10) AS OriginalReferenceDocumentNum,
  substring(OriginalReferenceDocument,11,10) AS OriginalReferenceDocumentCntxt,
  DocumentReferenceID,
  substring(DocumentReferenceID,1,4) AS ReferenceIDType,
  substring(DocumentReferenceID,5,10) AS ReferenceIDDocumentNumber,
  concat('20',substring(DocumentReferenceID,15,2)) AS ReferenceIDDocumentYear,
  AccountingDocumentHeaderText,
  substring(AccountingDocumentHeaderText, 1, 4) AS HeaderTextType,
  substring(AccountingDocumentHeaderText, 5, 10) AS HeaderTextDocumentNumber,
  substring(AccountingDocumentHeaderText, 15, 4) AS HeaderTextDocumentYear,
  IsReversal,
  IsReversed,
  ReversalReferenceDocument,
  ReversalReferenceDocumentCntxt,
  SenderLogicalSystem
FROM I_JournalEntry
;