P_COLLSPROMISETOPAYDRAFT

CDS View

P_COLLSPROMISETOPAYDRAFT is a CDS View in S/4HANA. It contains 49 fields. 3 CDS views read from this table.

CDS Views using this table (3)

ViewTypeJoinVDMDescription
R_CollsHeadOfficePromiseToPay view inner COMPOSITE Head Ofice Promise to Pay
R_CollsPrmsToPayCollsSegmentTP view inner TRANSACTIONAL Promise To Pay in Collections Segment
R_CollsPromiseToPayDraftTP view from TRANSACTIONAL Promise to Pay with Draft

Fields (49)

KeyField CDS FieldsUsed in Views
KEY Customer Customer 1
KEY PromiseToPayUUID PromiseToPayUUID 1
_CaseAttribute _CaseAttribute 1
_ChangedByContactCard _ChangedByContactCard 1
_ClosedByContactCard _ClosedByContactCard 1
_CollsPromiseToPayStatus _CollsPromiseToPayStatus 1
_CompanyCode _CompanyCode 1
_Country _Country 1
_CreatedByContactCard _CreatedByContactCard 1
_Currency _Currency 1
_Customer _Customer 1
_DraftAdministrativeData _DraftAdministrativeData 1
CaseClosedBy CaseClosedBy 1
CaseClosedTime CaseClosedTime 1
CaseCreatedBy CaseCreatedBy 1
CaseCreatedOn CaseCreatedOn 1
CaseExternalReference CaseExternalReference 1
CaseID CaseID 1
CaseLastChangedBy CaseLastChangedBy 1
CaseLastChangedOn CaseLastChangedOn 1
CaseType CaseType 1
CompanyCode CompanyCode 1
ContactPersonEmailAddress ContactPersonEmailAddress 1
ContactPersonFaxCountry ContactPersonFaxCountry 1
ContactPersonFaxNumber ContactPersonFaxNumber 1
ContactPersonPhoneNumber ContactPersonPhoneNumber 1
Currency Currency 1
DraftAdministrativeDataUUID DraftAdministrativeDataUUID 1
DraftCreationDateTime DraftCreationDateTime 1
DraftLastChangedDateTime DraftLastChangedDateTime 1
DraftUUID DraftUUID 1
DueDate DueDate 2
HasActiveEntity HasActiveEntity 1
IsActiveEntity IsActiveEntity 1
LastPaymentDate LastPaymentDate 1
LinkedInvoiceKey LinkedInvoiceKey 1
NextInstallmentAmount NextInstallmentAmount 1
NextInstallmentDueDate NextInstallmentDueDate 1
NumberOfInstallments NumberOfInstallments 1
ObjectType ObjectType 1
PaidAmount PaidAmount 2
PaidOffScheduleAmount PaidOffScheduleAmount 1
PaidOnScheduleAmount PaidOnScheduleAmount 1
Prms2PToInvoiceGroupRefUUID Prms2PToInvoiceGroupRefUUID 1
PromisedAmount PromisedAmount 1
PromiseToPayDate PromiseToPayDate 1
PromiseToPayGivenByPersonName PromiseToPayGivenByPersonName 1
PromiseToPayLevel PromiseToPayLevel 1
PromiseToPayStatus PromiseToPayStatus 1
@AbapCatalog: { sqlViewName: 'PCOLLSP2PDR',
                compiler: { compareFilter: true },
                preserveKey: true }
