@AbapCatalog: { sqlViewName: 'PCOLLSGRPFORDDG',
compiler: { compareFilter: true },
preserveKey: true }
@AccessControl: { authorizationCheck: #NOT_REQUIRED,
personalData: { blocking: #BLOCKED_DATA_EXCLUDED } }
@VDM: { viewType: #COMPOSITE,
private: true }
@ClientHandling: { algorithm: #SESSION_VARIABLE }
@ObjectModel: { usageType: { serviceQuality: #X,
sizeCategory: #L,
dataClass: #TRANSACTIONAL },
representativeKey: 'BusinessPartner' }
define view P_CollsGroupForDDG
as select from P_CollsLatestWLItem
// VDM Associations
// Master Data
association [0..1] to I_BPCollectionsSegmentAssgmt as _BPCollectionSegment on $projection.BusinessPartner = _BPCollectionSegment.BusinessPartner
and $projection.CollectionSegment = _BPCollectionSegment.CollectionSegment
and _BPCollectionSegment.BPCollSgmtAssignmentValidFrom <= $session.system_date
and _BPCollectionSegment.BPCollSgmtAssignmentValidTo >= $session.system_date
// Temporary Assignments
association [0..1] to I_BPCollectionsSgmtTmpAssgmt as _TemporaryBPCollectionSegment on $projection.BusinessPartner = _TemporaryBPCollectionSegment.BusinessPartner
and $projection.CollectionSegment = _TemporaryBPCollectionSegment.CollectionSegment
and _TemporaryBPCollectionSegment.TmpBPCollSgmtAssgmtValidFrom <= $session.system_date
and _TemporaryBPCollectionSegment.TmpBPCollSgmtAssgmtValidTo >= $session.system_date
{
// VDM Fields
key BusinessPartner,
key CollectionSegment,
case
when CollectionGroup is initial or CollectionGroup is null
then
case
when _TemporaryBPCollectionSegment.CollectionGroup is not initial and _TemporaryBPCollectionSegment.CollectionGroup is not null
then _TemporaryBPCollectionSegment.CollectionGroup
else _BPCollectionSegment.CollectionGroup
end
else CollectionGroup
end as CollectionGroup,
// Exposed Associations
_BusinessPartner,
_CollectionSegment,
_TemporaryBPCollectionSegment,
_BPCollectionSegment
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BPCOLLECTIONSSEGMENTASSGMT",
"I_BPCOLLECTIONSSGMTTMPASSGMT",
"P_COLLSLATESTWLITEM"
],
"ASSOCIATED":
[
"I_BPCOLLECTIONSSEGMENTASSGMT",
"I_BPCOLLECTIONSSGMTTMPASSGMT",
"I_BUSINESSPARTNER",
"I_COLLECTIONSEGMENT"
],
"BASE":
[
"P_COLLSLATESTWLITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/