@AbapCatalog.sqlViewName: 'CEDODCCF'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Mng Electronic Documents: Filter'
@ObjectModel.representativeKey: 'ElectronicDocUUID'
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@VDM.viewType: #CONSUMPTION
@Metadata.allowExtensions:true
define view C_ElectronicDocCockpitFilter
as select from I_ElectronicDoc as _eDocument
//Associations for source documents
left outer to one join I_ElectronicDocAccountingDoc as _AccountingDocument
on _AccountingDocument.AccountingDocument = substring(_eDocument.ElectronicDocSourceKey, 5, 10)
and _AccountingDocument.CompanyCode = substring(_eDocument.ElectronicDocSourceKey, 1, 4)
and _AccountingDocument.FiscalYear = substring(_eDocument.ElectronicDocSourceKey, 15, 4)
left outer to one join I_SupplierInvoice as _SupplierInvoice
on _SupplierInvoice.SupplierInvoice = substring(_eDocument.ElectronicDocSourceKey, 1, 10)
and _SupplierInvoice.FiscalYear = substring(_eDocument.ElectronicDocSourceKey, 11, 4)
left outer to one join I_REInvoiceHeader as _REInvoiceHeader on _REInvoiceHeader.REInvoiceNumber = substring(_eDocument.ElectronicDocSourceKey, 5, 10)
and _REInvoiceHeader.CompanyCode = substring(_eDocument.ElectronicDocSourceKey, 1, 4)
and _REInvoiceHeader.FiscalYear = substring(_eDocument.ElectronicDocSourceKey, 15, 4)
left outer to one join I_DeliveryDocument as _DeliveryDocument on _DeliveryDocument.DeliveryDocument = substring(_eDocument.ElectronicDocSourceKey,1,10)
association [0..1] to I_BillingDocument as _BillingDocument
on _BillingDocument.BillingDocument = _eDocument.ElectronicDocSourceKey
association [0..1] to R_SettlmtMgmtDoc as _SettlmtMgmtDoc
on _SettlmtMgmtDoc.SettlmtMgmtDoc = _eDocument.ElectronicDocSourceKey
// association [0..1] to I_ElectronicDocBusinessPartner as _Partner on $projection.partner = _Partner.Partner
association [0..1] to I_CAInvcgDocHeader as _CAInvcgDocHeader on _CAInvcgDocHeader.CAInvoicingDocument = _eDocument.ElectronicDocSourceKey
association [0..1] to I_PurchasingDocument as _PurchasingDoc on _PurchasingDoc.PurchasingDocument = _eDocument.ElectronicDocSourceKey
association [0..1] to I_CADocumentHeader as _CADocument on $projection.ElectronicDocSourceKey = _CADocument.CADocumentNumber
association [0..1] to I_SalesDocumentBasic as _SalesDocumentBasic on $projection.ElectronicDocSourceKey = _SalesDocumentBasic.SalesDocument
association [0..1] to E_ElectronicDoc as _Extension on $projection.ElectronicDocUUID = _Extension.ElectronicDocUUID
{
//Filters of Electronic Document
key _eDocument.ElectronicDocUUID ,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'C_CompanyCodeValueHelp',
element: 'CompanyCode' }
}]
_eDocument.ElectronicDocCompanyCode,
_eDocument.ElectronicDocSourceKey,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_ElectronicDocTypeText',
element: 'ElectronicDocType' }
}]
_eDocument.ElectronicDocType,
@Semantics.user.createdBy: true
_eDocument.ElectronicDocCreatedByUser,
@Semantics.systemDate.createdAt: true
_eDocument.ElectronicDocCreationDate,
@Semantics.fiscal.dayOfYear: true
@Consumption.filter:{selectionType:#INTERVAL,multipleSelections:false}
_eDocument.ElectronicDocPostingDate,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_Country',
element: 'Country' }
}]
_eDocument.ElectronicDocCountry ,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_ElectronicDocSourceTypeText',
element: 'ElectronicDocSourceType' }
}]
_eDocument.ElectronicDocSourceType ,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_ElectronicDocMetaStatusVH',
element: 'ElectronicDocMetaStatus' }
}]
_eDocument.ElectronicDocMetaStatus,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_ElectronicDocProcStatusText',
element: 'ElectronicDocProcessStatus' }
}]
_eDocument.ElectronicDocProcessStatus ,
@Semantics.user.lastChangedBy: true
_eDocument.ElectronicDocLastChangedByUser ,
@Semantics.systemDate.lastChangedAt: true
_eDocument.ElectronicDocLastChangeDate ,
@Semantics.systemTime.lastChangedAt: true
_eDocument.ElectronicDocLastChangeTime ,
@Semantics.systemDateTime.createdAt: true
_eDocument.ElectronicDocCreationTime ,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_ElectronicDocProcessText',
element: 'ElectronicDocProcess' }
}]
_eDocument.ElectronicDocProcess ,
_eDocument.ElectronicDocLastProcStep ,
_eDocument.ElectronicDocLastProcStepVar,
_eDocument.ElectronicDocHasError ,
_eDocument.ElectronicDocProcessVersion ,
_eDocument.ElectronicDocStatus ,
_eDocument.ElectronicDocIsContingency ,
_eDocument.ElectronicDocReferenceProcess ,
_eDocument.ElectronicDocIsArchPrprocgDone ,
_eDocument.ElectronicDocInterfaceType ,
cast( _eDocument.ElectronicDocInterfaceUUID as abap.char( 32 ) ) as ElectronicDocInterfaceUUID ,
_eDocument.ElectronicDocFileUUID ,
_eDocument.ElectronicDocInterfaceID ,
_eDocument.ElectronicDocInterfaceVersion ,
_eDocument.ElectronicDocIsCntdInArchive ,
_eDocument.ElectronicDocSrceCreatedByUser,
// _Partner.Partner,
//Filters of Billing Document
@Consumption.valueHelpDefinition: [{ entity: { name: 'I_BillingDocumentStdVH', element: 'BillingDocument' } }]
_BillingDocument.BillingDocument,
@Consumption.valueHelpDefinition: [ { entity: { name: 'C_BillingDocumentTypeVH', element: 'BillingDocumentType' } } ]
_BillingDocument.BillingDocumentType,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'D_Q2CCustomerCVH',
element: 'Customer' }
}]
_BillingDocument.SoldToParty,
@Consumption.filter:{selectionType:#INTERVAL,multipleSelections:false}
_BillingDocument.BillingDocumentDate,
//Filters of Accounting Document
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_AccountingDocumentStdVH',
element: 'AccountingDocument' },
additionalBinding: [{ localElement: 'ElectronicDocCompanyCode',
element: 'CompanyCode' },
{ localElement: 'FiscalYear',
element: 'FiscalYear' }]
}]
_AccountingDocument.AccountingDocument,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_AccountingDocumentTypeStdVH',
element: 'AccountingDocumentType' }
}]
_AccountingDocument.AccountingDocumentType,
@Semantics.fiscal.year: true
_AccountingDocument.FiscalYear,
@Semantics.systemDate.createdAt: true
@Consumption.filter:{selectionType:#INTERVAL,multipleSelections:false}
_AccountingDocument.DocumentDate,
@Semantics.fiscal.period: true
_AccountingDocument.FiscalPeriod,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_LedgerGroupVH',
element: 'LedgerGroup' }
}]
_AccountingDocument.LedgerGroup,
//Filters of Invoice Verification
_SupplierInvoice.SupplierInvoice,
@Semantics.fiscal.year: true
_SupplierInvoice.FiscalYear as EDocCockpitSupplierFiscalYear,
_SupplierInvoice.InvoicingParty,
_SupplierInvoice.SupplierInvoiceStatus,
//_SupplierInvoice.DocumentDate as SupplierInvoiceDocumentDate,
_SupplierInvoice.SupplierInvoiceIDByInvcgParty,
//Filters of Settlement Management
_SettlmtMgmtDoc.SettlmtMgmtDoc,
@Consumption: {
valueHelpDefinition: [{ entity: { name: 'I_SettlmtDocTypeStdVH', element: 'SettlmtDocType' } }]
}
_SettlmtMgmtDoc.SettlmtDocType,
@Consumption.filter:{selectionType:#INTERVAL,multipleSelections:false}
_SettlmtMgmtDoc.PostingDate,
//Filters of Convergent Invoicing Document
_CAInvcgDocHeader.CAInvoicingDocument,
@Consumption: {
valueHelpDefinition: [{ entity: { name: 'C_ContractAccountValueHelp', element: 'ContractAccount' } }]
}
_CAInvcgDocHeader.ContractAccount,
@Consumption.filter:{selectionType:#INTERVAL,multipleSelections:false}
_CAInvcgDocHeader.CAInvcgCreationDate,
@Consumption: {valueHelpDefinition: [{ entity: { name: 'C_CAContractPartnerValueHelp', element: 'BusinessPartner' } }]}
_CAInvcgDocHeader.BusinessPartner,
//Filters of Purchase Order
@Consumption: {valueHelpDefinition: [{ entity: { name: 'I_PurchasingDocumentStdVH', element: 'PurchasingDocument' } }]}
_PurchasingDoc.PurchasingDocument,
@Consumption.filter:{selectionType:#INTERVAL,multipleSelections:false}
_PurchasingDoc.PurchasingDocumentOrderDate,
@Consumption: {valueHelpDefinition: [{ entity: { name: 'I_Supplier_VH', element: 'Supplier' } }]}
_PurchasingDoc.Supplier,
@Consumption: {valueHelpDefinition: [{ entity: { name: 'I_PurchasingOrganization', element: 'PurchasingOrganization' } }]}
_PurchasingDoc.PurchasingOrganization,
//Filters of FICA Documents
_CADocument.CADocumentNumber,
@Consumption.filter:{selectionType:#INTERVAL,multipleSelections:false}
_CADocument.CAPostingDate,
// @Consumption: {valueHelpDefinition: [{ entity: { name: 'C_CAContractPartnerValueHelp', element: 'BusinessPartner' } }]}
//_CADocument._DocBPItem._BusinessPartner.BusinessPartner as EDocCockpitCABusinessPartner,
//Filter of Real Estate Invoice
_REInvoiceHeader.REInvoiceNumber,
_REInvoiceHeader.FiscalYear as EDocCockpitREFiscalYear,
//Sales Document
_SalesDocumentBasic.SalesDocument,
@Consumption.filter:{selectionType:#INTERVAL,multipleSelections:false}
_SalesDocumentBasic.SalesDocumentDate,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'D_Q2CCustomerCVH',
element: 'Customer' }
}]
_SalesDocumentBasic.SoldToParty as EDocCockpitSalesSoldToParty,
@Consumption:{ valueHelpDefinition: [ { entity: { name: 'I_SalesOrganization', element: 'SalesOrganization' } } ]}
_SalesDocumentBasic.SalesOrganization
}