P_BPContactToAddress

DDL: P_BPCONTACTTOADDRESS SQL: PBPCNTCTADDRESS Type: view Package: MDC_BUPA_REL_BO

BP Contact person address

P_BPContactToAddress is a CDS View that provides data about "BP Contact person address" in SAP S/4HANA. It reads from 6 data sources and exposes 57 fields with key fields RelationshipNumber, BusinessPartnerCompany, BusinessPartnerPerson, ValidityEndDate, AddressID. It has 8 associations to related views. Part of development package MDC_BUPA_REL_BO.

Data Sources (6)

SourceAliasJoin Type
but000 but000 inner
but000 but000 inner
but050 but050 inner
but050 but050 inner
but052 but052 from
but052 but052 union_all

Associations (8)

CardinalityTargetAliasCondition
[1..1] I_BusinessPartner _BusinessPartnerCompany $projection.BusinessPartnerCompany = _BusinessPartnerCompany.BusinessPartner
[1..1] I_BusinessPartner _BusinessPartnerPerson $projection.BusinessPartnerPerson = _BusinessPartnerPerson.BusinessPartner
[1..*] adcp _AddressDetails $projection.AddressID = _AddressDetails.addrnumber and $projection.PersonNumber = _AddressDetails.persnumber
[1..*] adrp _PersonDetails $projection.PersonNumber = _PersonDetails.persnumber
[1..*] I_BusinessPartnerAddress _BPCompanyPostalAddress $projection.AddressID = _BPCompanyPostalAddress.AddressNumber and ( $projection.BusinessPartnerPerson = _BPCompanyPostalAddress.BusinessPartner or $projection.BusinessPartnerCompany = _BPCompanyPostalAddress.BusinessPartner )
[0..*] I_AddressPhoneNumber_2 _Telephone $projection.AddressID = _Telephone.AddressID and $projection.PersonNumber = _Telephone.AddressPersonID and _Telephone.PhoneNumberType = '1'
[0..*] I_AddressPhoneNumber_2 _MobilePhone $projection.AddressID = _MobilePhone.AddressID and $projection.PersonNumber = _MobilePhone.AddressPersonID and _MobilePhone.PhoneNumberType = '3'
[0..*] I_AddressFaxNumber_2 _FaxNumber $projection.AddressID = _FaxNumber.AddressID and $projection.PersonNumber = _FaxNumber.AddressPersonID and _FaxNumber.FaxNumberIsCurrentDefault = 'X'

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PBPCNTCTADDRESS view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label BP Contact person address view
VDM.private true view

Fields (57)

KeyFieldSource TableSource FieldDescription
KEY RelationshipNumber but052 relnr
KEY BusinessPartnerCompany but052 partner1
KEY BusinessPartnerPerson but052 partner2
KEY ValidityEndDate but050 date_to
KEY AddressID but052 addrnumber
KEY BPRelshpCatIsInFwdDirection
PersonNumber but000 persnumber
IsDefaultAddress but052 xdfadr
RelationshipCategory
AddressRepresentationCode
ContactRelationshipFunction
ContactRelationshipDepartment
Floor
Building
RoomNumber
PrfrdCommMediumType
CorrespondenceShortName
InhouseMail
AuthorizationGroup _BusinessPartnerPerson AuthorizationGroup
IsBusinessPurposeCompleted _BusinessPartnerPerson IsBusinessPurposeCompleted
RelValidityEndDate but052 date_to
_AddressDetails _AddressDetails
_PersonDetails _PersonDetails
_BPCompanyPostalAddress _BPCompanyPostalAddress
_BusinessPartnerCompany _BusinessPartnerCompany
_BusinessPartnerPerson _BusinessPartnerPerson
_Telephone _Telephone
_MobilePhone _MobilePhone
relnrasRelationshipNumber
KEY BusinessPartnerCompany but052 partner2
KEY BusinessPartnerPerson but052 partner1
KEY ValidityEndDate but050 date_to
KEY AddressID but052 addrnumber
KEY BPRelshpCatIsInFwdDirection
PersonNumber but000 persnumber
IsDefaultAddress but052 xdfadr
RelationshipCategory
AddressRepresentationCode
ContactRelationshipFunction
ContactRelationshipDepartment
Floor
Building
RoomNumber
PrfrdCommMediumType
CorrespondenceShortName
InhouseMail
AuthorizationGroup _BusinessPartnerPerson AuthorizationGroup
IsBusinessPurposeCompleted _BusinessPartnerPerson IsBusinessPurposeCompleted
RelValidityEndDate but052 date_to
_AddressDetails _AddressDetails
_PersonDetails _PersonDetails
_BPCompanyPostalAddress _BPCompanyPostalAddress
_BusinessPartnerCompany _BusinessPartnerCompany
_BusinessPartnerPerson _BusinessPartnerPerson
_Telephone _Telephone
_MobilePhone _MobilePhone
_FaxNumber _FaxNumber
@AbapCatalog.sqlViewName: 'PBPCNTCTADDRESS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'BP Contact person address'
@VDM.private: true
//but050.reltyp as RelationshipCategory,

