P_BPCONTACTTOADDRESS

CDS View

BP Contact person address

P_BPCONTACTTOADDRESS is a CDS View in S/4HANA. BP Contact person address. It contains 18 fields. 7 CDS views read from this table.

CDS Views using this table (7)

ViewTypeJoinVDMDescription
I_BPRelshpCntctPersnAddressTP view_entity from TRANSACTIONAL RAPBO view for BP Contact Person Address
I_BPRelshpCntctPersnAddrVersTP view_entity from TRANSACTIONAL RAP BO Contact Person Address Versions
I_BPRelshpCntctPersnEmlAddrTP view_entity from TRANSACTIONAL RAP BO Contact Person Email Address
I_BPRelshpCntctPersnFaxNmbrTP view_entity from TRANSACTIONAL BO view for Contact Person Fax Number
I_BPRelshpCntctPersnMblNmbrTP view_entity from TRANSACTIONAL BO view for Contact Person Mobile Number
I_BPRelshpCntctPersnTelNmbrTP view_entity from TRANSACTIONAL RAP BO Contact Person Telephone Number
I_BPRelshpCntctPersnWbsteURLTP view_entity from TRANSACTIONAL BO view for Contact Person Website

Fields (18)

KeyField CDS FieldsUsed in Views
KEY AddressID AddressID,AddressIDForEdit 7
KEY BPRelshpCatIsInFwdDirection BPRelshpCatIsInFwdDirection 7
KEY BusinessPartnerCompany BusinessPartner1 7
KEY BusinessPartnerPerson BusinessPartner2 7
KEY RelationshipCategory RelationshipCategory 7
_BusinessPartnerCompany _BusinessPartner1 7
_BusinessPartnerPerson _BusinessPartner2 7
Building Building 1
ContactRelationshipDepartment ContactRelationshipDepartment 1
ContactRelationshipFunction ContactRelationshipFunction 1
CorrespondenceShortName CorrespondenceShortName 1
Floor Floor 1
InhouseMail InhouseMail 1
IsDefaultAddress IsDefaultAddress 1
PrfrdCommMediumType PrfrdCommMediumType 1
RelationshipNumber RelationshipNumber 7
RelValidityEndDate RelValidityEndDate 2
RoomNumber RoomNumber 1
@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
}