I_PaymentRequestTP

DDL: I_PAYMENTREQUESTTP SQL: IPAYMENTREQTP Type: view TRANSACTIONAL Package: ODATA_PROCESS_FF_PAYMENTS

Payment Request Draft

I_PaymentRequestTP is a Transactional CDS View that provides data about "Payment Request Draft" in SAP S/4HANA. It reads from 2 data sources (I_OperationalAcctgDocItem, I_PaymentRequest) and exposes 115 fields with key field PaymentRequest. It has 4 associations to related views. Part of development package ODATA_PROCESS_FF_PAYMENTS.

Data Sources (2)

SourceAliasJoin Type
I_OperationalAcctgDocItem _AccountingDocItem002 left_outer
I_PaymentRequest _PaymentRequest from

Associations (4)

CardinalityTargetAliasCondition
[1..1] I_Customer _Customer $projection.Customer = _Customer.Customer
[1..1] I_Supplier _Supplier $projection.Supplier = _Supplier.Supplier
[1..1] P_PFFPCustomerSupplierBankType _BankType $projection.PaymentRequest = _BankType.PaymentRequest
[1..1] E_PaymentRequest _Extension $projection.PaymentRequest = _Extension.PaymentRequest

Annotations (19)

NameValueLevelField
AbapCatalog.sqlViewName IPAYMENTREQTP view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #REQUIRED view
EndUserText.label Payment Request Draft view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.sapObjectNodeType.name PaymentRequest view
ObjectModel.modelCategory #BUSINESS_OBJECT view
ObjectModel.compositionRoot true view
ObjectModel.transactionalProcessingEnabled true view
ObjectModel.draftEnabled true view
ObjectModel.writeDraftPersistence PAYRQ_DRAFT view
ObjectModel.createEnabled true view
ObjectModel.updateEnabled true view
VDM.viewType #TRANSACTIONAL view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view

Fields (115)

