@AbapCatalog.sqlViewName : 'IRECONTRACTADDL'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType : #COMPOSITE // BASIC
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel: {
// representativeKey: 'RealEstateContract',
semanticKey: ['InternalRealEstateNumber' ],
usageType.serviceQuality: #D,
usageType.sizeCategory: #L,
usageType.dataClass: #MIXED
}
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@EndUserText.label : 'RE Contract additional'
define view I_REContractAddl
as select from I_REContract
association [1..1] to I_REContractType as _REContractType on $projection.REContractType = _REContractType.REContractType
association [0..1] to I_REContractStat as _REContractStat on $projection.REStatusObject = _REContractStat.StatusObject
// association [0..*] to I_REReminderDateAddl as _REReminderDateAddl on $projection.InternalRealEstateNumber = _REReminderDateAddl.InternalRealEstateNumber
// and $projection.
// association [0..1] to C_REContractConditionChart as _REContractConditionChart on $projection.InternalRealEstateNumber = _REContractConditionChart.InternalRealEstateNumber
{
key InternalRealEstateNumber,
RealEstateContract,
CompanyCode,
REContractType,
REStatusObject,
REAuthorizationGroup,
_REContractType.REContractCategory as REContractCategory,
// cast (_REContractStat.REContractStatus as recnvdmcnstatus) as REContractSystemStatusText,
//case when REContractActivateDate = '00.00.0000' then 'false '
// else 'true ' end as toggleactive,
// @DefaultAggregation: #SUM
// sum(case
// when _REReminderRule._REReminderDate.REReminderIsDone = 'X' then 0
// when _REReminderRule._REReminderDate.REReminderIsDone is null then 0
// //Uncritical reminders do not count
// when _REReminderRule._REReminderDate.REReminderDate > DATS_ADD_DAYS(cast ($session.system_date as dats),7,'UNCHANGED') then 0
// else 1
// end ) as RENumberOfOpenReminders,
//
// //Copied from I_REReminderDateAddl since association is not available here
// @DefaultAggregation: #MIN
// min( case when _REReminderRule.REReminderRule is null then 0 //no color
// else case
// when _REReminderRule._REReminderDate.REReminderDate < $session.system_date
// and _REReminderRule._REReminderDate.REReminderIsDone <> 'X'
// then 1 //Overdue
// when _REReminderRule._REReminderDate.REReminderDate >= $session.system_date
// and _REReminderRule._REReminderDate.REReminderDate <= DATS_ADD_DAYS(cast ($session.system_date as dats),7,'UNCHANGED')
// and _REReminderRule._REReminderDate.REReminderIsDone <> 'X'
// then 2 //Due in the next 7 days
// else 3 //On Track or already done
// end
// end ) as REOpenRemindersCriticality,
_REContractType,
_REPartnerAssgmt,
_REContractStat
// _REContractConditionChart
}
//group by
// InternalRealEstateNumber,
// RealEstateContract,
// CompanyCode,
// REContractType,
// REAuthorizationGroup,
// _REContractType.REContractCategory,
// REStatusObject,
// _REContractStat.REContractStatus
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_RECONTRACT",
"I_RECONTRACTTYPE"
],
"ASSOCIATED":
[
"I_RECONTRACTSTAT",
"I_RECONTRACTTYPE",
"I_REPARTNERASSGMT"
],
"BASE":
[
"I_RECONTRACT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload