//@AbapCatalog.sqlViewName: 'IBUPAADDRUSGTP2'
//@AbapCatalog.compiler.compareFilter: true
//@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #REQUIRED
@EndUserText.label: 'Business Partner Addresses Usages'
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MASTER
//@ClientHandling.algorithm : #SESSION_VARIABLE
@VDM.lifecycle.contract.type:#SAP_INTERNAL_API
@Search.searchable: true
@VDM.viewType: #TRANSACTIONAL
/*+[hideWarning] { "IDS" : [ "KEY_CHECK" ] } */
@Consumption.dbHints: [ 'USE_HEX_PLAN' ]
define view entity I_BusinessPartnerAddrUsageTP_2
as select from I_Businesspartneraddressusage
association to parent I_BusinessPartnerAddressTP_2 as _BusinessPartnerAddress on $projection.BusinessPartner = _BusinessPartnerAddress.BusinessPartner
and $projection.AddressNumber = _BusinessPartnerAddress.AddressNumber
// and $projection.BPDrftUUID = _BusinessPartnerAddress.BPDrftUUID
// and $projection.BPAddressDrftUUID = _BusinessPartnerAddress.BPAddressDrftUUID
association [1..1] to I_BusinessPartnerTP_2 as _BusinessPartner on $projection.BusinessPartner = _BusinessPartner.BusinessPartner
// and $projection.BPDrftUUID = _BusinessPartner.BPDrftUUID
association [0..1] to I_BusinessPartnerAddressType as _AddressType on $projection.AddressUsage = _AddressType.AddressType
{
// key cast ( hextobin('00000000000000000000000000000000') as sysuuid_x ) as BPDrftUUID,
// key cast ( hextobin('00000000000000000000000000000000') as sysuuid_x ) as BPAddressDrftUUID,
// key cast ( hextobin('00000000000000000000000000000000') as sysuuid_x ) as BPAddrUsageDrftUUID,
key BusinessPartner,
key AddressNumber,
@ObjectModel.foreignKey.association: '_AddressType'
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #HIGH
key AddressUsage,
@EndUserText.label: 'Valid To'
@Semantics.businessDate.to: true
key cast(case when ValidityEndDate != 00010101000000
then tstmp_to_dats(ValidityEndDate,'UTC', $session.client, 'NULL')
else cast ( '99991231' as abap.dats)
end as abap.char( 8 )) as ValidityEndDate,
// key case when ValidityEndDate != 00010101000000
// then tstmp_to_dats(ValidityEndDate,'UTC', $session.client, 'NULL')
// else cast ( '99991231' as abap.dats)
// end as ValidityEndDate,
// key cast( ValidityEndDate as abap.char( 17 )) as ValidityEndDate,
// @ObjectModel.foreignKey.association: '_AddressType'
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #HIGH
AddressUsage as AddressUsageForEditValue,
// @EndUserText.label: 'Valid To'
// @Semantics.businessDate.to: true
// case when ValidityEndDate != 00010101000000
// then tstmp_to_dats(ValidityEndDate,'UTC', $session.client, 'NULL')
// else cast ( '99991231' as abap.dats)
// end as ValidityEndDateForEditValue,
@EndUserText.label: 'Valid To'
@Semantics.businessDate.to: true
@ObjectModel.editableFieldFor: 'ValidityEndDate'
case when ValidityEndDate != 00010101000000
then tstmp_to_dats(ValidityEndDate,'UTC', $session.client, 'NULL')
else cast ( '99991231' as abap.dats)
end as ValidityEndDateForEdit,
@EndUserText.label: 'Valid From'
@Semantics.businessDate.from: true
case when ValidityStartDate != 00010101000000
then tstmp_to_dats(ValidityStartDate,'UTC', $session.client, 'NULL')
else cast ( '00010103' as abap.dats )
end as ValidityStartDate,
@Semantics.booleanIndicator: true
case AddressUsage
when 'XXDEFAULT' then 'X'
else StandardUsage end as StandardUsage,
// StandardUsage,
AuthorizationGroup,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataControllerSet as DataControllerSet,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataController1 as DataController1,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataController2 as DataController2,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataController3 as DataController3,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataController4 as DataController4,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataController5 as DataController5,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataController6 as DataController6,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataController7 as DataController7,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataController8 as DataController8,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataController9 as DataController9,
@Consumption.hidden:true
@UI.hidden:true
_BusinessPartner.DataController10 as DataController10,
/* Associations */
_BusinessPartnerAddress,
_BusinessPartner,
_AddressType,
_BusinessPartnerAddress._BusinessPartner.IsBusinessPurposeCompleted,
_BusinessPartnerAddress._BPProtectedAddress.BPAddressIsProtected
//-- Data controller association
// _BPDataControllerUsage
}