@AbapCatalog : {
sqlViewName: 'IWFTASKRECIPIENT',
buffering.type: #NONE
}
@EndUserText.label: 'Work item recipients'
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType : {
dataClass: #CUSTOMIZING,
serviceQuality: #C,
sizeCategory: #L
}
define view I_WorkflowTaskRecipient
// Select all tasks in progress or ready and the recipient for each task
as select from swwwihead
inner join swwuserwi on swwwihead.wi_id = swwuserwi.wi_id
{
key swwwihead.wi_id as WorkflowTaskInternalID,
key cast( swwuserwi.user_id as sww_recipient ) as WorkflowTaskRecipient,
key cast( ' ' as sww_recipient ) as WorkflowTaskSubstitutedUser,
swwuserwi.forward as WorkflowTaskIsForwarded,
case swwuserwi.no_sel
when 'X' then cast( ' ' as sww_inbox )
else cast ( 'X' as sww_inbox )
end as WorkflowTaskIsVisibleInInbox
}
where
swwwihead.wi_type = 'W'
and(
swwwihead.wi_stat = 'READY'
or swwwihead.wi_stat = 'SELECTED'
or swwwihead.wi_stat = 'STARTED'
or swwwihead.wi_stat = 'COMMITTED'
)
union
// Select all tasks in progress or ready and all valid (active) substitutes for the recipient of each task
// Restriction: The subsitute profile (REPR in HRUS_D2) is not taken into account,
// meaning all selected substitues may not be valid (bacause of the confidentiality level of the task)
select from swwwihead
inner join swwuserwi on swwwihead.wi_id = swwuserwi.wi_id
right outer join hrus_d2 on swwuserwi.user_id = hrus_d2.us_name
{
key swwwihead.wi_id as WorkflowTaskInternalID,
key cast( hrus_d2.rep_name as sww_recipient ) as WorkflowTaskRecipient,
key cast( hrus_d2.us_name as sww_recipient ) as WorkflowTaskSubstitutedUser,
swwuserwi.forward as WorkflowTaskIsForwarded,
case swwuserwi.no_sel
when 'X' then cast( ' ' as sww_inbox )
else cast ( 'X' as sww_inbox )
end as WorkflowTaskIsVisibleInInbox
}
where
swwwihead.wi_type = 'W'
and(
swwwihead.wi_stat = 'READY'
or swwwihead.wi_stat = 'SELECTED'
or swwwihead.wi_stat = 'STARTED'
or swwwihead.wi_stat = 'COMMITTED'
)
and hrus_d2.active = 'X'
and hrus_d2.begda <= tstmp_to_dats(
tstmp_current_utctimestamp(), abap_system_timezone(
$session.client, 'NULL'
), $session.client, 'NULL'
)
and hrus_d2.endda >= tstmp_to_dats(
tstmp_current_utctimestamp(), abap_system_timezone(
$session.client, 'NULL'
), $session.client, 'NULL'
)
union
// Select all tasks in progress or ready and all valid (active) passive substitutes for the recipient of each task
// Restriction: The subsitute profile (REPR in HRUS_D2, and TWFS) is not taken into account,
// meaning all selected substitues may not be valid (bacause of the confidentiality level of the task)
select from swwwihead
inner join swwuserwi on swwwihead.wi_id = swwuserwi.wi_id
right outer join hrus_d2 on swwuserwi.user_id = hrus_d2.us_name
right outer join twfs on hrus_d2.us_name = twfs.objid
{
key swwwihead.wi_id as WorkflowTaskInternalID,
key cast( twfs.uname as sww_recipient ) as WorkflowTaskRecipient,
key cast( twfs.objid as sww_recipient ) as WorkflowTaskSubstitutedUser,
swwuserwi.forward as WorkflowTaskIsForwarded,
case swwuserwi.no_sel
when 'X' then cast( ' ' as sww_inbox )
else cast ( 'X' as sww_inbox )
end as WorkflowTaskIsVisibleInInbox
}
where
swwwihead.wi_type = 'W'
and(
swwwihead.wi_stat = 'READY'
or swwwihead.wi_stat = 'SELECTED'
or swwwihead.wi_stat = 'STARTED'
or swwwihead.wi_stat = 'COMMITTED'
)
and hrus_d2.active = ''
and hrus_d2.begda <= tstmp_to_dats(
tstmp_current_utctimestamp(), abap_system_timezone(
$session.client, 'NULL'
), $session.client, 'NULL'
)
and hrus_d2.endda >= tstmp_to_dats(
tstmp_current_utctimestamp(), abap_system_timezone(
$session.client, 'NULL'
), $session.client, 'NULL'
)