P_JournalItemCFinDocHist

DDL: P_JOURNALITEMCFINDOCHIST SQL: PJICFINDOCHIST Type: view COMPOSITE

P_JournalItemCFinDocHist is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_SAFTJournalLineItem) and exposes 7 fields with key fields CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem, Ledger.

Data Sources (1)

SourceAliasJoin Type
I_SAFTJournalLineItem JournalLineItem from

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PJICFINDOCHIST view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #P view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #NOT_REQUIRED view

Fields (7)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_SAFTJournalLineItem CompanyCode
KEY FiscalYear I_SAFTJournalLineItem FiscalYear
KEY AccountingDocument I_SAFTJournalLineItem AccountingDocument
KEY LedgerGLLineItem I_SAFTJournalLineItem LedgerGLLineItem
KEY Ledger I_SAFTJournalLineItem Ledger
PostingDate I_SAFTJournalLineItem PostingDate
CFinPurchasingDocumentItem
@AbapCatalog.sqlViewName: 'PJICFINDOCHIST'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass:  #MIXED
@ObjectModel.usageType.serviceQuality: #P
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking : #NOT_REQUIRED
define view P_JournalItemCFinDocHist
  as select from            I_SAFTJournalLineItem      as JournalLineItem
    left outer to many join I_CFinPurchasingDocHistory as CFinPurchasingDocHistory on  JournalLineItem.ReferenceDocument = CFinPurchasingDocHistory.CFinMaterialDocument
                                                                                   and JournalLineItem.LogicalSystem     = CFinPurchasingDocHistory.SenderLogicalSystem
{

  key JournalLineItem.CompanyCode                              as CompanyCode,
  key JournalLineItem.FiscalYear                               as FiscalYear,
  key JournalLineItem.AccountingDocument                       as AccountingDocument,
  key JournalLineItem.LedgerGLLineItem                         as LedgerGLLineItem,
  key JournalLineItem.Ledger                                   as Ledger,

      JournalLineItem.PostingDate,

      max(CFinPurchasingDocHistory.CFinPurchasingDocumentItem) as CFinPurchasingDocumentItem,

      case
        when JournalLineItem.CentralFinanceSalesDocument is not initial
          then JournalLineItem.CentralFinanceSalesDocument

        when CFinPurchasingDocHistory.CFinPurchasingDocument is not null
         and CFinPurchasingDocHistory.CFinPurchasingDocument is not initial
          then CFinPurchasingDocHistory.CFinPurchasingDocument

        else ''
      end                                                      as OrderDocument //orderRef

}
where
     JournalLineItem.ReferenceDocumentType = 'RMRP'
  or JournalLineItem.ReferenceDocumentType = 'CF3PM'
group by
  JournalLineItem.CompanyCode,
  JournalLineItem.FiscalYear,
  JournalLineItem.AccountingDocument,
  JournalLineItem.LedgerGLLineItem,
  JournalLineItem.Ledger,
  JournalLineItem.PostingDate,
  CFinPurchasingDocHistory.CFinPurchasingDocument,
  JournalLineItem.CentralFinanceSalesDocument
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CFINPURCHASINGDOCHISTORY",
"I_SAFTJOURNALLINEITEM"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/