KeyFieldSource TableSource FieldDescription
KEY PaymentRequest I_PaymentRequest PaymentRequest
CreatedByUser I_PaymentRequest CreatedByUser
AccountingDocumentCreationDate I_PaymentRequest AccountingDocumentCreationDate
PaymentRequestAmountInPaytCrcy I_PaymentRequest PaymentRequestAmountInPaytCrcy
PaymentRequestCurrency I_PaymentRequest PaymentRequestCurrency
PaymentRequestAmountInCCCrcy I_PaymentRequest PaymentRequestAmountInCCCrcy
CompanyCodeCurrency I_PaymentRequest CompanyCodeCurrency
PayeeName I_PaymentRequest PayeeName
PayeeBankCountry I_PaymentRequest PayeeBankCountry
PayeeBankInternalID I_PaymentRequest PayeeBankInternalID
BankDetailReference I_PaymentRequest BankDetailReference
PayeeBankControlKey I_PaymentRequest PayeeBankControlKey
PayeeBank I_PaymentRequest PayeeBank
PayeeBankAccount
BankAccountHolderName I_PaymentRequest BankAccountHolderName
PayeeTitle I_PaymentRequest PayeeTitle
PayeePostalCode I_PaymentRequest PayeePostalCode
PayeePOBox I_PaymentRequest PayeePOBox
POBoxPostalCode I_PaymentRequest POBoxPostalCode
PayeeAdditionalName2 I_PaymentRequest PayeeAdditionalName2
PayeeAdditionalName3 I_PaymentRequest PayeeAdditionalName3
PayeeAdditionalName4 I_PaymentRequest PayeeAdditionalName4
PayeeCityName I_PaymentRequest PayeeCityName
PayeeStreet I_PaymentRequest PayeeStreet
PayeeCountry I_PaymentRequest PayeeCountry
PayeeRegion I_PaymentRequest PayeeRegion
PayeeLanguage I_PaymentRequest PayeeLanguage
PayeeFaxNumber I_PaymentRequest PayeeFaxNumber
PayeeTelephoneNumber I_PaymentRequest PayeeTelephoneNumber
PayeeIBAN I_PaymentRequest PayeeIBAN
ReferenceTypeText I_PaymentRequest ReferenceTypeText
PaymentReference I_PaymentRequest PaymentReference
CompanyCode I_PaymentRequest CompanyCode
BusinessArea I_PaymentRequest BusinessArea
DocumentItemTextendasDocumentItemText
PayingCompanyCode I_PaymentRequest PayingCompanyCode
HouseBank I_PaymentRequest HouseBank
HouseBankAccount I_PaymentRequest HouseBankAccount
AccountingDocument I_PaymentRequest AccountingDocument
ClearingAccountingDocument I_PaymentRequest ClearingAccountingDocument
ClearingDate I_PaymentRequest ClearingDate
ClearingFiscalYear _CalendarDateForCompanyCode FiscalYear
PaymentMethod I_PaymentRequest PaymentMethod
PaymentMethodSupplement I_PaymentRequest PaymentMethodSupplement
IsSinglePayment I_PaymentRequest IsSinglePayment
ValueDate I_PaymentRequest ValueDate
DataExchangeInstructionKey I_PaymentRequest DataExchangeInstructionKey
DataExchangeInstruction1 I_PaymentRequest DataExchangeInstruction1
DataExchangeInstruction2 I_PaymentRequest DataExchangeInstruction2
DataExchangeInstruction3 I_PaymentRequest DataExchangeInstruction3
DataExchangeInstruction4 I_PaymentRequest DataExchangeInstruction4
IsUrgentPaymentendasIsUrgentPayment
PaymentRequestOrigin I_PaymentRequest PaymentRequestOrigin
ReleaseDate I_PaymentRequest ReleaseDate
ReleasedByUser I_PaymentRequest ReleasedByUser
PaymentRequestPostingDate I_PaymentRequest PaymentRequestPostingDate
PostingCreatedByUser I_PaymentRequest PostingCreatedByUser
PaytReqIsReleasedForPosting I_PaymentRequest PaytReqIsReleasedForPosting
PaytReqIsCompleted I_PaymentRequest PaytReqIsCompleted
PaytReqIsReleasedForPayment I_PaymentRequest PaytReqIsReleasedForPayment
IsReversed I_PaymentRequest IsReversed
ReversalReason I_PaymentRequest ReversalReason
StateCentralBankPaymentReason I_PaymentRequest StateCentralBankPaymentReason
SupplyingCountry I_PaymentRequest SupplyingCountry
TaxID1 I_PaymentRequest TaxID1
BankChain
PaymentRequestType
CustomerBankType _BankType CustomerBankType
SupplierBankType _BankType SupplierBankType
LastChangedByUser
LastChangeTime
LastChangeDate
CreationTime
PaymentRequestVariant
PaymentRequestTemplate
PaymentRepetitiveCode I_PaymentRequest PaymentRepetitiveCode
PayeePaymentSystem I_PaymentRequest PayeePaymentSystem
PayeeAliasType I_PaymentRequest PayeeAliasType
PayeeAliasName I_PaymentRequest PayeeAliasName
TradingPartner I_PaymentRequest TradingPartner
FiscalYear I_PaymentRequest FiscalYear
BankCountry I_PaymentRequest BankCountry
BankInternalID I_PaymentRequest BankInternalID
GLAccount I_PaymentRequest GLAccount
StatusCode I_PaymentRequest StatusCode
FiscalYearVariant _PayingCompanyCode FiscalYearVariant
AmountInAdditionalCurrency1 I_PaymentRequest AmountInAdditionalCurrency1
AdditionalCurrency1 I_PaymentRequest AdditionalCurrency1
AmountInAdditionalCurrency2 I_PaymentRequest AmountInAdditionalCurrency2
AdditionalCurrency2 I_PaymentRequest AdditionalCurrency2
PaymentReason I_PaymentRequest PaymentReason
BankAliasEntryIsSelected
PaymentRequestReferenceText
_PayeeBank I_PaymentRequest _PayeeBank
_Bank I_PaymentRequest _Bank
_HouseBankAccount I_PaymentRequest _HouseBankAccount
_BusinessAreaText I_PaymentRequest _BusinessAreaText
_CompanyCode I_PaymentRequest _CompanyCode
_PayingCompanyCode I_PaymentRequest _PayingCompanyCode
_PartnerCompany I_PaymentRequest _PartnerCompany
_PaymentRequestCurrency I_PaymentRequest _PaymentRequestCurrency
_CompanyCodeCurrency I_PaymentRequest _CompanyCodeCurrency
_AdditionalCurrency1 I_PaymentRequest _AdditionalCurrency1
_AdditionalCurrency2 I_PaymentRequest _AdditionalCurrency2
_DataExchangeInstructionKeys I_PaymentRequest _DataExchangeInstructionKeys
_PaymentMethod I_PaymentRequest _PaymentMethod
_PaytReqChangeAndPost I_PaymentRequest _PaytReqChangeAndPost
_SystemStatusText I_PaymentRequest _SystemStatusText
_ReversalReason I_PaymentRequest _ReversalReason
_CalendarDateForCompanyCode I_PaymentRequest _CalendarDateForCompanyCode
_PaymentReason I_PaymentRequest _PaymentReason
_Customer _Customer
_Supplier _Supplier
_PayeePaymentSystem _PayeePaymentSystem
_PayeeAliasType _PayeeAliasType
@AbapCatalog.sqlViewName: 'IPAYMENTREQTP'
@AbapCatalog.compiler.compareFilter: true

