Argentina Supplier Payment Full and Partial Payment 2
P_AR_SuplrPaymentPartialFull2 is a Consumption CDS View that provides data about "Argentina Supplier Payment Full and Partial Payment 2" in SAP S/4HANA. It reads from 2 data sources (P_AR_SuplrPaymentPartialFull, I_OperationalAcctgDocItem) and exposes 17 fields with key fields StatryRptgEntity, StatryRptCategory, StatryRptRunID, CompanyCode, FiscalYear. Part of development package GLO_FIN_IS_AR_SUPPLIER_PAYMENT.
@AccessControl.authorizationCheck: #NOT_REQUIRED@ObjectModel.usageType.sizeCategory: #XL@ObjectModel.usageType.serviceQuality: #D@ObjectModel.usageType.dataClass: #MIXED@VDM.viewType: #CONSUMPTION@VDM.private: truedefineviewentity P_AR_SuplrPaymentPartialFull2
asselectfrom P_AR_SuplrPaymentPartialFull as PaymentItem
innerjoin I_OperationalAcctgDocItem as RelatedItem on RelatedItem.CompanyCode = PaymentItem.CompanyCode
and RelatedItem.FiscalYear = PaymentItem.RelatedDocumentFiscalYear
and RelatedItem.AccountingDocument = PaymentItem.ReltdDocAccountingDocument
and RelatedItem.AccountingDocumentItem = PaymentItem.RelatedDocumentItemNumber
leftouter to one join I_OperationalAcctgDocItem as PartiallyPaidItem on PartiallyPaidItem.CompanyCode = RelatedItem.CompanyCode
and PartiallyPaidItem.FiscalYear = RelatedItem.InvoiceReferenceFiscalYear
and PartiallyPaidItem.AccountingDocument = RelatedItem.InvoiceReference
and PartiallyPaidItem.FinancialAccountType = 'K'
and PaymentItem.ReltdSpclGLTransacType = 'P' // Payment Request
{
key PaymentItem.StatryRptgEntity,
key PaymentItem.StatryRptCategory,
key PaymentItem.StatryRptRunID,
key PaymentItem.CompanyCode,
key PaymentItem.FiscalYear,
key PaymentItem.AccountingDocument,
key PaymentItem.AccountingDocumentItem,
key PaymentItem.ClearingInformationIndex,
key PaymentItem.PaidItemClearingInfoIndex,
keycast(
casewhen PartiallyPaidItem.AccountingDocument isnotnullthen PartiallyPaidItem.AccountingDocument
when PartiallyPaidItem.AccountingDocument isnullthen RelatedItem.AccountingDocument
endas fis_belnr_rel_doc preserving type ) as ReltdDocAccountingDocument,
keycast(
casewhen PartiallyPaidItem.AccountingDocumentItem isnotnullthen PartiallyPaidItem.AccountingDocumentItem
when PartiallyPaidItem.AccountingDocumentItem isnullthen RelatedItem.AccountingDocumentItem
endas fis_buzei preserving type ) as RelatedDocumentItemNumber,
cast(
casewhen PartiallyPaidItem.FiscalYear isnotnullthen PartiallyPaidItem.FiscalYear
when PartiallyPaidItem.FiscalYear isnullthen RelatedItem.FiscalYear
endas fis_gjahr_rel_doc preserving type ) as RelatedDocumentFiscalYear,
cast(
casewhen PartiallyPaidItem.TransactionCurrency isnotnullthen PartiallyPaidItem.TransactionCurrency
when PartiallyPaidItem.TransactionCurrency isnullthen RelatedItem.TransactionCurrency
endas fiar_reltd_document_trans_crcy preserving type ) as ReltdDocTransactionCurrency,
@Semantics.amount.currencyCode: 'ReltdDocTransactionCurrency'
cast(
casewhen PartiallyPaidItem.AmountInTransactionCurrency isnotnullthen abs(PartiallyPaidItem.AmountInTransactionCurrency)
when PartiallyPaidItem.AmountInTransactionCurrency isnullthen abs(RelatedItem.AmountInTransactionCurrency)
endas fiar_reltd_doc_amnt_trans_crcy preserving type ) as ReltdDocAmtInTransCurrency,
cast(
casewhen PartiallyPaidItem.Supplier isnotnullthen PartiallyPaidItem.Supplier
when PartiallyPaidItem.Supplier isnullthen RelatedItem.Supplier
endas md_supplier preserving type ) as Supplier,
cast(
casewhen PartiallyPaidItem.GLAccount isnotnullthen PartiallyPaidItem.GLAccount
when PartiallyPaidItem.GLAccount isnullthen RelatedItem.GLAccount
endas fis_racct preserving type ) as GLAccount,
cast(
casewhen PaymentItem.PaymentMethod isnotnullthen PaymentItem.PaymentMethod
when PaymentItem.PaymentMethod isnullthen RelatedItem.PaymentMethod
endas farp_schzw_bseg preserving type ) as PaymentMethod,
PaymentItem.PaymentDate,
PaymentItem.CompanyCodeCountry,
PaymentItem.CompanyCodeCurrency,
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
PaymentItem.PaytAmountInCoCodeCurrency,
PaymentItem.ReltdSpclGLTransacType,
PaymentItem.HouseBank,
PaymentItem.PaymentGLAccount,
PaymentItem._GLAccountInCompanyCode
}