I_BPCustomerGeneralAddressInfo

DDL: I_BPCUSTOMERGENERALADDRESSINFO SQL: IBPCUSTADDRINFO Type: view COMPOSITE Package: VDM_MD_COMMON

BP and Cust Addr Depdnt Info

I_BPCustomerGeneralAddressInfo is a Composite CDS View that provides data about "BP and Cust Addr Depdnt Info" in SAP S/4HANA. It reads from 2 data sources (I_BusPartAddress, I_BusinessPartnerCustomer) and exposes 39 fields with key fields BusinessPartner, AddressID. It has 2 associations to related views. Part of development package VDM_MD_COMMON.

Data Sources (2)

SourceAliasJoin Type
I_BusPartAddress BusinessPartnerAddress from
I_BusinessPartnerCustomer BusinessPartnerCustomer inner

Associations (2)

CardinalityTargetAliasCondition
[1..1] I_BusinessPartner _BusinessPartner _BusinessPartner.BusinessPartner = $projection.BusinessPartner
[1..1] I_Customer _Customer $projection.Customer = _Customer.Customer

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName IBPCUSTADDRINFO view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #REQUIRED view
EndUserText.label BP and Cust Addr Depdnt Info view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MASTER view
VDM.viewType #COMPOSITE view

Fields (39)

KeyFieldSource TableSource FieldDescription
KEY BusinessPartner I_BusPartAddress BusinessPartner
KEY AddressID I_BusPartAddress AddressID
Customer I_BusinessPartnerCustomer Customer
TrainStationNameendasTrainStationName
CityCodeendasCityCode
CountyendasCounty
CustomerAccountGroup I_BusinessPartnerCustomer CustomerAccountGroup
CustomerClassification I_BusinessPartnerCustomer CustomerClassification
AuthorizationGroup I_BusinessPartnerCustomer AuthorizationGroup
DeliveryIsBlocked I_BusinessPartnerCustomer DeliveryIsBlocked
PostingIsBlocked I_BusinessPartnerCustomer PostingIsBlocked
BillingIsBlockedForCustomer I_BusinessPartnerCustomer BillingIsBlockedForCustomer
OrderIsBlockedForCustomer I_BusinessPartnerCustomer OrderIsBlockedForCustomer
CustomerCorporateGroup I_BusinessPartnerCustomer CustomerCorporateGroup
Supplier I_BusinessPartnerCustomer Supplier
IndustryCode1 I_BusinessPartnerCustomer IndustryCode1
IndustryCode2 I_BusinessPartnerCustomer IndustryCode2
IndustryCode3 I_BusinessPartnerCustomer IndustryCode3
AlternativePayerAccount I_BusinessPartnerCustomer AlternativePayerAccount
DataMediumExchangeIndicator I_BusinessPartnerCustomer DataMediumExchangeIndicator
VATLiability I_BusinessPartnerCustomer VATLiability
FiscalAddress I_BusinessPartnerCustomer FiscalAddress
IsNaturalPerson I_BusinessPartnerCustomer IsNaturalPerson
CityLocationCoordinatesCode I_BusinessPartnerCustomer CityLocationCoordinatesCode
DeliveryDateTypeRule I_BusinessPartnerCustomer DeliveryDateTypeRule
Plant I_BusinessPartnerCustomer Plant
DataExchangeInstructionKey I_BusinessPartnerCustomer DataExchangeInstructionKey
IsCompetitor I_BusinessPartnerCustomer IsCompetitor
IsSalesPartner I_BusinessPartnerCustomer IsSalesPartner
IsDefaultSoldToParty I_BusinessPartnerCustomer IsDefaultSoldToParty
IsConsumer I_BusinessPartnerCustomer IsConsumer
FreeDefinedAttribute03 I_BusinessPartnerCustomer FreeDefinedAttribute03
CustomerConditionGroup1 I_BusinessPartnerCustomer CustomerConditionGroup1
CustomerConditionGroup2 I_BusinessPartnerCustomer CustomerConditionGroup2
CustomerConditionGroup3 I_BusinessPartnerCustomer CustomerConditionGroup3
CustomerConditionGroup4 I_BusinessPartnerCustomer CustomerConditionGroup4
CustomerConditionGroup5 I_BusinessPartnerCustomer CustomerConditionGroup5
_BusinessPartner _BusinessPartner
_Customer _Customer
@AbapCatalog.sqlViewName: 'IBPCUSTADDRINFO'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #REQUIRED
@EndUserText.label: 'BP and Cust Addr Depdnt Info'
@ClientHandling.algorithm : #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MASTER
@VDM.viewType: #COMPOSITE
@Consumption.dbHints: [ 'USE_HEX_PLAN' ]