@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #REQUIRED

@EndUserText.label: 'Payment Request Draft'

@ClientHandling.algorithm: #SESSION_VARIABLE

@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL

@ObjectModel:
{  sapObjectNodeType.name: 'PaymentRequest'
 ,modelCategory: #BUSINESS_OBJECT
 ,compositionRoot: true
 ,transactionalProcessingEnabled: true
 ,draftEnabled: true
 ,writeDraftPersistence: 'PAYRQ_DRAFT'
 ,semanticKey:  [ 'PaymentRequest' ]
 ,createEnabled: true
 ,updateEnabled: true }

@VDM:{ viewType: #TRANSACTIONAL, lifecycle.contract.type: #SAP_INTERNAL_API }
  
define view I_PaymentRequestTP
  as select from I_PaymentRequest                       as _PaymentRequest
  
  left outer join I_OperationalAcctgDocItem             as _AccountingDocItem002   on  _AccountingDocItem002.CompanyCode           = _PaymentRequest.CompanyCode        
                                                                                  and _AccountingDocItem002.AccountingDocument     = _PaymentRequest.AccountingDocument 
                                                                                  and _AccountingDocItem002.FiscalYear             = _PaymentRequest.FiscalYear         
                                                                                  and _AccountingDocItem002.AccountingDocumentItem = '002' 
//                                                                                  and _AccountingDocItem002.DebitCreditCode        = 'S'

                                                                                            
  association [1..1] to I_Customer                      as _Customer              on  $projection.Customer           =  _Customer.Customer
  association [1..1] to I_Supplier                      as _Supplier              on  $projection.Supplier           =  _Supplier.Supplier
  association [1..1] to P_PFFPCustomerSupplierBankType  as _BankType              on  $projection.PaymentRequest     =  _BankType.PaymentRequest
  association [1..1] to E_PaymentRequest                as _Extension             on  $projection.PaymentRequest     = _Extension.PaymentRequest     
           
{
      @ObjectModel.readOnly
  key _PaymentRequest.PaymentRequest         as PaymentRequest,

      _PaymentRequest.CreatedByUser,
      _PaymentRequest.AccountingDocumentCreationDate,

      //Payee

      @Semantics: { amount : {currencyCode: 'PaymentRequestCurrency'} }
      _PaymentRequest.PaymentRequestAmountInPaytCrcy,

      @Semantics.currencyCode:true
      _PaymentRequest.PaymentRequestCurrency,

      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      _PaymentRequest.PaymentRequestAmountInCCCrcy,


      @Semantics.currencyCode:true
      _PaymentRequest.CompanyCodeCurrency,

      _PaymentRequest.PayeeName,

      _PaymentRequest.PayeeBankCountry,
      _PaymentRequest.PayeeBankInternalID,
      
      _PaymentRequest.BankDetailReference,
      _PaymentRequest.PayeeBankControlKey,
      _PaymentRequest.PayeeBank,

      cast(_PaymentRequest.PayeeBankAccount as fap_bpa_dzbnkn)  as PayeeBankAccount,

      _PaymentRequest.BankAccountHolderName,
      _PaymentRequest.PayeeTitle,
      _PaymentRequest.PayeePostalCode,
      _PaymentRequest.PayeePOBox,
      _PaymentRequest.POBoxPostalCode,
      _PaymentRequest.PayeeAdditionalName2,
      _PaymentRequest.PayeeAdditionalName3,
      _PaymentRequest.PayeeAdditionalName4,
      _PaymentRequest.PayeeCityName,
      _PaymentRequest.PayeeStreet,
      _PaymentRequest.PayeeCountry,
      _PaymentRequest.PayeeRegion,
      _PaymentRequest.PayeeLanguage,
      _PaymentRequest.PayeeFaxNumber,
      _PaymentRequest.PayeeTelephoneNumber,
      _PaymentRequest.PayeeIBAN,
      _PaymentRequest.ReferenceTypeText,
      _PaymentRequest.PaymentReference,

      //Posting Data

      @ObjectModel.foreignKey.association: '_CompanyCode'
      _PaymentRequest.CompanyCode as CompanyCode,
      _PaymentRequest.BusinessArea,

      cast(
        case
          when _AccountingDocItem002.FinancialAccountType is null
              then _PaymentRequest._PaytReqChangeAndPost.CustomerSupplierAccount
          when _AccountingDocItem002.FinancialAccountType = 'D'
              then _AccountingDocItem002.Customer
          when _AccountingDocItem002.FinancialAccountType = 'K'
              then _AccountingDocItem002.Supplier
          when _AccountingDocItem002.FinancialAccountType = 'S'
              then _AccountingDocItem002.GLAccount
          else ''
      end as farp_ktonr_av)             as CustomerSupplierAccount,

      cast(
        case
          when (    _AccountingDocItem002.FinancialAccountType is null 
                and _PaymentRequest._PaytReqChangeAndPost.FinancialAccountType = 'D' )
            then _PaymentRequest._PaytReqChangeAndPost.CustomerSupplierAccount
          
          when (    _AccountingDocItem002.FinancialAccountType is not null 
                and _AccountingDocItem002.FinancialAccountType = 'D' )
            then _AccountingDocItem002.Customer
          
          else ''
      end as farp_customer_id)          as Customer,

      cast(
        case
          when (    _AccountingDocItem002.FinancialAccountType is null
                and _PaymentRequest._PaytReqChangeAndPost.FinancialAccountType = 'K' )
            then _PaymentRequest._PaytReqChangeAndPost.CustomerSupplierAccount
          
          when (    _AccountingDocItem002.FinancialAccountType is not null
                and _AccountingDocItem002.FinancialAccountType = 'K' ) 
            then _AccountingDocItem002.Supplier

          else ''
      end as farp_supplier_id)          as Supplier,

      case
        when _AccountingDocItem002.DocumentItemText is null 
          then _PaymentRequest._PaytReqChangeAndPost.DocumentItemText
        else _AccountingDocItem002.DocumentItemText
      end                               as DocumentItemText,

      cast(
        case
          when _AccountingDocItem002.FinancialAccountType is null 
            then _PaymentRequest._PaytReqChangeAndPost.FinancialAccountType
          else _AccountingDocItem002.FinancialAccountType
      end as financialaccounttype)      as FinancialAccountType,

      case
        when _AccountingDocItem002.FinancialAccountType is null
          then _PaymentRequest._PaytReqChangeAndPost._FinancialAccountType._Text[1:Language = $session.system_language].FinancialAccountTypeName
        else _AccountingDocItem002._FinancialAccountType._Text[1:Language = $session.system_language].FinancialAccountTypeName
      end                               as FinancialAccountTypeName,

      //House Bank

      _PaymentRequest.PayingCompanyCode,
      _PaymentRequest.HouseBank,
      _PaymentRequest.HouseBankAccount,

      @ObjectModel.readOnly
      _PaymentRequest.AccountingDocument,

      @ObjectModel.readOnly
      _PaymentRequest.ClearingAccountingDocument,
      
      @ObjectModel.readOnly
      _PaymentRequest.ClearingDate,     
      
      @ObjectModel.readOnly             
      _CalendarDateForCompanyCode.FiscalYear as ClearingFiscalYear,

      //Payment Data

      _PaymentRequest.PaymentMethod,
      _PaymentRequest.PaymentMethodSupplement,
      @Semantics.booleanIndicator: true
      _PaymentRequest.IsSinglePayment,
      _PaymentRequest.ValueDate,
      _PaymentRequest.DataExchangeInstructionKey,
      _PaymentRequest.DataExchangeInstruction1,
      _PaymentRequest.DataExchangeInstruction2,
      _PaymentRequest.DataExchangeInstruction3,
      _PaymentRequest.DataExchangeInstruction4,
      
      @Semantics.booleanIndicator: true
      case
        when _PaymentRequest._DataExchangeInstructionKeys.IsUrgentPayment is null
        then ''
        else _PaymentRequest._DataExchangeInstructionKeys.IsUrgentPayment
      end as IsUrgentPayment,
      
      _PaymentRequest.PaymentRequestOrigin,
      
      @ObjectModel.readOnly
      _PaymentRequest.ReleaseDate,
      
      @ObjectModel.readOnly
      _PaymentRequest.ReleasedByUser,

      @ObjectModel.readOnly
      _PaymentRequest.PaymentRequestPostingDate,
            
      @ObjectModel.readOnly
      _PaymentRequest.PostingCreatedByUser,
      

      @ObjectModel.readOnly
      @Semantics.booleanIndicator: true
      _PaymentRequest.PaytReqIsReleasedForPosting,
      
      @Semantics.booleanIndicator: true
      _PaymentRequest.PaytReqIsCompleted,
      
      @Semantics.booleanIndicator: true
      _PaymentRequest.PaytReqIsReleasedForPayment,

      @ObjectModel.readOnly
      @Semantics.booleanIndicator: true
      _PaymentRequest.IsReversed,

      _PaymentRequest.ReversalReason,
      _PaymentRequest.StateCentralBankPaymentReason,
      _PaymentRequest.SupplyingCountry,
      _PaymentRequest.TaxID1,
      _PaymentRequest._PaytReqChangeAndPost.BankChain,

      cast( _BankType.PaymentRequestType as farp_payrq_type ) as PaymentRequestType,
      _BankType.CustomerBankType,
      _BankType.SupplierBankType,

      _PaymentRequest._PaytReqChangeAndPost.LastChangedByUser,
      _PaymentRequest._PaytReqChangeAndPost.LastChangeTime,
      _PaymentRequest._PaytReqChangeAndPost.LastChangeDate,
      _PaymentRequest._PaytReqChangeAndPost.CreationTime,

      cast (
      case tims_is_valid(_PaymentRequest._PaytReqChangeAndPost.CreationTime)
          when 1 then dats_tims_to_tstmp( _PaymentRequest.AccountingDocumentCreationDate, _PaymentRequest._PaytReqChangeAndPost.CreationTime,
                                     abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' )
          else dats_tims_to_tstmp( _PaymentRequest.AccountingDocumentCreationDate, _PaymentRequest.CreationTime,
                                     abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' )
       end as farp_prq_cr_date )        as CreationDateTime,

      cast( dats_tims_to_tstmp( _PaymentRequest._PaytReqChangeAndPost.LastChangeDate, _PaymentRequest._PaytReqChangeAndPost.LastChangeTime,
                                 abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' )
             as farp_prq_chg_date )     as LastChangeDateTime,

      @VDM.lifecycle.status:#DEPRECATED
      @VDM.lifecycle.successor: 'PaymentRequestTemplate'
      cast(' ' as fibl_opvar)               as PaymentRequestVariant,
      cast(' ' as payment_request_template) as PaymentRequestTemplate,

      _PaymentRequest.PaymentRepetitiveCode,
      _PaymentRequest.PayeePaymentSystem,
      _PaymentRequest.PayeeAliasType,
      _PaymentRequest.PayeeAliasName,
      _PaymentRequest.TradingPartner,

      @ObjectModel.readOnly
      _PaymentRequest.FiscalYear,
      _PaymentRequest.BankCountry,
      @ObjectModel.readOnly
      _PaymentRequest.BankInternalID,
      @ObjectModel.readOnly
      _PaymentRequest.GLAccount,
      @ObjectModel.readOnly
      _PaymentRequest.StatusCode,
      @ObjectModel.readOnly
      _PayingCompanyCode.FiscalYearVariant,
      
      @ObjectModel.readOnly
      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      _PaymentRequest.AmountInAdditionalCurrency1,
      @ObjectModel.readOnly
      @Semantics.currencyCode: true
      _PaymentRequest.AdditionalCurrency1,
      
      @ObjectModel.readOnly
      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      _PaymentRequest.AmountInAdditionalCurrency2,
      @ObjectModel.readOnly
      @Semantics.currencyCode: true
      _PaymentRequest.AdditionalCurrency2,
      @ObjectModel.foreignKey.association: '_PaymentReason'
      _PaymentRequest.PaymentReason,
      
      @Semantics.booleanIndicator: true
      cast('' as abap_boolean)           as BankAliasEntryIsSelected,
      
      _PaymentRequest._PaytReqAdditionalInfo[1:PaymentRequestNotificationType = 'Q'].PaymentRequestReferenceText,

      _PaymentRequest._PayeeBank,
      _PaymentRequest._Bank,
      _PaymentRequest._HouseBankAccount,
      _PaymentRequest._BusinessAreaText,
      _PaymentRequest._CompanyCode,
      _PaymentRequest._PayingCompanyCode,
      _PaymentRequest._PartnerCompany,
      _PaymentRequest._PaymentRequestCurrency,
      _PaymentRequest._CompanyCodeCurrency,
      _PaymentRequest._AdditionalCurrency1,
      _PaymentRequest._AdditionalCurrency2,
      _PaymentRequest._DataExchangeInstructionKeys,
      _PaymentRequest._PaymentMethod,
      _PaymentRequest._PaytReqChangeAndPost,
      _PaymentRequest._SystemStatusText,
      _PaymentRequest._ReversalReason,
      _PaymentRequest._CalendarDateForCompanyCode,
      _PaymentRequest._PaymentReason,      
      _Customer,
      _Supplier,
      _PayeePaymentSystem,
      _PayeeAliasType     
}