R_CAPAYMENTORDERTP

CDS View

Payment Order - TP

R_CAPAYMENTORDERTP is a CDS View in S/4HANA. Payment Order - TP. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
C_CAPaymentOrderTP view_entity projection CONSUMPTION Manage Payment Orders
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #REQUIRED
@AccessControl.privilegedAssociations: [ '_CreatedByContact', '_ChangedByContact' ]

@EndUserText.label: 'Payment Order - TP'

@ObjectModel: { modelingPattern:#NONE,
                representativeKey: 'CAPaymentOrder',
                semanticKey: [ 'CAPaymentOrder' ],
                sapObjectNodeType.name: 'ContrAcctgPaymentOrder',
                supportedCapabilities: [ #CDS_MODELING_ASSOCIATION_TARGET,
                                         #SQL_DATA_SOURCE,
                                         #CDS_MODELING_DATA_SOURCE ],
                usageType:{ dataClass: #MIXED,
                            serviceQuality:#C,
                            sizeCategory:#XL}}

@VDM.viewType: #TRANSACTIONAL
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@VDM.usage.type: [#TRANSACTIONAL_PROCESSING_SERVICE]

define root view entity R_CAPaymentOrderTP 
  as select from I_CAPaymentOrderEnhanced as _CAPaymentOrder

  composition [0..*] of R_CAPaymentOrderItem  as _CAPaymentOrderItem 
  
  association [0..1] to I_CAPaymentOrderStatusEnhanced as _CAPaymentOrderStatusEnhanced on  $projection.CAPaymentOrderStatusEnhanced = _CAPaymentOrderStatusEnhanced.CAPaymentOrderStatus
  association [0..1] to I_CADocument                   as _CAClearingDocument           on  $projection.CAPaytOrdPaytCardClrgDocument = _CAClearingDocument.CADocumentNumber
  association [0..1] to I_BusinessPartner              as _BusinessPartner2             on  $projection.BusinessPartner2 = _BusinessPartner2.BusinessPartner
  
{
  key CAPaymentOrder,
      PaidItemDueDate,
      CAPaymentOrderExpirationDate,
      CAPaymentOrderStatus,
      CAPaymentOrderStatusEnhanced,
      CAPaymentDocument,
      CAPaymentOrderExternalRef,
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      CANetAmountInTransCurrency,
      TransactionCurrency,
      ValueDate,
      cast(HouseBank as farp_hbkid preserving type ) as HouseBank,
      cast(HouseBankAccount as fac_hktid preserving type ) as HouseBankAccount,
      CAPaymentMethod,
      cast(CAMassRunDate as laufd_pay_gfn_kk preserving type) as CAMassRunDate,
      cast(CAMassRunID as laufi_pay_gfn_kk ) as CAMassRunID,
      cast(concat( cast(CAMassRunDate as date), CAMassRunID) as abap.char(20) ) as CAPaymentRunDateAndID,
      CompanyCode,
//      BusinessArea,

      CountryCode,
      
      _BusinessPartner2.BusinessPartner as BusinessPartner,
      _BusinessPartner2.IsBusinessPurposeCompleted as IsBusinessPurposeCompleted,
      _BusinessPartner2.BusinessPartnerName as BusinessPartnerName,
      _BusinessPartner2.BusinessPartnerFullName as BusinessPartnerFullName,
      BusinessPartner as BusinessPartner2,
      
      CreatedByUser,
      CreationDate,   
      CreationTime,
      @Semantics.systemDate.createdAt: true
      cast( dats_tims_to_tstmp( CreationDate,
                          CreationTime,
                          abap_system_timezone( $session.client, 'NULL' ),
                          $session.client,
                          'NULL' ) as vdm_lastchangedon ) 
       as CreationDateTime,
      @Semantics.user.lastChangedBy: true
      ChangedByUserName,
      LastChangeDate,
      LastChangeTime,
      @Semantics.systemDate.lastChangedAt: false
      case when ( LastChangeDate is initial or LastChangeDate is null )
       then cast( dats_tims_to_tstmp( CreationDate,
                          CreationTime,
                          abap_system_timezone( $session.client, 'NULL' ),
                          $session.client,
                          'NULL' ) as vdm_lastchangedon )
      else cast ( dats_tims_to_tstmp( LastChangeDate,
                          LastChangeTime,
                          abap_system_timezone( $session.client, 'NULL' ),
                          $session.client,
                          'NULL' ) as vdm_lastchangedon )
       end as LastChangeDateTime,

      PaymentCardType,
      _PaymentCardType._Text[Language = $session.system_language ].CardTypeText,
      PaytCardByDigitalPaymentSrvc,
      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_FKK_PAYMENTORDER_CC_EXIT'
      cast( '' as ccnum ) as MaskedCardNumber,   
      CAAuthznByDigitalPaytSrvc,
      CAAuthorizationByAcquirer,
      CAPaytOrdPaytCardClrgDocument,  
      cast(_CAClearingDocument.CAReversalDocumentNumber as storb_gfn_kk preserving type ) as CAPaytOrdPaytCardRvslDocument, 
      
      case 
        when CAPaymentOrderExpirationDate is not initial
         and CAPaymentOrderExpirationDate < $session.system_date 
         and CAPaymentOrderStatus is initial
            then cast ('X' as xfeld )
        when CAPaymentOrderExpirationDate is initial
          or CAPaymentOrderExpirationDate >= $session.system_date 
          or CAPaymentOrderStatus is not initial
            then cast ('' as xfeld )
      end as CAPaymentOrderIsExpired,      
      
      case
        when CAPaymentOrderStatus is initial    //open

          then cast ('X' as boolean )
        when CAPaymentOrderStatus = '1'         //executed

          then cast (' ' as boolean )
        when CAPaymentOrderStatus = '2'         //canceled

          then cast ('X' as boolean )
        when CAPaymentOrderStatus = '3'         //expired

          then cast (' ' as boolean )
        when CAPaymentOrderStatus = '4'         //reversed after expiration date

          then cast (' ' as boolean )
        when CAPaymentOrderStatus = '5'         //reset due to incorrect execution

          then cast (' ' as boolean )
        when CAPaymentOrderStatus = '6'         //included in returns a lot

          then cast (' ' as boolean )
      end as CAPaymentOrderIsChangeable,
      
      case
        when CAPaymentOrderStatus is initial    //open

          then cast (' ' as boolean )
        when CAPaymentOrderStatus = '1'         //executed

          then cast ('X' as boolean )
        when CAPaymentOrderStatus = '2'         //canceled

          then cast (' ' as boolean )
        when CAPaymentOrderStatus = '3'         //expired

          then cast ('X' as boolean )
        when CAPaymentOrderStatus = '4'         //reversed after expiration date

          then cast ('X' as boolean )
        when CAPaymentOrderStatus = '5'         //reset due to incorrect execution

          then cast ('X' as boolean )
        when CAPaymentOrderStatus = '6'         //included in returns a lot

          then cast ('X' as boolean )
      end as CAPaymentOrderIsNotChangeable,

      case
        when CAPaymentOrderStatus is initial    //open

          then cast ('X' as boolean )
        when CAPaymentOrderStatus is not initial 
          then cast (' ' as boolean )
      end as CAPaymentOrderIsReversible,
      
      case
        when CAPaymentOrderStatus is initial    //open

          then cast (' ' as boolean )
        when CAPaymentOrderStatus is not initial 
          then cast ('X' as boolean )
      end as CAPaymentOrderIsNotReversible,

      case
        when CAPaytOrdPaytCardClrgDocument is not initial 
          then cast (' ' as boolean )
        when CAPaytOrdPaytCardClrgDocument is initial 
          then cast ( 'X' as boolean )
      end as CAPaytOrdHasNotPaymentCardData,  
      
      case
        when _CAClearingDocument.CAReversalDocumentNumber is not initial 
          then cast (' ' as boolean )
        when _CAClearingDocument.CAReversalDocumentNumber is initial 
          then cast ( 'X' as boolean )
        end as CAClrgDocumentIsNotReversed,      
        
      /* Contact Card */
      _CreatedByContact,
      _ChangedByContact,
      
      /* Associations */
      _BusinessPartner2,
      _CAPaymentOrderStatus,
      _CAPaymentOrderStatusEnhanced,
      _CAPaymentDocument,
      _CompanyCode,
      _CAPaymentMethod,
      _HouseBank,
      _HouseBankAccount,
      _CAClearingDocument,
      _CAPaymentOrderItem,
      //_BusinessArea,

      _PaymentCardType
}