SAP SWW_WI_FORWARD Function Module for Forward Work Item (All Types)









SWW_WI_FORWARD is a standard sww wi forward SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Forward Work Item (All Types) processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for sww wi forward FM, simply by entering the name SWW_WI_FORWARD into the relevant SAP transaction such as SE37 or SE38.

Function Group: SWWA
Program Name: SAPLSWWA
Main Program: SAPLSWWA
Appliation area:
Release date: 02-Jul-1998
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function SWW_WI_FORWARD pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'SWW_WI_FORWARD'"Forward Work Item (All Types)
EXPORTING
* CURRENT_USER = SY-UNAME "User Forwarding Work Item
WI_ID = "Work Item ID
* DO_COMMIT = 'X' "Indicator for Control of Commit Logic
* PRECONDITIONS_CHECKED = ' ' "Indicator for Control of Status Checks and Type Checks
* IM_FUNCNAME = "Function Name that Is Logged
* ADMIN_MODE_NO_X_CHECK = ' ' "Admin Mode: No Execution Check of WI

IMPORTING
NEW_STATUS = "New Status of Work Item

TABLES
NEW_AGENTS = "Agents Who Receive Forwarding

EXCEPTIONS
INVALID_STATUS = 1 UPDATE_FAILED = 2 INVALID_TYPE = 3
.



IMPORTING Parameters details for SWW_WI_FORWARD

CURRENT_USER - User Forwarding Work Item

Data type: SWWWIHEAD-WI_FORW_BY
Default: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

WI_ID - Work Item ID

Data type: SWWWIHEAD-WI_ID
Optional: No
Call by Reference: No ( called with pass by value option)

DO_COMMIT - Indicator for Control of Commit Logic

Data type: SWWCOMMIT-COMMITFLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

PRECONDITIONS_CHECKED - Indicator for Control of Status Checks and Type Checks

Data type: SWWCOMMIT-CHECKFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IM_FUNCNAME - Function Name that Is Logged

Data type: FUNCNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADMIN_MODE_NO_X_CHECK - Admin Mode: No Execution Check of WI

Data type: XFELD
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for SWW_WI_FORWARD

NEW_STATUS - New Status of Work Item

Data type: SWWWIHEAD-WI_STAT
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for SWW_WI_FORWARD

NEW_AGENTS - Agents Who Receive Forwarding

Data type: SWHACTOR
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

INVALID_STATUS - Forwarding Not Allowed in Current Status

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

UPDATE_FAILED - Work Item Cannot Be Updated

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INVALID_TYPE - Method Not Allowed for this Work Item Type

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for SWW_WI_FORWARD Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lt_new_agents  TYPE STANDARD TABLE OF SWHACTOR, "   
lv_new_status  TYPE SWWWIHEAD-WI_STAT, "   
lv_current_user  TYPE SWWWIHEAD-WI_FORW_BY, "   SY-UNAME
lv_invalid_status  TYPE SWWWIHEAD, "   
lv_wi_id  TYPE SWWWIHEAD-WI_ID, "   
lv_update_failed  TYPE SWWWIHEAD, "   
lv_do_commit  TYPE SWWCOMMIT-COMMITFLAG, "   'X'
lv_invalid_type  TYPE SWWCOMMIT, "   
lv_preconditions_checked  TYPE SWWCOMMIT-CHECKFLAG, "   SPACE
lv_im_funcname  TYPE FUNCNAME, "   
lv_admin_mode_no_x_check  TYPE XFELD. "   SPACE

  CALL FUNCTION 'SWW_WI_FORWARD'  "Forward Work Item (All Types)
    EXPORTING
         CURRENT_USER = lv_current_user
         WI_ID = lv_wi_id
         DO_COMMIT = lv_do_commit
         PRECONDITIONS_CHECKED = lv_preconditions_checked
         IM_FUNCNAME = lv_im_funcname
         ADMIN_MODE_NO_X_CHECK = lv_admin_mode_no_x_check
    IMPORTING
         NEW_STATUS = lv_new_status
    TABLES
         NEW_AGENTS = lt_new_agents
    EXCEPTIONS
        INVALID_STATUS = 1
        UPDATE_FAILED = 2
        INVALID_TYPE = 3
. " SWW_WI_FORWARD




ABAP code using 7.40 inline data declarations to call FM SWW_WI_FORWARD

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single WI_STAT FROM SWWWIHEAD INTO @DATA(ld_new_status).
 
"SELECT single WI_FORW_BY FROM SWWWIHEAD INTO @DATA(ld_current_user).
DATA(ld_current_user) = SY-UNAME.
 
 
"SELECT single WI_ID FROM SWWWIHEAD INTO @DATA(ld_wi_id).
 
 
"SELECT single COMMITFLAG FROM SWWCOMMIT INTO @DATA(ld_do_commit).
DATA(ld_do_commit) = 'X'.
 
 
"SELECT single CHECKFLAG FROM SWWCOMMIT INTO @DATA(ld_preconditions_checked).
DATA(ld_preconditions_checked) = ' '.
 
 
DATA(ld_admin_mode_no_x_check) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!