I_Paymentstatistics_Base is a Basic CDS View that provides data about "Base View for Payment Statistics" in SAP S/4HANA. It reads from 6 data sources and exposes 15 fields.
@AbapCatalog.sqlViewName: 'IPSBASE'
@ClientHandling.algorithm: #SESSION_VARIABLE@AbapCatalog.compiler.compareFilter: true@AccessControl.authorizationCheck: #NOT_REQUIRED@VDM.viewType: #BASIC@ObjectModel.usageType.serviceQuality: #D@ObjectModel.usageType.sizeCategory: #XL@ObjectModel.usageType.dataClass: #MIXED@EndUserText.label: 'Base View for Payment Statistics'
@Metadata.ignorePropagatedAnnotations: truedefineview I_Paymentstatistics_Base
asselectfrom bnk_batch_item as batch_item
innerjoin reguhm as reguhm on batch_item.batch_no = reguhm.batchno
and batch_item.empfg = reguhm.empfg
and batch_item.kunnr = reguhm.kunnr
and batch_item.laufd = reguhm.laufd_m
and batch_item.laufi = reguhm.laufi_m
and batch_item.lifnr = reguhm.lifnr
and batch_item.vblnr = reguhm.vblnr
and batch_item.zbukr = reguhm.zbukr
leftouterjoin crm_jest as _crm_jest on batch_item.guid = _crm_jest.objnr
and _crm_jest.inact !='X'
leftouterjoin bnk_batch_header as header on batch_item.batch_no = header.batch_no
and batch_item.guid = header.guid
leftouterjoin reguh as reguh on batch_item.zbukr = reguh.zbukr
and batch_item.vblnr = reguh.vblnr
and batch_item.laufi = reguh.laufi
and batch_item.laufd = reguh.laufd
leftouterjoin t015w as instruc on instruc.banks = reguh.ubnks and instruc.zlsch = reguh.rzawe and instruc.dtaws = reguh.dtaws
{
// batch_item.guid,
batch_item.zbukr as CompanyCode,
batch_item.batch_no as PaymentBatch,
cast ( 1 as fclm_bam_ps_number_of_payments ) as NumberOfPayments,
_crm_jest.stat as Status,
casewhen _crm_jest.stat = 'IBC02' then 'APPROVAL'
when ( _crm_jest.stat <= 'IBC08' and _crm_jest.stat >= 'IBC04') or _crm_jest.stat = 'IBC17' then 'SENTTOBANK'
when _crm_jest.stat = 'IBC01' then 'INITIAL'
when _crm_jest.stat = 'IBC03' or _crm_jest.stat = 'IBC15' or _crm_jest.stat = 'IBC11' then 'OTHERS'
else 'EXCEPTION' endas PaymentProcessingStatus,
header.rule_id as PaymentBatchRule,
header.crdate as CreationDate,
header.chdate as LastChangeDate,
@Semantics.currencyCode: true
reguh.waers as PaymentCurrency,
reguh.rzawe as PaymentMethod,
reguh.zbnky as PayeeBankInternalID,
reguh.zbnks as PayeeBankCountry,
reguh.ubnks as BankCountryKey,
@Semantics.amount.currencyCode: 'PaymentCurrency'
-reguh.rwbtr as AmountInPaymentCurrency,
reguh.ubnky as BankKey,
instruc.dturg as IsUrgentPayment
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"BNK_BATCH_HEADER",
"BNK_BATCH_ITEM",
"CRM_JEST",
"REGUH",
"REGUHM",
"T015W"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/