@AccessControl.authorizationCheck: #NOT_REQUIRED@VDM.viewType: #COMPOSITE@VDM.private: truedefineviewentity P_PPH_ReportingDate3
asselectfrom P_PPH_ReportingDate2
association [1..1] to I_ReportingPeriod as _ReportingPeriod on $projection.ReportingPeriod = _ReportingPeriod.ReportingPeriod
association [0..*] to I_ReportingPeriodText as _Text on $projection.ReportingPeriod = _Text.ReportingPeriod
{
key ReportingDate,
TodayDate,
YesterdayDate,
LastCalendarWeek,
LastCalendarMonth,
LastCalendarYear,
// set master Reporting Period
casewhen ReportingDate > TodayDate
then '00' // Future
when ReportingDate = TodayDate
then '01' // Today
when ReportingDate = YesterdayDate
then '02' // Yesterday
when CurrentWeek = ReportingWeek
and CurrentYear = ReportingYear
then '03' // Current Week
when LastCalendarWeek = ReportingWeek
and CurrentYear = ReportingYear
then '04' // Last Week
when CurrentMonth = ReportingMonth
and CurrentYear = ReportingYear
then '05' // Current Month
when LastCalendarMonth = ReportingMonth
and CurrentYear = ReportingYear
then '06' // Last Month
when CurrentQuarter = ReportingQuarter
and CurrentYear = ReportingYear
then '09' // Current Quarter
when LastCalendarQuarter = ReportingQuarter
and CurrentYear = ReportingYear
then '10' // Last Quarter
when CurrentYear = ReportingYear
then '07' // Current Year
when LastCalendarYear = ReportingYear
then '08' // Last Year
else '13' // Older
endas ReportingPeriod,
// Reporting Date items (external usage)
ReportingDateWeekDay,
ReportingDateWeek,
ReportingDateMonth,
ReportingDateYear,
// Associations
_ReportingDate,
_ReportingPeriod,
_CurrentDate,
_YesterdayDate,
_Text
};
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"P_PPH_REPORTINGDATE2"
],
"ASSOCIATED":
[
"I_CALENDARDATE",
"I_REPORTINGPERIOD",
"I_REPORTINGPERIODTEXT"
],
"BASE":
[
"P_PPH_REPORTINGDATE2"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/