I_BPCurrentDefaultAddress

DDL: I_BPCURRENTDEFAULTADDRESS SQL: IBPCURRDEFADDR Type: view BASIC Package: VDM_MD_BP_BASE

Business Partner Current Default Address

I_BPCurrentDefaultAddress is a Basic CDS View that provides data about "Business Partner Current Default Address" in SAP S/4HANA. It reads from 2 data sources (but020, but021_fs) and exposes 11 fields with key field BusinessPartner. It has 6 associations to related views. Part of development package VDM_MD_BP_BASE.

Data Sources (2)

SourceAliasJoin Type
but020 but020 from
but021_fs but021_fs inner

Associations (6)

CardinalityTargetAliasCondition
[1..1] I_Address _Address $projection.AddressID = _Address.AddressID
[0..1] I_Address _StandardAddress $projection.AddressID = _StandardAddress.AddressID
[1..1] I_BusinessPartner _BusinessPartner $projection.BusinessPartner = _BusinessPartner.BusinessPartner
[0..1] I_BPProtectedAddress _BPProtectedAddress $projection.BusinessPartner = _BPProtectedAddress.BusinessPartner and $projection.AddressID = _BPProtectedAddress.AddressID
[0..1] I_Address_2 _AddressDefaultRepresentation $projection.AddressID = _AddressDefaultRepresentation.AddressID and _AddressDefaultRepresentation.AddressRepresentationCode = ''
[0..1] I_AddrOrgNamePostalAddress _AddrOrgNamePostalAddress $projection.AddressID = _AddrOrgNamePostalAddress.AddressID and _AddrOrgNamePostalAddress.AddressRepresentationCode = ''

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName IBPCURRDEFADDR view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
VDM.viewType #BASIC view
EndUserText.label Business Partner Current Default Address view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MASTER view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #REQUIRED view
AbapCatalog.preserveKey true view

Fields (11)

KeyFieldSource TableSource FieldDescription
KEY BusinessPartner but020 partner
AddressID but020 addrnumber
ValidityStartDateTime but020 addr_valid_from
ValidityEndDateTime but020 addr_valid_to
BPAddressIsProtected _BPProtectedAddress BPAddressIsProtected
_Address _Address
_StandardAddress _StandardAddress
AuthorizationGroup _BusinessPartner AuthorizationGroup
_BusinessPartner _BusinessPartner
_AddressDefaultRepresentation _AddressDefaultRepresentation
_AddrOrgNamePostalAddress _AddrOrgNamePostalAddress
@AbapCatalog.sqlViewName: 'IBPCURRDEFADDR'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@VDM.viewType: #BASIC
@EndUserText.label: 'Business Partner Current Default Address'
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MASTER
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #REQUIRED
@AccessControl.privilegedAssociations:  [ '_Address', '_AddressDefaultRepresentation', '_AddrOrgNamePostalAddress']
@AbapCatalog.preserveKey:true
@Consumption.dbHints: [ 'USE_HEX_PLAN' ]
define view I_BPCurrentDefaultAddress
  as select from but020
    inner join   but021_fs on(
      but020.partner            =  but021_fs.partner
      and but020.addrnumber     =  but021_fs.addrnumber
      and
      //   but020.addr_valid_to = but021_fs.valid_to and

      but021_fs.adr_kind        =  'XXDEFAULT'
      and but020.nation         =  ' '
      and(
       // but021_fs.valid_from    is null *Commented for ESH restrction

       // or

         but021_fs.valid_from =  0
        or but021_fs.valid_from <= tstmp_current_utctimestamp()
      )
      and(
      //  but021_fs.valid_to      is null

     //   or 

        but021_fs.valid_to   =  0
        or but021_fs.valid_to   >= tstmp_current_utctimestamp()
      )
    )

  association [1..1] to I_Address            as _Address                      on  $projection.AddressID = _Address.AddressID
  association [0..1] to I_Address            as _StandardAddress              on  $projection.AddressID = _StandardAddress.AddressID
  association [1..1] to I_BusinessPartner    as _BusinessPartner              on  $projection.BusinessPartner = _BusinessPartner.BusinessPartner

  association [0..1] to I_BPProtectedAddress as _BPProtectedAddress           on  $projection.BusinessPartner = _BPProtectedAddress.BusinessPartner
                                                                              and $projection.AddressID       = _BPProtectedAddress.AddressID
  association [0..1] to I_Address_2          as _AddressDefaultRepresentation on  $projection.AddressID       = _AddressDefaultRepresentation.AddressID
                                                                        //      and _AddressDefaultRepresentation.AddressRepresentationCode is initial  //Commented for ESH      

                                                                              and _AddressDefaultRepresentation.AddressRepresentationCode = ''  
  association [0..1] to I_AddrOrgNamePostalAddress as _AddrOrgNamePostalAddress on  $projection.AddressID = _AddrOrgNamePostalAddress.AddressID
                                                                              and _AddrOrgNamePostalAddress.AddressRepresentationCode = ''                                                                                                                                                                                                                 
{
  key but020.partner         as BusinessPartner,
      //but021_fs.addrnumber   as AddressID, -> for testing LCHAR datatype -> view generation

      but020.addrnumber      as AddressID,
      but020.addr_valid_from as ValidityStartDateTime,
      but020.addr_valid_to   as ValidityEndDateTime,

      _BPProtectedAddress.BPAddressIsProtected,

      _Address
      //newly added associations

  ,
      _StandardAddress,
      _BusinessPartner.AuthorizationGroup,
      _BusinessPartner,
      // I_Address_2 adoption

      _AddressDefaultRepresentation,
      _AddrOrgNamePostalAddress
}