SAP Function SAP_WAPI_EXECUTE_WORKITEM - Workflow Interfaces: Execute Work Item

Parameter Reference Type Length Default Optional Text
LANGUAGE SYLANGU C 1 SY-LANGU X SAP System, Current Language
WORKITEM_ID SWR_STRUCT-WORKITEMID N 12 Work Item ID

Parameter Reference Type Length Text
NEW_STATUS SWR_WISTAT u 32 New Status After Execution
RETURN_CODE SYST-SUBRC I 4 Return Code (0, 1, 2, 999)

Parameter Reference Length Optional Text
MESSAGE_LINES SWR_MESSAG 274 X Message Lines
MESSAGE_STRUCT SWR_MSTRUC 224 X Message Structure

Functionality
A work item is executed using SAPGUI, which necessitates a (remote)function call with dialog.
If the call is successful (RETURN_CODE = 0), the parameter NEW_STATUScontains the work item status after execution. Otherwise, the parameterNEW_STATUS has no value. NEW_STATUS contains the technical name and thelanguage-dependent description of the new status.
The parameters RETURN_CODE and MESSAGE_LINES show whether the call wassuccessful. RETURN_CODE has a numeric value and MESSAGE_LINES gives atextual explanation for finer dfferentiation.
INCLUDE WF_FB_NEW_STATUS OBJECT DOKU ID TX
INCLUDE WF_LIST_OF_WI_STATUS OBJECT DOKU ID TX
INCLUDE WF_FB_RETURN_CODE OBJECT DOKU ID TX

Value range
0,,Call successful. Work item is displayed.
1,,An error occurred in execution.
2,,Work item cannot be reserved. (This must occur before execution.)
900,, System error: method must not be used in the current context
999,,An unknown error occurred.

Description
Work item identification (numerical value)
The message lines contain two fields:
- MSG_TYPE: Type of message (S: success, E: error, etc.)
- LINE: This contains a textual description of what happened. In theevent of success (RETURN_CODE = 0) this is a success message, and inthe event of failure this is further information about the errors thatoccurred.

Description
Table with fields Message ID, Message type, Message number and Messagevariables