P_CollectionsContactDraft

DDL: P_COLLECTIONSCONTACTDRAFT Type: view TRANSACTIONAL Package: ODATA_CONTACT_PERSON

Collections Contacts Drafts

P_CollectionsContactDraft is a Transactional CDS View that provides data about "Collections Contacts Drafts" in SAP S/4HANA. It reads from 2 data sources (I_CollectionContact, I_CollectionsContactDraft) and exposes 42 fields with key fields RelationshipNumber, BusinessPartnerCompany, BusinessPartnerPerson, CollectionSegment, DraftUUID. It has 5 associations to related views. Part of development package ODATA_CONTACT_PERSON.

Data Sources (2)

SourceAliasJoin Type
I_CollectionContact I_CollectionContact from
I_CollectionsContactDraft I_CollectionsContactDraft union_all

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_CollectionsContactDraft _CollectionsContactDraft $projection.RelationshipNumber = _CollectionsContactDraft.RelationshipNumber and $projection.BusinessPartnerCompany = _CollectionsContactDraft.BusinessPartnerCompany and $projection.BusinessPartnerPerson = _CollectionsContactDraft.BusinessPartnerPerson and $projection.CollectionSegment = _CollectionsContactDraft.CollectionSegment
[0..1] I_ContactPersonFunction _ContactPersonFunction $projection.ContactPersonFunction = _ContactPersonFunction.ContactPersonFunction
[0..1] I_ContactPersondepartment _ContactPersondepartment $projection.ContactPersonDepartment = _ContactPersondepartment.ContactPersonDepartment
[1..1] I_BusinessPartner _BusinessPartnerCompany $projection.BusinessPartnerCompany = _BusinessPartnerCompany.BusinessPartner
[1..1] I_BusinessPartner _BusinessPartnerPerson $projection.BusinessPartnerPerson = _BusinessPartnerPerson.BusinessPartner

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PCOLLSCONTDR view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
VDM.viewType #TRANSACTIONAL view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.representativeKey BusinessPartnerPerson view

Fields (42)

KeyFieldSource TableSource FieldDescription
KEY RelationshipNumber RelationshipNumber
KEY BusinessPartnerCompany BusinessPartnerCompany
KEY BusinessPartnerPerson BusinessPartnerPerson
KEY CollectionSegment CollectionSegment
KEY DraftUUID _CollectionsContactDraft DraftUUID
FirstNameendasFirstName
LastNameendasLastName
PhoneNumberendasPhoneNumber
MobileNumberendasMobileNumber
FaxNumberendasFaxNumber
EmailAddressendasEmailAddress
HasActiveEntity
_BPContactToFuncAndDept _BPContactToFuncAndDept
_BpContactToAddress _BpContactToAddress
_BusinessPartnerCompany _BusinessPartnerCompany
_BusinessPartnerPerson _BusinessPartnerPerson
_CollectionSegment _CollectionSegment
_ContactPersonFunction _ContactPersonFunction
BusinessPartnerkeyRelationshipNumber
KEY BusinessPartnerCompany BusinessPartnerCompany
KEY BusinessPartnerPerson BusinessPartnerPerson
KEY CollectionSegment CollectionSegment
KEY DraftUUID DraftUUID
FirstName FirstName
LastName LastName
PhoneNumber PhoneNumber
MobileNumber MobileNumber
FaxNumber FaxNumber
EmailAddress EmailAddress
ContactPersonFunction ContactPersonFunction
ContactPersonDepartment ContactPersonDepartment
IsActiveEntity
HasActiveEntity HasActiveEntity
DraftCreationDateTime DraftCreationDateTime
DraftLastChangedDateTime DraftLastChangedDateTime
_BPContactToFuncAndDept _BPContactToFuncAndDept
_BpContactToAddress _BpContactToAddress
_BusinessPartnerCompany _BusinessPartnerCompany
_BusinessPartnerPerson _BusinessPartnerPerson
_CollectionSegment _CollectionSegment
_ContactPersonFunction _ContactPersonFunction
_ContactPersondepartment _ContactPersondepartment
@AbapCatalog: { sqlViewName: 'PCOLLSCONTDR',
                compiler: { compareFilter: true },
                preserveKey: true }
