I_BPCustDeptAddrDepdntInfo

DDL: I_BPCUSTDEPTADDRDEPDNTINFO SQL: IBPCUSTDEPTADDR Type: view COMPOSITE

BP and Cust dept Addr Depdnt Info

I_BPCustDeptAddrDepdntInfo is a Composite CDS View that provides data about "BP and Cust dept Addr Depdnt Info" in SAP S/4HANA. It reads from 1 data source (I_BusinessPartnerCustomer) and exposes 36 fields with key fields BusinessPartner, AddressID, Customer. It has 3 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_BusinessPartnerCustomer BusinessPartnerCustomer inner

Associations (3)

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

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName IBPCUSTDEPTADDR view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #REQUIRED view
EndUserText.label BP and Cust dept 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 (36)

KeyFieldSource TableSource FieldDescription
KEY BusinessPartner BusinessPartnerAddress BusinessPartner
KEY AddressID BusinessPartnerAddress AddressID
KEY Customer I_BusinessPartnerCustomer Customer
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: 'IBPCUSTDEPTADDR'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #REQUIRED
@EndUserText.label: 'BP and Cust dept 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

define view I_BPCustDeptAddrDepdntInfo
  as select distinct from   I_BusPartAddress               as BusinessPartnerAddress
    inner join              I_BusinessPartnerCustomer      as BusinessPartnerCustomer      on BusinessPartnerAddress.BusinessPartner = BusinessPartnerCustomer.BusinessPartner
    left outer to many join I_CustomerDepartment           as CustomerDepartment           on CustomerDepartment.Customer = BusinessPartnerCustomer.Customer
    left outer to many join I_CustDepartmentAddrDepdntInfo as CustDepartmentAddrDepdntInfo on  CustDepartmentAddrDepdntInfo.Customer  = BusinessPartnerCustomer.Customer
                                                                                           and CustDepartmentAddrDepdntInfo.AddressID = BusinessPartnerAddress.AddressID

  association [1..1] to I_BPCurrentDefaultAddress as _DefaultAddress  on _DefaultAddress.BusinessPartner = $projection.BusinessPartner

  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
  
  
{
       @ObjectModel.foreignKey.association: '_BusinessPartner'
  key  BusinessPartnerAddress.BusinessPartner as BusinessPartner,
  key  BusinessPartnerAddress.AddressID       as AddressID,
       @ObjectModel.foreignKey.association: '_Customer'
  key  BusinessPartnerCustomer.Customer       as Customer,
       // Common fields Both in WRF4 and WRF4_ADDR

       // Logic for all the common fields:

       //    If Address dependent data exists show data from WRF4_ADDR , Else shown nothing for non default address

       //   For default address show department data from WRF4 (if exists)

  key  case when CustDepartmentAddrDepdntInfo.AddressID is not initial then CustDepartmentAddrDepdntInfo.CustomerDepartment           // Address dependent data  - Show data from WRF4_addr

       else
         case when BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then  CustomerDepartment.CustomerDepartment      // Only for default address fetch address dependent departments from WRF4_addr

         else cast( ''  as abtnr )                                                                                                                     // Non default address with no department data

         end
       end                                    as CustomerDepartment,

       case when CustDepartmentAddrDepdntInfo.AddressID is not initial then CustDepartmentAddrDepdntInfo.ReceivingPoint           // Address dependent data  - Show data from WRF4_addr

         else
           case when BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then  CustomerDepartment.ReceivingPoint       // Only for default address fetch address dependent departments from WRF4_addr

           else cast( ''  as empst )                                                                                                                     // Non default address with no department data

           end
         end                                  as ReceivingPoint,


       case when CustDepartmentAddrDepdntInfo.AddressID is not initial then CustDepartmentAddrDepdntInfo.DepartmentLayout           // Address dependent data  - Show data from WRF4_addr

         else
           case when BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then  CustomerDepartment.DepartmentLayout       // Only for default address fetch address dependent departments from WRF4_addr

           else cast( ''  as layvar )                                                                                                                     // Non default address with no department data

           end
         end                                  as DepartmentLayout,

       case when CustDepartmentAddrDepdntInfo.AddressID is not initial then CustDepartmentAddrDepdntInfo.DepartmentLayoutAreaSchema          // Address dependent data  - Show data from WRF4_addr

        else
          case when BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then  CustomerDepartment.DepartmentLayoutAreaSchema       // Only for default address fetch address dependent departments from WRF4_addr

          else cast( ''  as flvar )                                                                                                                     // Non default address with no department data

          end
        end                                   as DepartmentLayoutAreaSchema,
        
        @Semantics.quantity.unitOfMeasure: 'RetailLocationSellingAreaUnit'

       case when CustDepartmentAddrDepdntInfo.AddressID is not initial then CustDepartmentAddrDepdntInfo.RetailLocationSellingAreaSize         // Address dependent data  - Show data from WRF4_addr

         else
           case when BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then  CustomerDepartment.RetailLocationSellingAreaSize       // Only for default address fetch address dependent departments from WRF4_addr

           else cast( 0  as verfl_wws )                                                                                                                     // Non default address with no department data

           end
         end                                  as RetailLocationSellingAreaSize,

       case when CustDepartmentAddrDepdntInfo.AddressID is not initial then CustDepartmentAddrDepdntInfo.RetailLocationSellingAreaUnit         // Address dependent data  - Show data from WRF4_addr

        else
          case when BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then  CustomerDepartment.RetailLocationSellingAreaUnit        // Only for default address fetch address dependent departments from WRF4_addr

          else cast( ''  as verfe_wws )                                                                                                                     // Non default address with no department data

          end
        end                                   as RetailLocationSellingAreaUnit,


       // 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
       

}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BPCURRENTDEFAULTADDRESS",
"I_BUSINESSPARTNERCUSTOMER",
"I_BUSPARTADDRESS",
"I_CUSTDEPARTMENTADDRDEPDNTINFO",
"I_CUSTOMERDEPARTMENT"
],
"ASSOCIATED":
[
"I_BPCURRENTDEFAULTADDRESS",
"I_BUSINESSPARTNER",
"I_CUSTOMER"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/