//inner join but050 on I_BpContactToAddress.BusinessPartnerCompany = but050.partner1

//                  and I_BpContactToAddress.BusinessPartnerPerson = but050.partner2

//                  and I_BpContactToAddress.ValidityEndDate       = but050.date_to

define view P_BPContactToAddress
  as select from but052
    inner join   but000 on but052.partner2 = but000.partner
    inner join   but050 on but050.partner1 = but052.partner1 and but050.partner2 = but052.partner2
    and but050.relnr = but052.relnr
  association [1..1] to I_BusinessPartner        as _BusinessPartnerCompany on  $projection.BusinessPartnerCompany = _BusinessPartnerCompany.BusinessPartner

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

  association [1..*] to adcp                     as _AddressDetails         on  $projection.AddressID    = _AddressDetails.addrnumber
                                                                            and $projection.PersonNumber = _AddressDetails.persnumber

  association [1..*] to adrp                     as _PersonDetails          on  $projection.PersonNumber = _PersonDetails.persnumber

  association [1..*]    to I_BusinessPartnerAddress as _BPCompanyPostalAddress on  $projection.AddressID              = _BPCompanyPostalAddress.AddressNumber
                                                                            and ( $projection.BusinessPartnerPerson = _BPCompanyPostalAddress.BusinessPartner
                                                                            or $projection.BusinessPartnerCompany = _BPCompanyPostalAddress.BusinessPartner )


  association [0..*] to I_AddressPhoneNumber_2     as _Telephone              on  $projection.AddressID      = _Telephone.AddressID
                                                                            and $projection.PersonNumber   = _Telephone.AddressPersonID
                                                                            and _Telephone.PhoneNumberType = '1'

  association [0..*] to I_AddressPhoneNumber_2     as _MobilePhone            on  $projection.AddressID        = _MobilePhone.AddressID
                                                                            and $projection.PersonNumber     = _MobilePhone.AddressPersonID
                                                                            and _MobilePhone.PhoneNumberType = '3'

  association [0..*] to I_AddressFaxNumber_2       as _FaxNumber              on  $projection.AddressID         = _FaxNumber.AddressID
                                                                            and $projection.PersonNumber      = _FaxNumber.AddressPersonID
                                                                            and _FaxNumber.FaxNumberIsCurrentDefault = 'X'
{
  key but052.relnr                                as RelationshipNumber,
      //--[ GENERATED:012:GlBfhyJl7kY4i6}7dD1KRG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_BusinessPartnerVH',
                     element: 'BusinessPartner' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association : '_BusinessPartnerCompany'
  key but052.partner1                             as BusinessPartnerCompany,
      //--[ GENERATED:012:GlBfhyJl7kY4i6}7dD1KRG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_BusinessPartnerVH',
                     element: 'BusinessPartner' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association : '_BusinessPartnerPerson'
  key but052.partner2                             as BusinessPartnerPerson,
  key but050.date_to                              as ValidityEndDate,
      @ObjectModel.foreignKey.association: '_AddressDetails'
  key but052.addrnumber                           as AddressID,
  key 'X'                                         as BPRelshpCatIsInFwdDirection,
      but000.persnumber                           as PersonNumber,
      but052.xdfadr                               as IsDefaultAddress,
      'BUR001'                                    as RelationshipCategory,
      _AddressDetails[1: nation = ' '].nation     as AddressRepresentationCode,
      _AddressDetails[1: nation = ' '].function   as ContactRelationshipFunction,
      _AddressDetails[1: nation = ' '].department as ContactRelationshipDepartment,
      _AddressDetails[1: nation = ' '].floor      as Floor,
      _AddressDetails[1: nation = ' '].building   as Building,
      _AddressDetails[1: nation = ' '].roomnumber as RoomNumber,
      _AddressDetails[1: nation = ' '].deflt_comm as PrfrdCommMediumType,
      _AddressDetails[1: nation = ' '].id_code    as CorrespondenceShortName,
      _AddressDetails[1: nation = ' '].ih_mail    as InhouseMail,
//      _Telephone.InternationalPhoneNumber,

//      _Telephone.DestinationLocationCountry       as PhoneNumberCountry,

//      _Telephone.PhoneNumber,

//      _MobilePhone.InternationalPhoneNumber       as InternationalMobilePhoneNumber,

//      _MobilePhone.DestinationLocationCountry     as MobilePhoneCountry,

//      _MobilePhone.PhoneNumber                    as MobilePhoneNumber,

//      _MobilePhone.PhoneNumberExtension           as MobilePhoneNumberExtension,

//      _FaxNumber.InternationalFaxNumber,

//      _FaxNumber.FaxCountry,

      _BusinessPartnerPerson.AuthorizationGroup,
      _BusinessPartnerPerson.IsBusinessPurposeCompleted,
       but052.date_to as RelValidityEndDate,
      _AddressDetails,
      _PersonDetails,
      _BPCompanyPostalAddress,
      _BusinessPartnerCompany,
      _BusinessPartnerPerson,
      _Telephone,
      _MobilePhone,
      _FaxNumber
}