define view I_BPCustomerGeneralAddressInfo
  as select from           I_BusPartAddress            as BusinessPartnerAddress
    inner join             I_BusinessPartnerCustomer   as BusinessPartnerCustomer   on BusinessPartnerAddress.BusinessPartner = BusinessPartnerCustomer.BusinessPartner
    left outer to one join I_CustAddrDepdntInformation as CustAddrDepdntInformation on  BusinessPartnerCustomer.Customer = CustAddrDepdntInformation.Customer
                                                                                    and BusinessPartnerAddress.AddressID = CustAddrDepdntInformation.AddressID

  association [1..1] to I_BusinessPartner as _BusinessPartner on _BusinessPartner.BusinessPartner = $projection.BusinessPartner
  association [1..1] to I_Customer        as _Customer        on $projection.Customer = _Customer.Customer
//  association [0..*] to I_BPDataControllerUsage as _BPDataControllerUsage on  $projection.BusinessPartner = _BPDataControllerUsage.BusinessPartner

{

  key BusinessPartnerAddress.BusinessPartner                         as BusinessPartner,
  key BusinessPartnerAddress.AddressID                               as AddressID,
      BusinessPartnerCustomer.Customer                               as Customer,
      // Logic to determine customer address number: If Address is marked as standard address at business partner level, then check if any addr dependent info is maintained in kna1_addr,

      // If addr dependent data is maintained use 'kna1_addr' tables address number If no deviation data is maintained, fallback to 'kna1' tables addr number

      // For a non standard BP address with no address dependent data , The address number will be fetched from 'KNA1' table

      //      case when BusinessPartnerAddress.AddressNumber =  _BPCurrentDefaultAddress.AddressID then coalesce( CustAddrDepdntInformation.AddressID , BusinessPartnerCustomer.AddressID)

      //      else case

      //            when ( CustAddrDepdntInformation.AddressID is not initial ) then CustAddrDepdntInformation.AddressID

      //            else BusinessPartnerCustomer.AddressID end  // For a non standard BP address with no address dependent data

      //

      //      end                                                       as CustomerAddressID,

      // Fields common to both KNA1_ADDR and KNA1 tables

      // When an address number exists for customer address depdedent information, Fetch data from KNA1_ADDR table

      // Else fetch data from KNA1 table

      case when CustAddrDepdntInformation.AddressID is not initial then CustAddrDepdntInformation.ExpressTrainStationName
      else  BusinessPartnerCustomer.ExpressTrainStationName end      as ExpressTrainStationName,

      case when CustAddrDepdntInformation.AddressID is not initial then CustAddrDepdntInformation.TrainStationName
      else  BusinessPartnerCustomer.TrainStationName end             as TrainStationName,

//      case when CustAddrDepdntInformation.AddressID is not initial then CustAddrDepdntInformation.InternationalLocationNumber1

//      else  BusinessPartnerCustomer.InternationalLocationNumber1 end as InternationalLocationNumber1,

//

//      case when CustAddrDepdntInformation.AddressID is not initial then CustAddrDepdntInformation.InternationalLocationNumber2

//      else  BusinessPartnerCustomer.InternationalLocationNumber2 end as InternationalLocationNumber2,


//      case when CustAddrDepdntInformation.AddressID is not initial then CustAddrDepdntInformation.InternationalLocationNumber3

//      else  BusinessPartnerCustomer.InternationalLocationNumber3 end as InternationalLocationNumber3,


      case when CustAddrDepdntInformation.AddressID is not initial then CustAddrDepdntInformation.CityCode
      else  BusinessPartnerCustomer.CityCode end                     as CityCode,

      case when CustAddrDepdntInformation.AddressID is not initial then CustAddrDepdntInformation.County
      else  BusinessPartnerCustomer.County end                       as County,

      case when CustAddrDepdntInformation.AddressID is not initial then CustAddrDepdntInformation.CustomerHasUnloadingPoint
      else  BusinessPartnerCustomer.CustomerHasUnloadingPoint end    as CustomerHasUnloadingPoint,

//      case when CustAddrDepdntInformation.AddressID is not initial then CustAddrDepdntInformation.CustomerWorkingTimeCalendar

//      else  BusinessPartnerCustomer.CustomerWorkingTimeCalendar end  as CustomerWorkingTimeCalendar,


      // KNA1 only fields

      BusinessPartnerCustomer.CustomerAccountGroup,
      BusinessPartnerCustomer.CustomerClassification,
      BusinessPartnerCustomer.AuthorizationGroup,
      BusinessPartnerCustomer.DeliveryIsBlocked,
      BusinessPartnerCustomer.PostingIsBlocked,
      BusinessPartnerCustomer.BillingIsBlockedForCustomer,
      BusinessPartnerCustomer.OrderIsBlockedForCustomer,
      BusinessPartnerCustomer.CustomerCorporateGroup,
      BusinessPartnerCustomer.Supplier,
      BusinessPartnerCustomer.IndustryCode1,
      BusinessPartnerCustomer.IndustryCode2,
      BusinessPartnerCustomer.IndustryCode3,
      BusinessPartnerCustomer.AlternativePayerAccount,
      BusinessPartnerCustomer.DataMediumExchangeIndicator,
      BusinessPartnerCustomer.VATLiability,
      BusinessPartnerCustomer.FiscalAddress,
      @Semantics.booleanIndicator:true
      BusinessPartnerCustomer.IsNaturalPerson,
      BusinessPartnerCustomer.CityLocationCoordinatesCode,
      BusinessPartnerCustomer.DeliveryDateTypeRule,
      BusinessPartnerCustomer.Plant,
      BusinessPartnerCustomer.DataExchangeInstructionKey,
      BusinessPartnerCustomer.IsCompetitor,
      BusinessPartnerCustomer.IsSalesPartner,
      BusinessPartnerCustomer.IsDefaultSoldToParty,
      BusinessPartnerCustomer.IsConsumer,
      BusinessPartnerCustomer.FreeDefinedAttribute03,
      BusinessPartnerCustomer.CustomerConditionGroup1,
      BusinessPartnerCustomer.CustomerConditionGroup2,
      BusinessPartnerCustomer.CustomerConditionGroup3,
      BusinessPartnerCustomer.CustomerConditionGroup4,
      BusinessPartnerCustomer.CustomerConditionGroup5,
      _BusinessPartner,
      _Customer
      // non existent fields in BP cust to be added in I_BusinessPartnerCustomer

      //      BusinessPartnerCustomer.VATRegistration,

      //      BusinessPartnerCustomer.IsOneTimeAccount,

      //      BusinessPartnerCustomer.TaxJurisdiction,

      //      BusinessPartnerCustomer.Industry,

      //      BusinessPartnerCustomer.TaxNumberType,

      //      BusinessPartnerCustomer.TaxNumber1, // same as kna1.stcd1 ?

      //      BusinessPartnerCustomer.TaxNumber2, // same as kna1.stcd2 ?

      //      BusinessPartnerCustomer.TaxNumber3,

      //      BusinessPartnerCustomer.TaxNumber4,

      //      BusinessPartnerCustomer.TaxNumber5,

      //      BusinessPartnerCustomer.NielsenRegion,

      //      BusinessPartnerCustomer.IndustryCode4,

      //      BusinessPartnerCustomer.IndustryCode5,

      //      BusinessPartnerCustomer.Country,

      //      BusinessPartnerCustomer.OrganizationBPName1,

      //      BusinessPartnerCustomer.OrganizationBPName2,

      //      BusinessPartnerCustomer.CityName,

      //      BusinessPartnerCustomer.PostalCode,

      //      BusinessPartnerCustomer.StreetName,

      //      BusinessPartnerCustomer.SortField,

      //      BusinessPartnerCustomer.FaxNumber,

      //      BusinessPartnerCustomer.BR_SUFRAMACode,

      //      BusinessPartnerCustomer.Region,

      //      BusinessPartnerCustomer.TelephoneNumber1,

      //      BusinessPartnerCustomer.TelephoneNumber2,

      //      BusinessPartnerCustomer.IsBusinessPurposeCompleted,

      //      BusinessPartnerCustomer.ResponsibleType,

      //      BusinessPartnerCustomer.CustomerFullName,

      //      BusinessPartnerCustomer.CreatedByUser,

      //      BusinessPartnerCustomer.CreationDate,

      //      BusinessPartnerCustomer.NFPartnerIsNaturalPerson,

      //      BusinessPartnerCustomer.DeletionIndicator,

      //      BusinessPartnerCustomer.Language,

      //      BusinessPartnerCustomer.TradingPartner,

      //      BusinessPartnerCustomer.TaxInvoiceRepresentativeName,

      //      BusinessPartnerCustomer.BusinessType,

      //      BusinessPartnerCustomer.IndustryType,

      //      BusinessPartnerCustomer.TW_CollvBillingIsSupported,

      //      BusinessPartnerCustomer.AlternativePayeeIsAllowed,


}