@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@AccessControl.personalData.blocking: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@EndUserText.label: 'Notification Task Time Stamps'
@ObjectModel: {
usageType: {
dataClass: #TRANSACTIONAL,
sizeCategory: #L,
serviceQuality: #A }
}
define view entity I_NotifTaskTimeStamps
with parameters
P_QltyTimeStampPrepOptn: vdm_qltytimestampprepoptn // Conversion Option 0 = UTC Time Stamps will be create all time; 1 = UTC Time Stamps will only be created if a converion is necessary
as select from I_NotificationTask
left outer join I_QltyMgmtSystAndUsrTmeZn as _QltyMgmtSystAndUsrTmeZn //left outer join instead of inner join due to performance reasons
on _QltyMgmtSystAndUsrTmeZn.SAPClient = $session.client
{
//=== Key Fields
key I_NotificationTask.Notification,
key I_NotificationTask.NotificationTask,
//=== System and User Time Zone
_QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone,
_QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone,
//=== Planned End Date, Time and Time Stamp in UTC
I_NotificationTask.NotifTaskPlannedEndDate,
I_NotificationTask.NotifTaskPlannedEndTime,
case $parameters.P_QltyTimeStampPrepOptn
when '1' //UTC Time Stamps will only be created if a converion is necessary
then case when( I_NotificationTask.NotifTaskPlannedEndDate <> '00000000'
and ( (I_NotificationTask.NotifTaskTimeZone <> '' and I_NotificationTask.NotifTaskTimeZone <> _QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone)
or (I_NotificationTask.NotifTaskTimeZone = '' and _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone <> _QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone )))
then case when(I_NotificationTask.NotifTaskTimeZone = '')
then dats_tims_to_tstmp(I_NotificationTask.NotifTaskPlannedEndDate, I_NotificationTask.NotifTaskPlannedEndTime, _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone, $session.client, 'INITIAL')
else dats_tims_to_tstmp(I_NotificationTask.NotifTaskPlannedEndDate, I_NotificationTask.NotifTaskPlannedEndTime, I_NotificationTask.NotifTaskTimeZone, $session.client, 'INITIAL')
end
else 0
end
else //UTC Time Stamps will be create all time
case when(I_NotificationTask.NotifTaskPlannedEndDate <> '00000000')
then case when(I_NotificationTask.NotifTaskTimeZone = '')
then dats_tims_to_tstmp(I_NotificationTask.NotifTaskPlannedEndDate, I_NotificationTask.NotifTaskPlannedEndTime, _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone, $session.client, 'INITIAL')
else dats_tims_to_tstmp(I_NotificationTask.NotifTaskPlannedEndDate, I_NotificationTask.NotifTaskPlannedEndTime, I_NotificationTask.NotifTaskTimeZone, $session.client, 'INITIAL')
end
else 0
end
end as NotifTaskPlndEndDateTimeUTC,
//=== Completion End Date, Time and Time Stamp in UTC
I_NotificationTask.NotifTaskCompletionDate,
I_NotificationTask.NotifTaskCompletionTime,
case $parameters.P_QltyTimeStampPrepOptn
when '1' //UTC Time Stamps will only be created if a converion is necessary
then case when( I_NotificationTask.NotifTaskCompletionDate <> '00000000'
and ( (I_NotificationTask.NotifTaskTimeZone <> '' and I_NotificationTask.NotifTaskTimeZone <> _QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone)
or (I_NotificationTask.NotifTaskTimeZone = '' and _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone <> _QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone )))
then case when(I_NotificationTask.NotifTaskTimeZone = '')
then dats_tims_to_tstmp(I_NotificationTask.NotifTaskCompletionDate, I_NotificationTask.NotifTaskCompletionTime, _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone, $session.client, 'INITIAL')
else dats_tims_to_tstmp(I_NotificationTask.NotifTaskCompletionDate, I_NotificationTask.NotifTaskCompletionTime, I_NotificationTask.NotifTaskTimeZone, $session.client, 'INITIAL')
end
else 0
end
else //UTC Time Stamps will be create all time
case when(I_NotificationTask.NotifTaskCompletionDate <> '00000000')
then case when(I_NotificationTask.NotifTaskTimeZone = '')
then dats_tims_to_tstmp(I_NotificationTask.NotifTaskCompletionDate, I_NotificationTask.NotifTaskCompletionTime, _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone, $session.client, 'INITIAL')
else dats_tims_to_tstmp(I_NotificationTask.NotifTaskCompletionDate, I_NotificationTask.NotifTaskCompletionTime, I_NotificationTask.NotifTaskTimeZone, $session.client, 'INITIAL')
end
else 0
end
end as NotifTaskCompletionDateTimeUTC,
//=== Resubmission Date, Time and Time Stamp in UTC
I_NotificationTask.NotifTaskResubmissionDate,
I_NotificationTask.NotifTaskResubmissionTime,
case $parameters.P_QltyTimeStampPrepOptn
when '1' //UTC Time Stamps will only be created if a converion is necessary
then case when( I_NotificationTask.NotifTaskResubmissionDate <> '00000000'
and ( (I_NotificationTask.NotifTaskTimeZone <> '' and I_NotificationTask.NotifTaskTimeZone <> _QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone)
or (I_NotificationTask.NotifTaskTimeZone = '' and _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone <> _QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone )))
then case when(I_NotificationTask.NotifTaskTimeZone = '')
then dats_tims_to_tstmp(I_NotificationTask.NotifTaskResubmissionDate, I_NotificationTask.NotifTaskResubmissionTime, _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone, $session.client, 'INITIAL')
else dats_tims_to_tstmp(I_NotificationTask.NotifTaskResubmissionDate, I_NotificationTask.NotifTaskResubmissionTime, I_NotificationTask.NotifTaskTimeZone, $session.client, 'INITIAL')
end
else 0
end
else //UTC Time Stamps will be create all time
case when(I_NotificationTask.NotifTaskResubmissionDate <> '00000000')
then case when(I_NotificationTask.NotifTaskTimeZone = '')
then dats_tims_to_tstmp(I_NotificationTask.NotifTaskResubmissionDate, I_NotificationTask.NotifTaskResubmissionTime, _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone, $session.client, 'INITIAL')
else dats_tims_to_tstmp(I_NotificationTask.NotifTaskResubmissionDate, I_NotificationTask.NotifTaskResubmissionTime, I_NotificationTask.NotifTaskTimeZone, $session.client, 'INITIAL')
end
else 0
end
end as NotifTaskResubmsnDateTimeUTC,
//=== Creation Date, Time and Time Stamp in UTC
I_NotificationTask.CreationDate,
I_NotificationTask.CreationTime,
case $parameters.P_QltyTimeStampPrepOptn
when '1' //UTC Time Stamps will only be created if a converion is necessary
then case when( I_NotificationTask.CreationDate <> '00000000'
and ( (I_NotificationTask.NotifTaskTimeZone <> '' and I_NotificationTask.NotifTaskTimeZone <> _QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone)
or (I_NotificationTask.NotifTaskTimeZone = '' and _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone <> _QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone )))
then case when(I_NotificationTask.NotifTaskTimeZone = '')
then dats_tims_to_tstmp(I_NotificationTask.CreationDate, I_NotificationTask.CreationTime, _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone, $session.client, 'INITIAL')
else dats_tims_to_tstmp(I_NotificationTask.CreationDate, I_NotificationTask.CreationTime, I_NotificationTask.NotifTaskTimeZone, $session.client, 'INITIAL')
end
else 0
end
else //UTC Time Stamps will be create all time
case when(I_NotificationTask.CreationDate <> '00000000')
then case when(I_NotificationTask.NotifTaskTimeZone = '')
then dats_tims_to_tstmp(I_NotificationTask.CreationDate, I_NotificationTask.CreationTime, _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone, $session.client, 'INITIAL')
else dats_tims_to_tstmp(I_NotificationTask.CreationDate, I_NotificationTask.CreationTime, I_NotificationTask.NotifTaskTimeZone, $session.client, 'INITIAL')
end
else 0
end
end as NotifTaskCreationDateTimeUTC,
//=== Last Change Date, Time and Time Stamp in UTC
I_NotificationTask.LastChangeDate,
I_NotificationTask.LastChangeTime,
case $parameters.P_QltyTimeStampPrepOptn
when '1' //UTC Time Stamps will only be created if a converion is necessary
then case when( I_NotificationTask.LastChangeDate <> '00000000'
and ( (I_NotificationTask.NotifTaskTimeZone <> '' and I_NotificationTask.NotifTaskTimeZone <> _QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone)
or (I_NotificationTask.NotifTaskTimeZone = '' and _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone <> _QltyMgmtSystAndUsrTmeZn.QltyMgmtUserTimeZone )))
then case when(I_NotificationTask.NotifTaskTimeZone = '')
then dats_tims_to_tstmp(I_NotificationTask.LastChangeDate, I_NotificationTask.LastChangeTime, _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone, $session.client, 'INITIAL')
else dats_tims_to_tstmp(I_NotificationTask.LastChangeDate, I_NotificationTask.LastChangeTime, I_NotificationTask.NotifTaskTimeZone, $session.client, 'INITIAL')
end
else 0
end
else //UTC Time Stamps will be create all time
case when(I_NotificationTask.LastChangeDate <> '00000000')
then case when(I_NotificationTask.NotifTaskTimeZone = '')
then dats_tims_to_tstmp(I_NotificationTask.LastChangeDate, I_NotificationTask.LastChangeTime, _QltyMgmtSystAndUsrTmeZn.QltyMgmtSystemTimeZone, $session.client, 'INITIAL')
else dats_tims_to_tstmp(I_NotificationTask.LastChangeDate, I_NotificationTask.LastChangeTime, I_NotificationTask.NotifTaskTimeZone, $session.client, 'INITIAL')
end
else 0
end
end as NotifTaskLastChangeDateTimeUTC
}