union all select from but052
  inner join          but000                                              on but052.partner2 = but000.partner
  inner join   but050 on but050.partner1 = but052.partner1 and but050.partner2 = but052.partner2
  and but050.relnr = but052.relnr
association [1..1] to I_BusinessPartner    as _BusinessPartnerCompany on  $projection.BusinessPartnerCompany = _BusinessPartnerCompany.BusinessPartner

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

association [1..*] to adcp                 as _AddressDetails         on  $projection.AddressID    = _AddressDetails.addrnumber
                                                                      and $projection.PersonNumber = _AddressDetails.persnumber

association [1..*] to adrp                 as _PersonDetails          on  $projection.PersonNumber = _PersonDetails.persnumber

association [1..*]  to I_BusinessPartnerAddress as _BPCompanyPostalAddress on  $projection.AddressID              = _BPCompanyPostalAddress.AddressNumber
                                                                        and ( $projection.BusinessPartnerPerson = _BPCompanyPostalAddress.BusinessPartner
                                                                        or $projection.BusinessPartnerCompany = _BPCompanyPostalAddress.BusinessPartner )

association [0..*] to I_AddressPhoneNumber_2 as _Telephone              on  $projection.AddressID      = _Telephone.AddressID
                                                                      and $projection.PersonNumber   = _Telephone.AddressPersonID
                                                                      and _Telephone.PhoneNumberType = '1'

association [0..*] to I_AddressPhoneNumber_2 as _MobilePhone            on  $projection.AddressID        = _MobilePhone.AddressID
                                                                      and $projection.PersonNumber     = _MobilePhone.AddressPersonID
                                                                      and _MobilePhone.PhoneNumberType = '3'

association [0..*] to I_AddressFaxNumber_2   as _FaxNumber              on  $projection.AddressID         = _FaxNumber.AddressID
                                                                      and $projection.PersonNumber      = _FaxNumber.AddressPersonID
                                                                      and _FaxNumber.FaxNumberIsCurrentDefault = 'X'
{
  key but052.relnr                                as RelationshipNumber,
      //--[ GENERATED:012:GlBfhyJl7kY4i6}7dD1KRG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_BusinessPartnerVH',
                     element: 'BusinessPartner' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association : '_BusinessPartnerPerson'
  key but052.partner2                             as BusinessPartnerCompany,
      //--[ GENERATED:012:GlBfhyJl7kY4i6}7dD1KRG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_BusinessPartnerVH',
                     element: 'BusinessPartner' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association : '_BusinessPartnerCompany'
  key but052.partner1                             as BusinessPartnerPerson,
  key but050.date_to                              as ValidityEndDate,
      @ObjectModel.foreignKey.association: '_AddressDetails'
  key but052.addrnumber                           as AddressID,
  key ''                                          as BPRelshpCatIsInFwdDirection,
      but000.persnumber                           as PersonNumber,
      but052.xdfadr                               as IsDefaultAddress,
      'BUR001'                                    as RelationshipCategory,
      _AddressDetails[1: nation = ' '].nation     as AddressRepresentationCode,
      _AddressDetails[1: nation = ' '].function   as ContactRelationshipFunction,
      _AddressDetails[1: nation = ' '].department as ContactRelationshipDepartment,
      _AddressDetails[1: nation = ' '].floor      as Floor,
      _AddressDetails[1: nation = ' '].building   as Building,
      _AddressDetails[1: nation = ' '].roomnumber as RoomNumber,
      _AddressDetails[1: nation = ' '].deflt_comm as PrfrdCommMediumType,
      _AddressDetails[1: nation = ' '].id_code    as CorrespondenceShortName,
      _AddressDetails[1: nation = ' '].ih_mail    as InhouseMail,
//      _Telephone.InternationalPhoneNumber,

//      _Telephone.DestinationLocationCountry       as PhoneNumberCountry,

//      _Telephone.PhoneNumber,

//      _MobilePhone.InternationalPhoneNumber       as InternationalMobilePhoneNumber,

//      _MobilePhone.DestinationLocationCountry     as MobilePhoneCountry,

//      _MobilePhone.PhoneNumber                    as MobilePhoneNumber,

//      _MobilePhone.PhoneNumberExtension           as MobilePhoneNumberExtension,

//      _FaxNumber.InternationalFaxNumber,

//      _FaxNumber.FaxCountry,

      _BusinessPartnerPerson.AuthorizationGroup,
      _BusinessPartnerPerson.IsBusinessPurposeCompleted,
       but052.date_to as RelValidityEndDate,
      _AddressDetails,
      _PersonDetails,     
      _BPCompanyPostalAddress,
      _BusinessPartnerCompany,
      _BusinessPartnerPerson,
      _Telephone,
      _MobilePhone,
      _FaxNumber
}