@AbapCatalog.sqlViewName: 'IBPADDRESSTP'
@ClientDependent: true
@AbapCatalog.compiler.compareFilter: true
@VDM.viewType: #TRANSACTIONAL
//@ObjectModel.writeEnabled: true
@ObjectModel.createEnabled
@ObjectModel.deleteEnabled: 'EXTERNAL_CALCULATION'
//@ObjectModel.deleteEnabled
@ObjectModel.updateEnabled: 'EXTERNAL_CALCULATION'
@ObjectModel.loadEnabled
@Search.searchable: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #REQUIRED
@EndUserText.label: 'Business Partner Address'
@Consumption.dbHints: [ 'USE_HEX_PLAN' ]
@ObjectModel.writeDraftPersistence: 'BUPA_ADRC_D'
@ObjectModel.draftEnabled:true
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MASTER
// Root view changed and fields have been exposed using the new view as part of I_Address_2 adoption
define view I_BusinessPartnerAddressTP
as select from I_BusPartAddress as BusinessPartnerAddress
association [1..1] to I_BusinessPartnerTP as _BusinessPartner on $projection.BusinessPartner = _BusinessPartner.BusinessPartner
association [1..*] to I_BusinessPartnerAddrUsageTP as _BusinessPartnerAddrUsage on $projection.BusinessPartner = _BusinessPartnerAddrUsage.BusinessPartner
and $projection.AddressNumber = _BusinessPartnerAddrUsage.AddressNumber
association [0..*] to I_BPTelephoneNumberTP as _BPTelephoneNumber on $projection.BusinessPartner = _BPTelephoneNumber.BusinessPartner
and $projection.AddressNumber = _BPTelephoneNumber.AddressID
association [0..*] to I_BPMobilePhoneNumberTP as _BPMobilePhoneNumber on $projection.BusinessPartner = _BPMobilePhoneNumber.BusinessPartner
and $projection.AddressNumber = _BPMobilePhoneNumber.AddressID
association [0..*] to I_BPFaxNumberTP as _BPFaxNumber on $projection.BusinessPartner = _BPFaxNumber.BusinessPartner
and $projection.AddressNumber = _BPFaxNumber.AddressID
association [0..*] to I_BPWebsiteURLTP as _BPWebsiteURL on $projection.BusinessPartner = _BPWebsiteURL.BusinessPartner
and $projection.AddressNumber = _BPWebsiteURL.AddressID
association [0..*] to I_BPEmailAddressTP as _BPEmailAddress on $projection.BusinessPartner = _BPEmailAddress.BusinessPartner
and $projection.AddressNumber = _BPEmailAddress.AddressID
//association [1..1] to I_BPLatestDefaultAddress as _StandardAddrUsage on $projection.BusinessPartner = _StandardAddrUsage.BusinessPartner
association [1..1] to I_BPLatestDefaultAddress_2 as _StandardAddrUsage on $projection.BusinessPartner = _StandardAddrUsage.BusinessPartner
association [0..1] to I_CountryText as _CountryText on $projection.country = _CountryText.Country
and _CountryText.Language = $session.system_language
{
@semanticKey: true
key BusinessPartnerAddress.BusinessPartner as BusinessPartner,
@semanticKey: true
key BusinessPartnerAddress.AddressID as AddressNumber,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #HIGH
@ObjectModel.foreignKey.association: null
BusinessPartnerAddress.BusinessPartner as BusinessPartnerForEdit,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
cast(BusinessPartnerAddress.AddressID as char10) as AddressNumberForEdit,
//BusinessPartnerAddress.AddressID as AddressNumberForEdit,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress.ValidityStartDate,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress.ValidityEndDate,
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
tstmp_to_dats(BusinessPartnerAddress.ValidityStartDate,'UTC', $session.client, 'NULL') as AddressValidityStartDate,
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
tstmp_to_dats(BusinessPartnerAddress.ValidityEndDate,'UTC', $session.client, 'NULL') as AddressValidityEndDate,
// BusinessPartnerAddress.AddressType,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.CareOfName,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.StreetPrefixName1 as StreetPrefixName, //Added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.StreetPrefixName2 as AdditionalStreetPrefixName, //Added
//BusinessPartnerAddress.FullName,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.HouseNumber,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.StreetName,
//dummy street for cloud
//cast( ' ' as abap.sstring( 60 ) ) as CustomerSupplierStreetName,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.StreetName as CustomerSupplierStreetName,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.HouseNumberSupplementText,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.StreetSuffixName1 as StreetSuffixName, //Added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.StreetSuffixName2 as AdditionalStreetSuffixName, //Added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.VillageName as HomeCityName, //Added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.DistrictName as District,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.PostalCode,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.CityName,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION' //Added dummy city for cloud
BusinessPartnerAddress._AddressDefaultRepresentation.CityName as CustomerSupplierCityName,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.Country,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.Region,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.AddressTimeZone,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.TransportZone, //Added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.TaxJurisdiction, //Added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.TaxJurisdiction as TaxJurisdictionByProvider,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.CompanyPostalCode,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.DeliveryServiceTypeCode, //Added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.DeliveryServiceNumber,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.POBox,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.POBoxIsWithoutNumber,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.POBoxPostalCode,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.POBoxLobbyName,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.POBoxDeviatingCityName,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.POBoxDeviatingRegion,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.POBoxDeviatingCountry,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.CorrespondenceLanguage,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.PrfrdCommMediumType,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation._CurrentDfltLandlinePhoneNmbr.PhoneAreaCodeSubscriberNumber as PhoneNumber,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation._CurrentDfltFaxNumber.FaxAreaCodeSubscriberNumber as FaxNumber,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation._CurrentDfltLandlinePhoneNmbr.PhoneNumberCountry as PhoneNumberCountry, //added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation._CurrentDfltLandlinePhoneNmbr.PhoneExtensionNumber as PhoneNumberExtension, //added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation._CurrentDfltFaxNumber.FaxNumberCountry as FaxCountry, //added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation._CurrentDfltFaxNumber.FaxExtensionNumber as FaxNumberExtension, //added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation._CurrentDfltMobilePhoneNumber.PhoneAreaCodeSubscriberNumber as MobilePhoneNumber, //added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation._CurrentDfltMobilePhoneNumber.PhoneNumberCountry as MobilePhoneCountry, //added
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation._CurrentDfltEmailAddress.EmailAddress,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BusinessPartnerAddress._AddressDefaultRepresentation.SecondaryRegionName as County,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
_AddressDefaultRepresentation.TertiaryRegionName as TownshipName,
BusinessPartnerAddress.BPTargetAddressID,
BusinessPartnerAddress.BPAddressMoveDateTime,
tstmp_to_dats(BusinessPartnerAddress.BPAddressMoveDateTime,'UTC', $session.client, 'NULL') as AddressMoveDate,
//concat_with_space(concat_with_space(concat_with_space(concat_with_space(StreetName,HouseNumber,1),PostalCode,1),CityName,1),Country,1) as AddressLine1Text,
//cast( ' ' as abap.char( 127 ) ) as AddressLine1Text,
/* case
when _TelCntryPrefixValueHelp.TelephoneCountryPrefix is null and PhoneNumberExtension is null and PhoneNumber is null
then EmailAddress
when EmailAddress is null
then concat('+',concat_with_space(_TelCntryPrefixValueHelp.TelephoneCountryPrefix,concat_with_space(PhoneNumber, PhoneNumberExtension,1),1))
else
concat_with_space(concat('+',concat_with_space(_TelCntryPrefixValueHelp.TelephoneCountryPrefix,concat_with_space(PhoneNumber, PhoneNumberExtension,1),1)),EmailAddress,1)
end as AddressLine2Text, */
//cast( ' ' as abap.char( 289 ) ) as AddressLine2Text,
// commented for I_Address_2 adoption
// coalesce(_Address._DefaultCorporatePhoneNumber.InternationalPhoneNumber, _Address._DefaultPrivatePhoneNumber.InternationalPhoneNumber) as InternationalPhoneNumber,
// coalesce(_AddressDefaultRepresentation._CurrentDfltLandlinePhoneNmbr.InternationalPhoneNumber, _AddressDefaultRepresentation._CurrentDfltMobilePhoneNumber.InternationalPhoneNumber) as InternationalPhoneNumber,
_AddressDefaultRepresentation._CurrentDfltLandlinePhoneNmbr.InternationalPhoneNumber,
/* @ObjectModel.readOnly: true
case when HouseNumber='' and StreetName='' and CityName='' and PostalCode=''
then HouseNumber
else
case when HouseNumber='' and StreetName=''
then concat_with_space(PostalCode,CityName,1)
else
concat_with_space(HouseNumber,concat(StreetName,concat_with_space(',',concat_with_space(PostalCode,CityName,1),1)),1)
end
end as FormattedAddress,*/
//cast( ' ' as abap.char( 124 ) ) as FormattedAddress,
// concat_with_space(concat(concat_with_space(concat_with_space(concat_with_space(HouseNumber,StreetName,1),',',1),CityName,1),','),concat_with_space(_CountryText.CountryName,PostalCode,1),1) as CompleteAddress,
cast( ' ' as abap.char( 177 ) ) as CompleteAddress,
@ObjectModel.enabled : true
cast( ' ' as abap.sstring( 260 ) ) as BPTargetAddressText,
@ObjectModel.readOnly: true
case when _StandardAddrUsage.AddressNumber = AddressID
then cast('X' as boole_d)
// else
// cast(' ' as boole_d)
end as StandardUsage,
@ObjectModel.readOnly: true
_BPProtectedAddress.BPAddressIsProtected,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
coalesce(_Address._DefaultCorpURLAddress.URLFieldLength, _Address._DefaultPvtURLAddress.URLFieldLength) as URLFieldLength,
// BusinessPartnerAddress.URLFieldLength as URLFieldLength,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
_Address._DefaultURLAddress.WebsiteURL,
// _AddressDefaultRepresentation._MainWebsiteURL.UniformResourceIdentifier as WebsiteURL,
// cast (BusinessPartnerAddress._AddressDefaultRepresentation._MainWebsiteURL.UniformResourceIdentifier
@ObjectModel.association.type: [#TO_COMPOSITION_ROOT,#TO_COMPOSITION_PARENT]
_BusinessPartner,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_BusinessPartnerAddrUsage,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_BPTelephoneNumber,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_BPMobilePhoneNumber,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_BPFaxNumber,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_BPWebsiteURL,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_BPEmailAddress,
_CountryText,
_StandardAddrUsage,
_BPProtectedAddress,
_AddressDefaultRepresentation,
_Address
}