P_Hu_FiInvoice

DDL: P_HU_FIINVOICE SQL: PHUFIINVOICE Type: view COMPOSITE

P_Hu_FiInvoice is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_JournalEntry) and exposes 9 fields with key fields OriginalReferenceDocument, AccountingDocument, CompanyCode, FiscalYear, ReferenceDocumentType.

Data Sources (1)

SourceAliasJoin Type
I_JournalEntry I_JournalEntry from

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PHUFIINVOICE view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter 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 OriginalReferenceDocument OriginalReferenceDocument
KEY AccountingDocument AccountingDocument
KEY CompanyCode CompanyCode
KEY FiscalYear FiscalYear
KEY ReferenceDocumentType ReferenceDocumentType
Invoice DocumentReferenceID
InvoiceDate DocumentDate
PredecessorReferenceDocument
PredecessorReferenceDocType
@AbapCatalog.sqlViewName: 'PHUFIINVOICE'
@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
//@EndUserText.label: 'FI Invoice details for Domestic Sales List'

@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #COMPOSITE
@VDM.private: true
define view P_Hu_FiInvoice
  as select from I_JournalEntry
  //    left outer join I_JournalEntryItem on  I_JournalEntryItem.CompanyCode        =  _JournalEntry.CompanyCode

  //                                       and I_JournalEntryItem.AccountingDocument =  _JournalEntry.AccountingDocument

  //                                       and I_JournalEntryItem.FiscalYear         =  _JournalEntry.FiscalYear

  //                                       and I_JournalEntryItem.InvoiceReference   <> ''

  //  association [0..1] to I_JournalEntry as _JournalEntryOrig on  _JournalEntryOrig.CompanyCode        = _JournalEntry.CompanyCode

  //                                                            and _JournalEntryOrig.AccountingDocument = I_JournalEntryItem.InvoiceReference

  //                                                            and _JournalEntryOrig.FiscalYear         = _JournalEntry.FiscalYear


{
  key OriginalReferenceDocument,
  key AccountingDocument,
  key CompanyCode,
  key FiscalYear,
  key ReferenceDocumentType,
      DocumentReferenceID                as Invoice,
      DocumentDate                       as InvoiceDate,
      //      cast( ' ' as vbeln )         as ReferenceDocument

      //      case I_JournalEntryItem.InvoiceReference

      //        when '' then cast( ' ' as vbeln )

      //        else _JournalEntryOrig.DocumentReferenceID

      //      end                          as ReferenceDocument

      cast ('' as awkey)                 as PredecessorReferenceDocument,
      cast ('' as awtyp)                 as PredecessorReferenceDocType 
}
where
      ReferenceDocumentType = 'BKPF'
  //and AccountingDocument    = substring(

  //  OriginalReferenceDocument, 1, 10

  //)        

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_JOURNALENTRY"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/