//@EndUserText.label : 'Technical view '
@VDM.private: true
@VDM.viewType: #COMPOSITE
@AbapCatalog.sqlViewName : 'PFIAPVNDROPITM6'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
define view P_APVendorOpenItems6
as select from
P_APVendorOpenItems0 as UnclrPayments
left outer join
I_ReceivablesPayablesItem as Clearings
on
UnclrPayments.FiscalYear = Clearings.InvoiceReferenceFiscalYear
and UnclrPayments.AccountingDocumentItem = Clearings.InvoiceItemReference
and UnclrPayments.AccountingDocument = Clearings.InvoiceReference
and UnclrPayments.CompanyCode = Clearings.CompanyCode
and (Clearings.ClearingAccountingDocument = '')
and (Clearings.FinancialAccountType = 'K')
and ( not Clearings.InvoiceReference = '')
and ( not Clearings.FollowOnDocumentType = '')
{
key UnclrPayments.CompanyCode,
key UnclrPayments.AccountingDocument,
key UnclrPayments.FiscalYear,
key UnclrPayments.AccountingDocumentItem,
// case UnclrPayments.DebitCreditCode
// when 'S' then
// UnclrPayments.AmountInCompanyCodeCurrency
// else
// - UnclrPayments.AmountInCompanyCodeCurrency
// end
UnclrPayments.AmountInCompanyCodeCurrency as OpenAmount,
// case Clearings.DebitCreditCode
// when 'S' then
// coalesce(Clearings.AmountInCompanyCodeCurrency, 0)
// else
// - coalesce(Clearings.AmountInCompanyCodeCurrency, 0)
// end
coalesce(Clearings.AmountInCompanyCodeCurrency, 0) as ClearedAmount,
UnclrPayments.DocumentCurrency,
UnclrPayments.Supplier,
UnclrPayments.SpecialGLTransactionType,
UnclrPayments.CompanyCodeCurrency,
_AccountingDocumentHeader
}
where
(UnclrPayments.ClearingAccountingDocument = '')
and (UnclrPayments.FinancialAccountType = 'K')
and (UnclrPayments.Supplier != '')
and (UnclrPayments.AccountingDocumentCategory = '')
and (
(UnclrPayments.SpecialGLTransactionType = 'A')
and (UnclrPayments.IsUsedInPaymentTransaction = '')
or (UnclrPayments.SpecialGLTransactionType != 'A')
and (UnclrPayments.IsUsedInPaymentTransaction = 'X')
)
and (
(UnclrPayments.InvoiceReference = '')
and (UnclrPayments.FollowOnDocumentType = '')
or (UnclrPayments.InvoiceReference != '')
and (UnclrPayments.FollowOnDocumentType = 'V')
)
;
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_RECEIVABLESPAYABLESITEM",
"P_APVENDOROPENITEMS0"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENT"
],
"BASE":
[
"P_APVENDOROPENITEMS0"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_APVendorOpenItems6 view