SAP Function SAP_WAPI_COUNT_WORKITEMS - Workflow Interfaces: Number of Work Items for User

Parameter Reference Type Length Default Optional Text
DETAIL_LEVEL SWR_STRUCT-DETAILLV N 1 '0' X Detail Level (0, 1, 2)
LANGUAGE SYLANGU C 1 SY-LANGU X SAP System, Current Language
REFRESH_INTERVAL SWR_STRUCT-REFRESH N 8 600 X Refresh Interval (in Seconds)
USER SYST-UNAME C 12 SY-UNAME X User

Parameter Reference Type Length Text
RETURN_CODE SYST-SUBRC I 4 Return Code (0, 1, 2, 3, 999)
WI_COUNT SWR_WIPTS-WI_COUNT I 4 Number of Work Items in Inbox

Parameter Reference Length Optional Text
MESSAGE_LINES SWR_MESSAG 274 X Message Lines
MESSAGE_STRUCT SWR_MSTRUC 224 X Message Structure
TASK_FILTER_TABLE SWR_TSKFLT 14 X Filter Table
WORKITEMS_PER_TASK SWR_WIPTS 20 X Number of Work Items per Task

Functionality
The function module determines whether there are work items in theBusiness Workplace of the specified user, and if so how many. Thefunction module takes active substitution into account.
To determine the number of work items, the function module calls theuser's worklist. If you have already called the user's worklist by analternative means, for example, by using SAP_WAPI_CREATE_WORKLIST, SAPrecommends that you determine the number of work items from the worklistinstead for performance reasons.
INCLUDE WF_FB_RETURN_CODE OBJECT DOKU ID TX

Value range
0,,Call successful; the work item is displayed
1,,User not available
2,,Incorrect level of detail
3,,Missing authorization
999,,An unknown error has occurred

Description
If the parameter DETAIL_LEVEL is set to 1 or 2, this exportparameter contains the total number of work items in the BusinessWorkplace. If DETAIL_LEVEL = 1 the only practical distinction isbetween WI_COUNT = 0 and WI_COUNT > 0.

Description
This import parameter is used to control the level of detail the resultis to have. The parameter has a considerable effect on the performanceof the function module.

Value range
0,,The check is only to establish whether there is at least one workitem (parameter WI_COUNT = 0 or WI_COUNT > 0). It doesnot tell you how many work items are actually in the BusinessWorkplace. Nor does it establish how many work items there are for atask (not even for the established work items).
1,,The overall number of work items in the Business Workplace isestablished. How many work items there are for a task is notestablished.
2,,Both the overall number of work items and the number of work itemsper task are established.

Description
You use this parameter to specify the minimum time duration (inseconds) between worklist read operations for each call. The parameterhas a considerable influence on the performance of the function module.
Example:
The value 0 means that read operations take place constantly. The value10 means that at least 10 seconds are to have passed since the lastread operation.

Default
600

Description
This import parameter passes the user name of the user in whoseworklist the number of work items is determined.

Default
SY-UNAME
INCLUDE WF_FB_MESSAGE_LINES OBJECT DOKU ID TX
INCLUDE WF_FB_MESSAGE_STRUCTURE OBJECT DOKU ID TX

Description
You can use this table parameter to pass task IDs of tasks for whichthe number of work items is to be determined. Work items for othertasks are not taken into consideration and are regarded asnon-existent.
If the table parameter is not passed, all work items are taken intoconsideration. If an empty table parameter is passed, no work items aretaken into consideration

Description
If the function module is called with a DETAIL_LEVEL of 2, thistable parameter contains, after execution of the function module, allthe task IDs for which work items were found, as well as the number ofwork items found.