//@EndUserText.label: 'Core Entity: Accounting Document Item'
@VDM.private: true@VDM.viewType: #COMPOSITE@AbapCatalog.sqlViewName: 'PFIAPVNDROPITM0'
@AccessControl.authorizationCheck: #NOT_REQUIRED@ClientHandling.algorithm: #SESSION_VARIABLE@Metadata.ignorePropagatedAnnotations: truedefineview P_APVendorOpenItems0
asselectfrom I_ReceivablesPayablesItem
association [1..1] to I_AccountingDocument as _AccountingDocumentHeader
on $projection.CompanyCode = _AccountingDocumentHeader.CompanyCode
and $projection.AccountingDocument = _AccountingDocumentHeader.AccountingDocument
and $projection.FiscalYear = _AccountingDocumentHeader.FiscalYear
// if z_AccDoc has assosiations, I_CompanyCode can be skipped here
// and needed associasion can be propagated from z_AccDoc
// or it can be propagated from z_recpayitem
// --- problems with propagating: can't propagate _AccountingDocumentHeader._CompanyCode
// --- only _AccountingDocumentHeader can be propagated, but inview ... it will ask for AccountingDocument
// --- which coul not be included because of sum function (more result rows will be output than needed)
// commented out asin I_ReceivablesPayablesItem there is _CompanyCode now.
association [1..1] to I_CompanyCode as _CompanyCode // ZI_CompanyCodeTmp
on $projection.CompanyCode = _CompanyCode.CompanyCode
//association [1..1] to I_Supplier as _Vendor on $projection.Supplier = _Vendor.Supplier
association to I_Currency as _DocumentCurrency on $projection.DocumentCurrency = _DocumentCurrency.Currency
{
key CompanyCode,
key AccountingDocument,
key FiscalYear,
key AccountingDocumentItem,
AmountInCompanyCodeCurrency,
AmountInTransactionCurrency,
TransactionCurrency as DocumentCurrency,
InvoiceReference,
InvoiceReferenceFiscalYear,
InvoiceItemReference,
FollowOnDocumentType,
// DebitCreditCode,
Creditor as Supplier,
SpecialGLTransactionType,
ClearingAccountingDocument,
AccountingDocumentCategory,
FinancialAccountType,
IsUsedInPaymentTransaction,
TransactionTypeDetermination,
CompanyCodeCurrency,
_AccountingDocumentHeader,
_DocumentCurrency
};
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_RECEIVABLESPAYABLESITEM"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENT",
"I_COMPANYCODE",
"I_CURRENCY"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/