@AccessControl: { authorizationCheck: #NOT_REQUIRED,
                  personalData:       { blocking: #BLOCKED_DATA_EXCLUDED },
                  privilegedAssociations: [ '_DraftAdministrativeData' ] }
@VDM: { viewType: #COMPOSITE,
        private: true }
@ClientHandling: { algorithm: #SESSION_VARIABLE }
@ObjectModel: { usageType: { serviceQuality: #A,
                             sizeCategory: #L,
                             dataClass: #TRANSACTIONAL },
                representativeKey: 'PromiseToPayUUID' }

define view P_CollsPromiseToPayDraft
  as select from I_CollsPromiseToPay

  // VDM Associations

  // Case Attributes

  association [0..1] to I_CaseAttribute           as _CaseAttribute           on  $projection.PromiseToPayUUID = _CaseAttribute.CaseUniqueID

  // CompanyCode

  association [0..1] to I_CompanyCode             as _CompanyCode             on  $projection.CompanyCode = _CompanyCode.CompanyCode

  // Customer

  association [0..1] to I_Customer                as _Customer                on  $projection.Customer = _Customer.Customer

  // Country

  association [0..1] to I_Country                 as _Country                 on  $projection.ContactPersonFaxCountry = _Country.Country

  // Promise to Pay Status

  association [0..1] to I_CollsPromiseToPayStatus as _CollsPromiseToPayStatus on  $projection.PromiseToPayStatus = _CollsPromiseToPayStatus.PromiseToPayStatus

  // Created by Contact Card

  association [0..1] to I_UserContactCard         as _CreatedByContactCard    on  $projection.CaseCreatedBy = _CreatedByContactCard.ContactCardID

  // Changed by Contact Card

  association [0..1] to I_UserContactCard         as _ChangedByContactCard    on  $projection.CaseLastChangedBy = _ChangedByContactCard.ContactCardID

  // Closed by Contact Card

  association [0..1] to I_UserContactCard         as _ClosedByContactCard     on  $projection.CaseClosedBy = _ClosedByContactCard.ContactCardID

  // Currency

  association [0..1] to I_Currency                as _Currency                on  $projection.Currency = _Currency.Currency

  // Draft

  association [0..1] to I_CollsPromiseToPayDraft  as _PromiseToPayDraft       on  $projection.PromiseToPayUUID = _PromiseToPayDraft.PromiseToPayUUID

  // Draft Admin Table

  association [0..1] to I_DraftAdministrativeData as _DraftAdministrativeData on  $projection.draftadministrativedatauuid  = _DraftAdministrativeData.DraftUUID
                                                                              and _DraftAdministrativeData.DraftEntityType = 'R_COLLSPROMISETOPAYTP'

{


      // VDM Fields

  key PromiseToPayUUID,
      _PromiseToPayDraft.DraftUUID    as DraftUUID,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then CompanyCode
        else _PromiseToPayDraft.CompanyCode
      end                             as CompanyCode,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then Customer
        else _PromiseToPayDraft.Customer
      end                             as Customer,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then ObjectType
        else _PromiseToPayDraft.ObjectType
      end                             as ObjectType,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then LinkedInvoiceKey
        else _PromiseToPayDraft.LinkedInvoiceKey
      end                             as LinkedInvoiceKey,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then PromisedAmount
        else _PromiseToPayDraft.PromisedAmount
      end                             as PromisedAmount,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then PaidAmount
        else _PromiseToPayDraft.PaidAmount
      end                             as PaidAmount,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then Currency
        else _PromiseToPayDraft.Currency
      end                             as Currency,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then DueDate
        else _PromiseToPayDraft.DueDate
      end                             as DueDate,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then PromiseToPayDate
        else _PromiseToPayDraft.PromiseToPayDate
      end                             as PromiseToPayDate,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then LastPaymentDate
        else _PromiseToPayDraft.LastPaymentDate
      end                             as LastPaymentDate,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then PromiseToPayStatus
        else _PromiseToPayDraft.PromiseToPayStatus
      end                             as PromiseToPayStatus,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then PromiseToPayLevel
        else _PromiseToPayDraft.PromiseToPayLevel
      end                             as PromiseToPayLevel,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then PromiseToPayGivenByPersonName
        else _PromiseToPayDraft.PromiseToPayGivenByPersonName
      end                             as PromiseToPayGivenByPersonName,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then ContactPersonEmailAddress
        else _PromiseToPayDraft.ContactPersonEmailAddress
      end                             as ContactPersonEmailAddress,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then ContactPersonPhoneNumber
        else _PromiseToPayDraft.ContactPersonPhoneNumber
      end                             as ContactPersonPhoneNumber,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then ContactPersonFaxNumber
        else _PromiseToPayDraft.ContactPersonFaxNumber
      end                             as ContactPersonFaxNumber,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then ContactPersonFaxCountry
        else _PromiseToPayDraft.ContactPersonFaxCountry
      end                             as ContactPersonFaxCountry,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then ContactPerson
        else _PromiseToPayDraft.ContactPerson
      end                             as ContactPerson,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then NumberOfInstallments
        else _PromiseToPayDraft.NumberOfInstallments
      end                             as NumberOfInstallments,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then PaidOnScheduleAmount
        else _PromiseToPayDraft.PaidOnScheduleAmount
      end                             as PaidOnScheduleAmount,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then PaidOffScheduleAmount
        else _PromiseToPayDraft.PaidOffScheduleAmount
      end                             as PaidOffScheduleAmount,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then NextInstallmentDueDate
        else _PromiseToPayDraft.NextInstallmentDueDate
      end                             as NextInstallmentDueDate,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then NextInstallmentAmount
        else _PromiseToPayDraft.NextInstallmentAmount
      end                             as NextInstallmentAmount,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then Prms2PToInvoiceGroupRefUUID
        else _PromiseToPayDraft.Prms2PToInvoiceGroupRefUUID
      end                             as Prms2PToInvoiceGroupRefUUID,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then CaseID
        else _PromiseToPayDraft.CaseID
      end                             as CaseID,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then CaseExternalReference
        else _PromiseToPayDraft.CaseExternalReference
      end                             as CaseExternalReference,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then CaseCreatedBy
        else _PromiseToPayDraft.CaseCreatedBy
      end                             as CaseCreatedBy,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then CaseCreatedOn
        else _PromiseToPayDraft.CaseCreatedOn
      end                             as CaseCreatedOn,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then CaseLastChangedBy
        else _PromiseToPayDraft.CaseLastChangedBy
      end                             as CaseLastChangedBy,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then CaseLastChangedOn
        else _PromiseToPayDraft.CaseLastChangedOn
      end                             as CaseLastChangedOn,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then CaseClosedBy
        else _PromiseToPayDraft.CaseClosedBy
      end                             as CaseClosedBy,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then CaseClosedTime
        else _PromiseToPayDraft.CaseClosedTime
      end                             as CaseClosedTime,

      cast( case
        when _PromiseToPayDraft.DraftUUID is null
            then 'X'
        else ''
      end as boolean )                as IsActiveEntity,

      cast ( 'X' as boolean )         as HasActiveEntity,

      cast( case
        when _PromiseToPayDraft.DraftUUID is null
            then 0
        else _PromiseToPayDraft.DraftCreationDateTime
      end as sdraft_created_at )      as DraftCreationDateTime,

      cast( case
      when _PromiseToPayDraft.DraftUUID is null
          then 0
      else _PromiseToPayDraft.DraftLastChangedDateTime
      end as sdraft_last_changed_at ) as DraftLastChangedDateTime,

      _PromiseToPayDraft.DraftAdministrativeDataUUID,

      _CaseAttribute.CaseType,

      case
        when _PromiseToPayDraft.DraftUUID is null
            then IsCleared
        else _PromiseToPayDraft.IsCleared
      end                             as IsCleared,

      // Exposed Associations

      _CaseAttribute,
      _ChangedByContactCard,
      _ClosedByContactCard,
      _CollsPromiseToPayStatus,
      _CompanyCode,
      _Country,
      _CreatedByContactCard,
      _Currency,
      _Customer,
      _DraftAdministrativeData

}

union all select from I_CollsPromiseToPayDraft

// Draft Admin Table

association [0..1] to I_DraftAdministrativeData as _DraftAdministrativeData on  $projection.DraftAdministrativeDataUUID  = _DraftAdministrativeData.DraftUUID
                                                                            and _DraftAdministrativeData.DraftEntityType = 'R_COLLSPROMISETOPAYTP'

{

      // VDM Fields

  key PromiseToPayUUID,
      DraftUUID,
      CompanyCode,
      Customer,
      ObjectType,
      LinkedInvoiceKey,
      PromisedAmount,
      PaidAmount,
      Currency,
      DueDate,
      PromiseToPayDate,
      LastPaymentDate,
      PromiseToPayStatus,
      PromiseToPayLevel,
      PromiseToPayGivenByPersonName,
      ContactPersonEmailAddress,
      ContactPersonPhoneNumber,
      ContactPersonFaxNumber,
      ContactPersonFaxCountry,
      ContactPerson,
      NumberOfInstallments,
      PaidOnScheduleAmount,
      PaidOffScheduleAmount,
      NextInstallmentDueDate,
      NextInstallmentAmount,
      Prms2PToInvoiceGroupRefUUID,
      CaseID,
      CaseExternalReference,
      CaseCreatedBy,
      CaseCreatedOn,
      CaseLastChangedBy,
      CaseLastChangedOn,
      CaseClosedBy,
      CaseClosedTime,
      '' as IsActiveEntity,
      HasActiveEntity,
      DraftCreationDateTime,
      DraftLastChangedDateTime,
      DraftAdministrativeDataUUID,
      CaseType,
      IsCleared,

      // Exposed Associations

      _CaseAttribute,
      _ChangedByContactCard,
      _ClosedByContactCard,
      _CollsPromiseToPayStatus,
      _CompanyCode,
      _Country,
      _CreatedByContactCard,
      _Currency,
      _Customer,
      _DraftAdministrativeData

}
where
      HasActiveEntity                             <> 'X'
  and _DraftAdministrativeData.DraftIsCreatedByMe =  'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CASEATTRIBUTE",
"I_COLLSPROMISETOPAY",
"I_COLLSPROMISETOPAYDRAFT",
"I_DRAFTADMINISTRATIVEDATA"
],
"ASSOCIATED":
[
"I_CASEATTRIBUTE",
"I_COLLSPROMISETOPAYDRAFT",
"I_COLLSPROMISETOPAYSTATUS",
"I_COMPANYCODE",
"I_COUNTRY",
"I_CURRENCY",
"I_CUSTOMER",
"I_DRAFTADMINISTRATIVEDATA",
"I_USERCONTACTCARD"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/