@AccessControl: { authorizationCheck: #NOT_REQUIRED,
                  personalData:       { blocking: #BLOCKED_DATA_EXCLUDED } }
@VDM: { viewType: #TRANSACTIONAL,
        private: true }
@ClientHandling: { algorithm: #SESSION_VARIABLE }
@ObjectModel: { usageType: { serviceQuality: #A,
                             sizeCategory: #L,
                             dataClass: #TRANSACTIONAL },
                representativeKey: 'BusinessPartnerPerson' }

define view P_CollectionsContactDraft
  as select from I_CollectionContact

  // VDM Associations

  association [0..1] to I_CollectionsContactDraft as _CollectionsContactDraft on  $projection.RelationshipNumber     = _CollectionsContactDraft.RelationshipNumber
                                                                              and $projection.BusinessPartnerCompany = _CollectionsContactDraft.BusinessPartnerCompany
                                                                              and $projection.BusinessPartnerPerson  = _CollectionsContactDraft.BusinessPartnerPerson
                                                                              and $projection.CollectionSegment      = _CollectionsContactDraft.CollectionSegment

  // Contact Person Function

  association [0..1] to I_ContactPersonFunction   as _ContactPersonFunction   on  $projection.ContactPersonFunction = _ContactPersonFunction.ContactPersonFunction

  // Contact Person Department

  association [0..1] to I_ContactPersondepartment as _ContactPersondepartment on  $projection.ContactPersonDepartment = _ContactPersondepartment.ContactPersonDepartment

  // Business Partner Company

  association [1..1] to I_BusinessPartner         as _BusinessPartnerCompany  on  $projection.BusinessPartnerCompany = _BusinessPartnerCompany.BusinessPartner

  // Business Partneer Person

  association [1..1] to I_BusinessPartner         as _BusinessPartnerPerson   on  $projection.BusinessPartnerPerson = _BusinessPartnerPerson.BusinessPartner

{

          // VDM Fields

  key     RelationshipNumber,
  key     BusinessPartnerCompany,
  key     BusinessPartnerPerson,
  key     CollectionSegment,
  key     _CollectionsContactDraft.DraftUUID as DraftUUID,

          case
            when _CollectionsContactDraft.DraftUUID is null
                then I_CollectionContact.FirstName
            else _CollectionsContactDraft.FirstName
          end                                as FirstName,

          case
            when _CollectionsContactDraft.DraftUUID is null
                then I_CollectionContact.LastName
            else _CollectionsContactDraft.LastName
          end                                as LastName,

          @Semantics: { telephone: { type: [ #PREF ] } }
          case
            when _CollectionsContactDraft.DraftUUID is null
                then I_CollectionContact.PhoneNumber
            else _CollectionsContactDraft.PhoneNumber
          end                                as PhoneNumber,

          @Semantics: { telephone: { type: [ #CELL] } }
          case
            when _CollectionsContactDraft.DraftUUID is null
                then I_CollectionContact.MobileNumber
            else _CollectionsContactDraft.MobileNumber
          end                                as MobileNumber,

          @Semantics: { telephone: { type: [ #FAX ] } }
          case
            when _CollectionsContactDraft.DraftUUID is null
                then I_CollectionContact.FaxNumber
            else _CollectionsContactDraft.FaxNumber
          end                                as FaxNumber,

          @Semantics: { eMail: { address: true } }
          case
            when _CollectionsContactDraft.DraftUUID is null
                then I_CollectionContact.EmailAddress
            else _CollectionsContactDraft.EmailAddress
          end                                as EmailAddress,

          case
            when _CollectionsContactDraft.DraftUUID is null
                then I_CollectionContact.ContactPersonFunction
            else _CollectionsContactDraft.ContactPersonFunction
          end                                as ContactPersonFunction,

          case
            when _CollectionsContactDraft.DraftUUID is null
                then I_CollectionContact.ContactPersonDepartment
            else _CollectionsContactDraft.ContactPersonDepartment
          end                                as ContactPersonDepartment,

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

          cast( 'X' as boolean )             as HasActiveEntity,

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

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

          // Exposed Associations

          _BPContactToFuncAndDept,
          _BpContactToAddress,
          _BusinessPartnerCompany,
          _BusinessPartnerPerson,
          _CollectionSegment,
          _ContactPersonFunction,
          _ContactPersondepartment

}

union all select from I_CollectionsContactDraft

// Business Partner Company

association [1..1] to I_BusinessPartner as _BusinessPartnerCompany on $projection.BusinessPartnerCompany = _BusinessPartnerCompany.BusinessPartner

// Business Partneer Person

association [1..1] to I_BusinessPartner as _BusinessPartnerPerson  on $projection.BusinessPartnerPerson = _BusinessPartnerPerson.BusinessPartner

{
      // VDM Fields

  key RelationshipNumber,
  key BusinessPartnerCompany,
  key BusinessPartnerPerson,
  key CollectionSegment,
  key DraftUUID,
      FirstName,
      LastName,

      @Semantics: { telephone: { type: [ #PREF ] } }
      PhoneNumber,

      @Semantics: { telephone: { type: [ #CELL] } }
      MobileNumber,

      @Semantics: { telephone: { type: [ #FAX ] } }
      FaxNumber,

      @Semantics: { eMail: { address: true } } 
      EmailAddress,

      ContactPersonFunction,
      ContactPersonDepartment,
      cast( '' as boolean ) as IsActiveEntity,

      HasActiveEntity,
      DraftCreationDateTime,
      DraftLastChangedDateTime,

      // Exposed Associations

      _BPContactToFuncAndDept,
      _BpContactToAddress,
      _BusinessPartnerCompany,
      _BusinessPartnerPerson,
      _CollectionSegment,
      _ContactPersonFunction,
      _ContactPersondepartment

}

where
      HasActiveEntity                             <> 'X'
  and _DraftAdministrativeData.DraftIsCreatedByMe =  'X'