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.
@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: #COMPOSITEdefineview I_BPCustDeptAddrDepdntInfo
asselectdistinctfrom I_BusPartAddress as BusinessPartnerAddress
innerjoin I_BusinessPartnerCustomer as BusinessPartnerCustomer on BusinessPartnerAddress.BusinessPartner = BusinessPartnerCustomer.BusinessPartner
leftouter to many join I_CustomerDepartment as CustomerDepartment on CustomerDepartment.Customer = BusinessPartnerCustomer.Customer
leftouter 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)
keycasewhen CustDepartmentAddrDepdntInfo.AddressID isnot initial then CustDepartmentAddrDepdntInfo.CustomerDepartment // Address dependent data - Show data from WRF4_addr
elsecasewhen BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then CustomerDepartment.CustomerDepartment // Only for default address fetch address dependent departments from WRF4_addr
elsecast( '' as abtnr ) // Non default address with no department data
endendas CustomerDepartment,
casewhen CustDepartmentAddrDepdntInfo.AddressID isnot initial then CustDepartmentAddrDepdntInfo.ReceivingPoint // Address dependent data - Show data from WRF4_addr
elsecasewhen BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then CustomerDepartment.ReceivingPoint // Only for default address fetch address dependent departments from WRF4_addr
elsecast( '' as empst ) // Non default address with no department data
endendas ReceivingPoint,
casewhen CustDepartmentAddrDepdntInfo.AddressID isnot initial then CustDepartmentAddrDepdntInfo.DepartmentLayout // Address dependent data - Show data from WRF4_addr
elsecasewhen BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then CustomerDepartment.DepartmentLayout // Only for default address fetch address dependent departments from WRF4_addr
elsecast( '' as layvar ) // Non default address with no department data
endendas DepartmentLayout,
casewhen CustDepartmentAddrDepdntInfo.AddressID isnot initial then CustDepartmentAddrDepdntInfo.DepartmentLayoutAreaSchema // Address dependent data - Show data from WRF4_addr
elsecasewhen BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then CustomerDepartment.DepartmentLayoutAreaSchema // Only for default address fetch address dependent departments from WRF4_addr
elsecast( '' as flvar ) // Non default address with no department data
endendas DepartmentLayoutAreaSchema,
@Semantics.quantity.unitOfMeasure: 'RetailLocationSellingAreaUnit'
casewhen CustDepartmentAddrDepdntInfo.AddressID isnot initial then CustDepartmentAddrDepdntInfo.RetailLocationSellingAreaSize // Address dependent data - Show data from WRF4_addr
elsecasewhen BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then CustomerDepartment.RetailLocationSellingAreaSize // Only for default address fetch address dependent departments from WRF4_addr
elsecast( 0 as verfl_wws ) // Non default address with no department data
endendas RetailLocationSellingAreaSize,
casewhen CustDepartmentAddrDepdntInfo.AddressID isnot initial then CustDepartmentAddrDepdntInfo.RetailLocationSellingAreaUnit // Address dependent data - Show data from WRF4_addr
elsecasewhen BusinessPartnerAddress.AddressID = _DefaultAddress.AddressID then CustomerDepartment.RetailLocationSellingAreaUnit // Only for default address fetch address dependent departments from WRF4_addr
elsecast( '' as verfe_wws ) // Non default address with no department data
endendas 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":""
}
}*/