- ZI_SWAgent
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Workflow Agent'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_SWAgent
as select from swwwihead as _Head
association [1..1] to swwwipagent as _Agent on $projection.wi_id = _Agent.wi_id
association [1..1] to swwuserwi as _CurrentAgent on $projection.wi_id = _CurrentAgent.wi_id
and _CurrentAgent.no_sel <> 'X'
association [0..1] to I_WorkflowTaskResult as _Result on $projection.wi_id = _Result.WorkflowTaskInternalID
{
key wi_id,
key
case wi_stat
when 'COMPLETED' then _Agent.user_id
when 'CANCELLED' then _Agent.user_id
else _CurrentAgent.user_id end as user_id,
wi_stat,
wi_aagent,
top_wi_id,
top_task,
_Result.WorkflowTaskResultNature,
_Result.WorkflowTaskResult,
_Result.WorkflowTaskResultComment,
case wi_stat when 'COMPLETED' then
case _Agent.user_id when wi_aagent then 'X'
else ' ' end
else ' ' end as lastAgentIndicator
}
where
wi_type = 'W'
2. ZI_SWAgentFiltered
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Workflow Agent'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_SWAgentFiltered
as select from ZI_SWAgent
{
key wi_id,
key user_id,
wi_stat,
wi_aagent,
top_wi_id,
top_task,
WorkflowTaskResultNature,
WorkflowTaskResult,
WorkflowTaskResultComment,
lastAgentIndicator
}
where
wi_stat <> 'COMPLETED'
or lastAgentIndicator = 'X'