I_CollectionContact

DDL: I_COLLECTIONCONTACT Type: view COMPOSITE Package: ODATA_CONTACT_PERSON

Collection Contact

I_CollectionContact is a Composite CDS View that provides data about "Collection Contact" in SAP S/4HANA. It reads from 2 data sources (I_BPCollectionsSegmentAssgmt, I_BPRelationship) and exposes 21 fields with key fields RelationshipNumber, BusinessPartnerCompany, BusinessPartnerPerson, CollectionSegment. It has 4 associations to related views. Part of development package ODATA_CONTACT_PERSON.

Data Sources (2)

SourceAliasJoin Type
I_BPCollectionsSegmentAssgmt I_BPCollectionsSegmentAssgmt from
I_BPRelationship I_BPRelationship inner

Associations (4)

CardinalityTargetAliasCondition
[0..1] I_BPContactToFuncAndDept _BPContactToFuncAndDept I_BPRelationship.BusinessPartnerCompany = _BPContactToFuncAndDept.BusinessPartnerCompany and I_BPRelationship.BusinessPartnerPerson = _BPContactToFuncAndDept.BusinessPartnerPerson and _BPContactToFuncAndDept.ValidityEndDate >= $session.system_date
[0..1] I_BpContactToAddress _BpContactToAddress I_BPRelationship.BusinessPartnerCompany = _BpContactToAddress.BusinessPartnerCompany and I_BPRelationship.BusinessPartnerPerson = _BpContactToAddress.BusinessPartnerPerson and _BpContactToAddress.ValidityEndDate >= $session.system_date
[0..1] I_CollectionSegment _CollectionSegment $projection.CollectionSegment = _CollectionSegment.CollectionSegment
[0..1] I_CustomerContact _CustomerContact $projection.BusinessPartnerCompany = _CustomerContact.BusinessPartnerCompany and $projection.BusinessPartnerPerson = _CustomerContact.BusinessPartnerPerson

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName ICOLLCONT view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
EndUserText.label Collection Contact view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.representativeKey BusinessPartnerPerson view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY RelationshipNumber I_BPRelationship RelationshipNumber
KEY BusinessPartnerCompany BusinessPartnerCompany
KEY BusinessPartnerPerson BusinessPartnerPerson
KEY CollectionSegment
FirstName _BusinessPartnerPerson FirstName
LastName _BusinessPartnerPerson LastName
PhoneNumber
MobileNumber
FaxNumber _BPContactToFuncAndDept FaxNumber
EmailAddress _BPContactToFuncAndDept EmailAddress
ContactPersonFunction _BPContactToFuncAndDept ContactPersonFunction
ContactPersonDepartment _BPContactToFuncAndDept ContactPersonDepartment
ContactPerson _CustomerContact CustomerContact
_BPContactToFuncAndDept _BPContactToFuncAndDept
_BpContactToAddress _BpContactToAddress
_BusinessPartnerCompany _BusinessPartnerCompany
_BusinessPartnerPerson _BusinessPartnerPerson
_CollectionSegment _CollectionSegment
_ContactPersonFunction _BPContactToFuncAndDept _ContactPersonFunction
_ContactPersonDepartment _BPContactToFuncAndDept _ContactPersonDepartment
_CustomerContact _CustomerContact
@AbapCatalog: { sqlViewName: 'ICOLLCONT',
                compiler: { compareFilter: true },
                preserveKey: true }
