P_SK_CustRefDocNumVH

DDL: P_SK_CUSTREFDOCNUMVH SQL: PSKCUSTRDNUMVH Type: view COMPOSITE

P_SK_CustRefDocNumVH is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_JournalEntry, I_OperationalAcctgDocItem) and exposes 9 fields with key fields CompanyCode, AccountingDocument, FiscalYear.

Data Sources (2)

SourceAliasJoin Type
I_JournalEntry I_JournalEntry inner
I_OperationalAcctgDocItem I_OperationalAcctgDocItem from

Annotations (7)

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

Fields (9)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_OperationalAcctgDocItem CompanyCode
KEY AccountingDocument I_OperationalAcctgDocItem AccountingDocument
KEY FiscalYear I_OperationalAcctgDocItem FiscalYear
Customer I_OperationalAcctgDocItem Customer
AccountingDocumentType I_OperationalAcctgDocItem AccountingDocumentType
FiscalPeriod I_OperationalAcctgDocItem FiscalPeriod
DocumentDate I_OperationalAcctgDocItem DocumentDate
PostingDate I_OperationalAcctgDocItem PostingDate
DocumentReferenceID I_JournalEntry DocumentReferenceID
@AbapCatalog.sqlViewName: 'PSKCUSTRDNUMVH'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #COMPOSITE
@VDM.private: true

define view P_SK_CustRefDocNumVH
  as select from I_OperationalAcctgDocItem
    inner join   I_JournalEntry on  I_OperationalAcctgDocItem.CompanyCode        = I_JournalEntry.CompanyCode
                                and I_OperationalAcctgDocItem.AccountingDocument = I_JournalEntry.AccountingDocument
                                and I_OperationalAcctgDocItem.FiscalYear         = I_JournalEntry.FiscalYear
{
  key   I_OperationalAcctgDocItem.CompanyCode,
  key   I_OperationalAcctgDocItem.AccountingDocument,
  key   I_OperationalAcctgDocItem.FiscalYear,
        I_OperationalAcctgDocItem.Customer,
        case I_JournalEntry.ReferenceDocumentType
        when 'BKPF'
        then
          cast (I_JournalEntry.AccountingDocument as fisk_ref_doc_num)
        else
           cast (I_JournalEntry.DocumentReferenceID as fisk_ref_doc_num)
        end as ReferenceDocumentNumber,
        I_OperationalAcctgDocItem.AccountingDocumentType,
        I_OperationalAcctgDocItem.FiscalPeriod,
        I_OperationalAcctgDocItem.DocumentDate,
        I_OperationalAcctgDocItem.PostingDate,
        I_JournalEntry.DocumentReferenceID
}
where
      Customer                                       is not initial
  and I_OperationalAcctgDocItem.FinancialAccountType = 'D'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_JOURNALENTRY",
"I_OPERATIONALACCTGDOCITEM"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/