@AbapCatalog.sqlViewName: 'IBANKSTMTITEMTP'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA') //Partner's Bank Account - archiving is possible
@EndUserText.label: 'Bank Statement Item BO active and draft'
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.dataClass: #MIXED
@VDM.viewType: #COMPOSITE
@ObjectModel.draftEnabled: true
@ObjectModel.writeDraftPersistence: 'FEBEP_DRAFT_V2'
@ObjectModel.semanticKey: ['BankStatementShortID', 'BankStatementItem']
@ObjectModel.createEnabled
@ObjectModel.updateEnabled
@ObjectModel.deleteEnabled
define view I_ARBankStatementItemTP
as select from P_ARBankStatementItemIDBS as item
left outer join I_Arbankstatement as hdr on hdr.BankStatementShortID = item.BankStatementShortID
association [1..1] to I_ARBankStatementTP as _BankStatement on item.BankStatementShortID = _BankStatement.BankStatementShortID
association [0..1] to I_Currency as _Currency on _Currency.Currency = $projection.TransactionCurrency
association [0..1] to I_Currency as _OriginalCurrency on _OriginalCurrency.Currency = $projection.OriginalCurrency
association [0..1] to E_ARBankStatementItem as _Extension on $projection.BankStatementShortID = _Extension.BankStatementShortID
and $projection.BankStatementItem = _Extension.BankStatementItem
association [0..1] to I_Arbsitmemolinewithorig as _MemoLine on $projection.BankStatementShortID = _MemoLine.BankStatementShortID
and $projection.BankStatementItem = _MemoLine.BankStatementItem
association [0..*] to I_Armanualtransactionvh as _PaymentManualTransacTypeVH on $projection.PaymentManualTransacType = _PaymentManualTransacTypeVH.PaymentManualTransacType
// association [0..1] to E_ARBankStatementitem as _DraftExtension
// on $projection.BankStatementItemDraftUUID = _DraftExtension.BankStatementItemDraftUUID
{
// key item.BankStatementItemDraftUUID,
@ObjectModel.readOnly: true
key item.BankStatementShortID,
@ObjectModel.readOnly: true
key item.BankStatementItem as BankStatementItem,
// item.BankStatementDraftUUID,
@Semantics.currencyCode: true
@ObjectModel.readOnly: true
item.TransactionCurrency,
@Semantics.currencyCode: true
cast ( item.OriginalCurrency as farp_fwaer ) as OriginalCurrency,
@ObjectModel.readOnly: true
item.BankLedgerIsPosted,
@ObjectModel.readOnly: true
item.SubledgerIsPostedSuccessfully,
@DefaultAggregation: #NONE
@Semantics.amount.currencyCode: 'TransactionCurrency'
@ObjectModel.mandatory: true
item.AmountInTransactionCurrency,
@ObjectModel.readOnly: true
cast ( item.BankStatementItemGroup as farp_grpnr ) as BankStatementItemGroup,
// @Semantics.text: true
cast ( item.PaymentManualTransacType as far_vgman ) as PaymentManualTransacType,
@ObjectModel.readOnly: true
cast ( item.PaymentManualTransacTypeName as far_vgman_text ) as PaymentManualTransacTypeName,
@ObjectModel.readOnly: true
item.BankStatementPostingRule,
@ObjectModel.readOnly: true
item.BankStatementPostingRuleName,
@ObjectModel.readOnly: true
cast ( item.PaymentTransaction as farp_vorgc ) as PaymentTransaction,
cast ( item.PaymentTransactionCategory as fac_bs_it_tatyp ) as PaymentTransactionCategory,
@ObjectModel.readOnly: true
cast ( item.PaymentTransactionCategoryName as fac_bs_it_tatxt ) as PaymentTransactionCategoryName,
@ObjectModel.readOnly: true
item.InterpretationAlgorithm,
cast ( item.ValueDate as farp_valut ) as ValueDate,
cast ( item.PaymentAdviceAccountType as farp_avkoa ) as PaymentAdviceAccountType,
item.PaymentAdviceAccountTypeName,
cast ( case when PaymentAdviceAccountType = 'K'
then PaymentAdviceAccount
else '' end as lifnr ) as Supplier,
cast ( case when PaymentAdviceAccountType = 'D'
then PaymentAdviceAccount
else '' end as kunnr ) as Customer,
cast ( case when PaymentAdviceAccountType = 'S'
then PaymentAdviceAccount
else '' end as farp_hkont ) as GLAccount,
@ObjectModel.readOnly: true
cast ( item.HasAttachment as far_d_has_attch ) as HasAttachment,
@ObjectModel.readOnly: true
cast ( item.MemoLineIsChanged as farp_n2pchgind ) as MemoLineIsChanged,
@ObjectModel.readOnly: true
item.MemoLine1,
@ObjectModel.readOnly: true
@UI.multiLineText: true
//cast (case when _MemoLine.OriginalMemoLine = '' or _MemoLine.OriginalMemoLine is null
// then _MemoLine.MemoLine
// else _MemoLine.OriginalMemoLine end as far_memo_line_orig ) as OriginalMemoLine,
_MemoLine.OriginalMemoLine as OriginalMemoLine,
@UI.multiLineText: true
//cast (_MemoLine.MemoLine as far_memo_line ) as MemoLine,
_MemoLine.MemoLine as MemoLine,
@ObjectModel.readOnly: true
cast ( item.IsInProcess as far_d_in_process ) as IsInProcess,
item.BankInternalID,
item.BankAccount,
item.BankAccountInternalID,
@DefaultAggregation: #NONE
@Semantics.amount.currencyCode: 'OriginalCurrency'
cast ( item.AmountInOriginalCurrency as farp_fwbtr ) as AmountInOriginalCurrency,
// item.ExchangeRate,
cast ( item.ExchangeRate as far_curr_rate ) as ExchangeRate,
@ObjectModel.readOnly: true
item.DebitCreditCode,
item.BusinessPartnerName as BusinessPartnerName,
cast ( item.PaymentAdvice as farp_avsid ) as PaymentAdvice,
cast ( item.BankPostingDate as farp_bvdat) as BankPostingDate,
cast ( item.PostingDate as farp_budat ) as PostingDate,
@ObjectModel.readOnly: true
item.ValueDateTime,
cast ( item.PaymentExternalTransacType as farp_vgext ) as PaymentExternalTransacType,
cast ( item.PaymentTransactionDescription as farp_butxt ) as PaymentTransactionDescription,
cast ( item.AccountingClerk as farp_busab) as AccountingClerk,
item.CostCenter,
item.BusinessArea,
item.ProfitCenter,
item.TreasuryContract,
item.TreasuryContractType,
item.DaybookEntry,
cast ( item.Cheque as farp_chect ) as Cheque,
cast ( item.PaymentMediumReference as far_chect ) as PaymentMediumReference,
cast ( item.CustomerReferenceNumber as far_chect_orig ) as CustomerReferenceNumber,
@ObjectModel.readOnly: true
cast ( case when item.BankStatementItemIsInterpreted = 'X'
then 'X' else '' end as farp_pipre ) as BankStatementItemIsInterpreted,
@ObjectModel.readOnly: true
cast ( item.PostingErrorStatus as farp_estat ) as PostingErrorStatus,
@ObjectModel.readOnly: true
cast ( item.BankLedgerDocument as farp_belnr_bank_ledger ) as BankLedgerDocument,
item.FiscalYear,
@DefaultAggregation: #NONE
@Semantics.amount.currencyCode: 'TransactionCurrency'
cast ( item.FeeAmountInTransactionCrcy as farp_spesk ) as FeeAmountInTransactionCrcy,
@DefaultAggregation: #NONE
@Semantics.amount.currencyCode: 'OriginalCurrency'
cast ( item.FeeAmountInOriginalCrcy as farp_spesf ) as FeeAmountInOriginalCrcy,
cast ( item.BankPostingKey as farp_texts ) as BankPostingKey,
item.AcctDetnFreeDefinedAttribute,
item.DocumentReferenceID,
cast ( item.AssignmentReference as farp_zuonr ) as AssignmentReference,
cast ( item.PartnerBankCountry as farp_pabks ) as PartnerBankCountry,
cast ( item.PartnerBank as farp_pablz ) as PartnerBank,
cast ( item.PartnerBankSWIFTCode as paswi_eb) as PartnerBankSWIFTCode,
cast ( item.PartnerBankAccount as farp_pakto ) as PartnerBankAccount,
cast ( item.BankStatementItemDescription1 as farp_info1 ) as BankStatementItemDescription1,
cast ( item.BankStatementItemDescription2 as farp_info2 ) as BankStatementItemDescription2,
@ObjectModel.readOnly: true
cast ( item.SubledgerDocument as farp_nbbln ) as SubledgerDocument,
@ObjectModel.readOnly: true
cast ( item.BankLedgerOnAccountDocument as farp_ak1bl) as BankLedgerOnAccountDocument,
@ObjectModel.readOnly: true
cast ( item.SubledgerOnAccountDocument as farp_akbln ) as SubledgerOnAccountDocument,
item.PayerParty,
@ObjectModel.readOnly: true
item.BankStatementItemLifeCycSts,
@ObjectModel.readOnly: true
cast ( item.BankStatementItmLifeCycStsName as farp_bs_itm_lifecyc_stat_name ) as BankStatementItmLifeCycStsName,
cast ( item.AccountingExchangeRate as farp_kursf ) as AccountingExchangeRate,
// item.AccountingExchangeRate,
cast ( item.DocumentItemText as far_sgtxt) as DocumentItemText,
@ObjectModel.readOnly: true
cast ( item.BillOfExchangeFailureDate as farp_boe_failure_date ) as BillOfExchangeFailureDate,
cast ( item.BankReference as farp_vgref ) as BankReference,
cast ( item.ReferenceDocument as farp_awkey ) as ReferenceDocument,
cast ( item.ReferenceDocumentType as farp_xbtyp ) as ReferenceDocumentType,
@DefaultAggregation: #NONE
@Semantics.amount.currencyCode: 'TransactionCurrency'
cast ( item.OverdueChargeAmtInTransacCrcy as farp_arrsk ) as OverdueChargeAmtInTransacCrcy,
@ObjectModel.readOnly: true
item.BankStmntItemProcessingType,
item.PaymentReference,
cast ( item.ReturnReason as farp_return_reason ) as ReturnReason,
item.DunningBlockingReason,
cast ( item.BankLedgerExternalApplication as farp_applk ) as BankLedgerExternalApplication,
cast ( item.BankLedgerPostingIsSuppressed as farp_b1std ) as BankLedgerPostingIsSuppressed,
cast ( item.BankLedgerExtPostgErrorStatus as farp_b1err ) as BankLedgerExtPostgErrorStatus,
cast ( item.BankLedgerExtPostingDocument as farp_b1doc ) as BankLedgerExtPostingDocument,
cast ( item.BankLedgerExtPostingRefDocType as farp_b1typ ) as BankLedgerExtPostingRefDocType,
cast ( item.SubledgerExtPostingApplication as farp_b2app ) as SubledgerExtPostingApplication,
cast ( item.SubledgerPostingIsSuppressed as farp_b2std ) as SubledgerPostingIsSuppressed,
@UI.hidden: true
cast ( item.SubledgerExtPostingErrorStatus as farp_b2err ) as SubledgerExtPostingErrorStatus,
cast ( item.SubledgerExtPostingDocument as farp_b2doc ) as SubledgerExtPostingDocument,
cast ( item.SubledgerExtPostingRefDocType as farp_b2typ ) as SubledgerExtPostingRefDocType,
item.PartnerBankIBAN,
item.BankStmntProcessingApplication as BankStmntProcessingApplication,
item.AccountServicerReference as AccountServicerReference,
item.BankStatementItemStatusByBank as BankStatementItemStatusByBank,
item.BankStmntItmProcessingCategory as BankStmntItmProcessingCategory,
hdr.CompanyCode,
@ObjectModel.readOnly: true
cast( item.IsCompleted as far_completed_status ) as IsCompleted,
// TODO : translate log
@ObjectModel.readOnly: true
cast('Log' as far_applog) as ApplicationLog,
// item.IsActiveEntity,
// item.HasActiveEntity,
// item.HasDraftEntity ,
//
// item.DraftAdministrativeDataUUID,
@ObjectModel.readOnly: true
cast ( 7 as fdc_ux_fc ) as UxFcPaymentManualTransacType, //Mandatory
@ObjectModel.readOnly: true
cast ( 7 as fdc_ux_fc ) as UxFcValueDate, //Mandatory
@ObjectModel.readOnly: true
cast ( 7 as fdc_ux_fc ) as UxFcAmountInOriginalCurrency, //Mandatory
// @ObjectModel.associationType: #TO_COMPOSITION_ROOT
@ObjectModel.association.type: [ #TO_COMPOSITION_ROOT, #TO_COMPOSITION_PARENT ]
_BankStatement,
//
// _SiblingEntity,
// _DraftAdministrativeData,
_Currency,
_OriginalCurrency,
_PaymentManualTransacTypeVH
//// _Customer
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ARBANKSTATEMENT",
"I_ARBSITMEMOLINEWITHORIG",
"P_ARBANKSTATEMENTITEMIDBS"
],
"ASSOCIATED":
[
"E_ARBANKSTATEMENTITEM",
"I_ARBANKSTATEMENTTP",
"I_ARBSITMEMOLINEWITHORIG",
"I_ARMANUALTRANSACTIONVH",
"I_CURRENCY"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/