@AccessControl: { authorizationCheck: #CHECK,
                  personalData: { blocking: #BLOCKED_DATA_EXCLUDED } }
@EndUserText: { label: 'Collection Contact' }
@VDM: { viewType: #COMPOSITE,
        lifecycle: { contract: { type: #PUBLIC_LOCAL_API } } }
@ClientHandling: { algorithm: #SESSION_VARIABLE }
@ObjectModel: { usageType: { serviceQuality: #C,
                             sizeCategory: #L,
                             dataClass: #TRANSACTIONAL },
                semanticKey: ['RelationshipNumber', 'BusinessPartnerCompany', 'BusinessPartnerPerson', 'CollectionSegment' ],
                representativeKey: 'BusinessPartnerPerson' }
@Consumption: { dbHints: [ 'USE_HEX_PLAN' ] }

define view I_CollectionContact
  as select from I_BPCollectionsSegmentAssgmt
    inner join   I_BPRelationship on I_BPCollectionsSegmentAssgmt.BusinessPartner = I_BPRelationship.BusinessPartnerCompany

  // VDM Associations

  // Contacts including Function and Department

  association [0..1] to I_BPContactToFuncAndDept  as _BPContactToFuncAndDept  on  I_BPRelationship.BusinessPartnerCompany = _BPContactToFuncAndDept.BusinessPartnerCompany
                                                                              and I_BPRelationship.BusinessPartnerPerson  = _BPContactToFuncAndDept.BusinessPartnerPerson
                                                                              and _BPContactToFuncAndDept.ValidityEndDate >= $session.system_date

  // Contact Address

  association [0..1] to I_BpContactToAddress      as _BpContactToAddress      on  I_BPRelationship.BusinessPartnerCompany = _BpContactToAddress.BusinessPartnerCompany
                                                                              and I_BPRelationship.BusinessPartnerPerson  = _BpContactToAddress.BusinessPartnerPerson
                                                                              and _BpContactToAddress.ValidityEndDate     >= $session.system_date

  // Collection Segment

  association [0..1] to I_CollectionSegment       as _CollectionSegment       on  $projection.CollectionSegment = _CollectionSegment.CollectionSegment

  // Contact Person Key

  association [0..1] to I_CustomerContact         as _CustomerContact         on  $projection.BusinessPartnerCompany = _CustomerContact.BusinessPartnerCompany
                                                                              and $projection.BusinessPartnerPerson  = _CustomerContact.BusinessPartnerPerson

{

       // VDM Fields

  key  I_BPRelationship.RelationshipNumber                                                  as RelationshipNumber,

       @ObjectModel: { foreignKey: { association: '_BusinessPartnerCompany' } }
  key  BusinessPartnerCompany,

       @ObjectModel: { foreignKey: { association: '_BusinessPartnerPerson' } }
  key  BusinessPartnerPerson,

       @ObjectModel: { foreignKey: { association: '_CollectionSegment' } }
  key  cast( CollectionSegment as farp_collection_segment preserving type )                 as CollectionSegment,

       _BusinessPartnerPerson.FirstName                                                     as FirstName,
       _BusinessPartnerPerson.LastName                                                      as LastName,

       @Semantics: { telephone: { type: [ #PREF ] } }
       _BpContactToAddress._Telephone.PhoneNumber                                           as PhoneNumber,

       @Semantics: { telephone: { type: [ #CELL] } }
       cast( _BpContactToAddress._MobilePhone.PhoneNumber as contactcardmobilephonenumber ) as MobileNumber,

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

       @Semantics: { eMail: { address: true } }
       _BPContactToFuncAndDept.EmailAddress                                                 as EmailAddress,

       _BPContactToFuncAndDept.ContactPersonFunction                                        as ContactPersonFunction,
       _BPContactToFuncAndDept.ContactPersonDepartment                                      as ContactPersonDepartment,
       _CustomerContact.CustomerContact                                                     as ContactPerson,

       // Exposed Associations

       _BPContactToFuncAndDept,
       _BpContactToAddress,
       _BusinessPartnerCompany,
       _BusinessPartnerPerson,
       _CollectionSegment,
       _BPContactToFuncAndDept._ContactPersonFunction                                       as _ContactPersonFunction,
       _BPContactToFuncAndDept._ContactPersonDepartment                                     as _ContactPersonDepartment,
       _CustomerContact

}

where
      RelationshipCategory                                       = 'UDM001' // Has Collections Contact

  and I_BPRelationship.ValidityStartDate                         <= $session.system_date
  and I_BPRelationship.ValidityEndDate                           >= $session.system_date
  and I_BPCollectionsSegmentAssgmt.BPCollSgmtAssignmentValidFrom <= $session.system_date
  and I_BPCollectionsSegmentAssgmt.BPCollSgmtAssignmentValidTo   >= $session.system_date