SAP Function Modules

SAP_WAPI_FORWARD_WORKITEM SAP Function module - Workflow Interfaces: Forward Work Item







SAP_WAPI_FORWARD_WORKITEM is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name SAP_WAPI_FORWARD_WORKITEM into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SWRC
Released Date: 05.08.1999
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM SAP_WAPI_FORWARD_WORKITEM - SAP WAPI FORWARD WORKITEM





CALL FUNCTION 'SAP_WAPI_FORWARD_WORKITEM' "Workflow Interfaces: Forward Work Item
  EXPORTING
    workitem_id =               " swr_struct-workitemid  Work Item ID
*   user_id =                   " sy-uname      User ID
*   language = SY-LANGU         " sylangu       SAP System, Current Language
*   do_commit = 'X'             " xfeld         Execute Commit
*   current_user = SY-UNAME     " syuname       Forwarding User
  IMPORTING
    return_code =               " sy-subrc      Return Code (0 - 2, 999)
    new_status =                " swr_wistat    Workflow Interfaces: Work Item Status
* TABLES
*   message_lines =             " swr_messag    Message Lines
*   message_struct =            " swr_mstruc    Message Structure
*   user_ids =                  " swragent      User
    .  "  SAP_WAPI_FORWARD_WORKITEM

ABAP code example for Function Module SAP_WAPI_FORWARD_WORKITEM





The ABAP code below is a full code listing to execute function module SAP_WAPI_FORWARD_WORKITEM including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_return_code  TYPE SY-SUBRC ,
ld_new_status  TYPE SWR_WISTAT ,
it_message_lines  TYPE STANDARD TABLE OF SWR_MESSAG,"TABLES PARAM
wa_message_lines  LIKE LINE OF it_message_lines ,
it_message_struct  TYPE STANDARD TABLE OF SWR_MSTRUC,"TABLES PARAM
wa_message_struct  LIKE LINE OF it_message_struct ,
it_user_ids  TYPE STANDARD TABLE OF SWRAGENT,"TABLES PARAM
wa_user_ids  LIKE LINE OF it_user_ids .


DATA(ld_workitem_id) = Check type of data required
DATA(ld_user_id) = 'some text here'.
DATA(ld_language) = 'Check type of data required'.
DATA(ld_do_commit) = 'Check type of data required'.
DATA(ld_current_user) = 'some text here'.

"populate fields of struture and append to itab
append wa_message_lines to it_message_lines.

"populate fields of struture and append to itab
append wa_message_struct to it_message_struct.

"populate fields of struture and append to itab
append wa_user_ids to it_user_ids. . CALL FUNCTION 'SAP_WAPI_FORWARD_WORKITEM' EXPORTING workitem_id = ld_workitem_id * user_id = ld_user_id * language = ld_language * do_commit = ld_do_commit * current_user = ld_current_user IMPORTING return_code = ld_return_code new_status = ld_new_status * TABLES * message_lines = it_message_lines * message_struct = it_message_struct * user_ids = it_user_ids . " SAP_WAPI_FORWARD_WORKITEM
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_return_code  TYPE SY-SUBRC ,
ld_workitem_id  TYPE SWR_STRUCT-WORKITEMID ,
it_message_lines  TYPE STANDARD TABLE OF SWR_MESSAG ,
wa_message_lines  LIKE LINE OF it_message_lines,
ld_new_status  TYPE SWR_WISTAT ,
ld_user_id  TYPE SY-UNAME ,
it_message_struct  TYPE STANDARD TABLE OF SWR_MSTRUC ,
wa_message_struct  LIKE LINE OF it_message_struct,
ld_language  TYPE SYLANGU ,
it_user_ids  TYPE STANDARD TABLE OF SWRAGENT ,
wa_user_ids  LIKE LINE OF it_user_ids,
ld_do_commit  TYPE XFELD ,
ld_current_user  TYPE SYUNAME .


ld_workitem_id = Check type of data required

"populate fields of struture and append to itab
append wa_message_lines to it_message_lines.
ld_user_id = 'some text here'.

"populate fields of struture and append to itab
append wa_message_struct to it_message_struct.
ld_language = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_user_ids to it_user_ids.
ld_do_commit = 'Check type of data required'.
ld_current_user = 'some text here'.

SAP Documentation for FM SAP_WAPI_FORWARD_WORKITEM


A work item is forwarded.
The parameters RETURN_CODE and MESSAGE_LINES show whether the call was ...See here for full SAP fm documentation






Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name SAP_WAPI_FORWARD_WORKITEM or its description.