@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":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_JournalItemCFinDocHist view