Application Development and Automation Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only
ansonabraham
Active Participant
1,719 Views
0 Comments
0 Likes

This article describes the use of function module ‘SAP_WAPI_SET_WORKITEM_COMPLETD’ in processing the workflow messages. This function module will process the workflow item and set the status as completed.

Calling the function module SAP_WAPI_SET_WORKITEM_COMPLETD

   CALL FUNCTION 'SAP_WAPI_SET_WORKITEM_COMPLETD'

       EXPORTING

         workitem_id    = v_workflow_id

         actual_agent   = v_agent

         language         = v_language

        IMPORTING

 

         new_status    =  x_status

         return_code    = v_returncode

        TABLES

          message_struct = t_messages.

Parameters used

 

  • v_workflow_id – workflow item id
  • v_agent – User’s logon name (sy-uname)
  • v_language – System language (sy-langu)
  • x_status – This structure will have the work
    item status.
  • v_returncode – Return code (sy-subrc, it will be 0, 1 or 999)

          0 – Call successful

          1 – Operation is not executable

          999 – An unknown error has occurred

  • t_messages – Returned messages. This internal table will have the following fields.

          MSGID - Message Class

          MSGTY - Message Type

          MSGNO - Message Number

          MSGV1 – Message variable

          MSGV2 - Message variable

          MSGV3 - Message variable

          MSGV4 - Message variable

Workflow id values are present in standard table SWWWIHEAD.