I_BPCurrentDefaultAddress
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 10 fields with key field BusinessPartner. It has 5 associations to related views.
Associations (5)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [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 = '' |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| 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 (10)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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 |
@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']
@AbapCatalog.preserveKey:true
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 = ''
{
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
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BPPROTECTEDADDRESS",
"I_BUSINESSPARTNER",
"BUT020",
"BUT021_FS"
],
"ASSOCIATED":
[
"I_ADDRESS",
"I_ADDRESS_2",
"I_BPPROTECTEDADDRESS",
"I_BUSINESSPARTNER"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA