SAP SWW_WI_EXECUTE_NEW Function Module for
SWW_WI_EXECUTE_NEW is a standard sww wi execute new SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 execute new FM, simply by entering the name SWW_WI_EXECUTE_NEW into the relevant SAP transaction such as SE37 or SE38.
Function Group: SWWA
Program Name: SAPLSWWA
Main Program: SAPLSWWA
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SWW_WI_EXECUTE_NEW 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_EXECUTE_NEW'".
EXPORTING
WI_ID = "Work Item ID
* WI_EXECUTION_TYPE = ' ' "Execution Type of WI (eg. via Web, SAPforms)
* WI_HEADER = "
* DO_COMMIT = 'X' "Indicator for Control of Commit Logic
* MULTI_EXECUTION = ' ' "Indicator Identifying Multi-Call
* DEBUG_FLAG = ' ' "Indicator Showing Whether Feedback to WFM Synchronous
* NO_CALLBACK_ON_COMPLETION = ' ' "Indicator Showing Whether Callback Called Upon Completion
* EXECUTED_BY_USER = SY-UNAME "User Who Executed the WI
* EXECUTED_BY_ADDRESS = ' ' "Address That Executed the WI
* CALLED_IN_BACKGROUND = ' ' "Indicator Showing Whether FM Called In Background
* PRECONDITIONS_CHECKED = ' ' "Indicator for Control of Status and Type Checks
IMPORTING
RETURN = "Return Codes from Object Method
WI_RESULT = "Return Codes from WIM
SWF_RETURN = "Return Codes from Object Method
EX_WIHEADER = "
CHANGING
* WI_CONTAINER_HANDLE = "Container - Implementation of a 'Collection'
TABLES
* WI_CONTAINER = "Work Item Container
EXCEPTIONS
EXECUTION_FAILED = 1 INVALID_STATUS = 2 INVALID_TYPE = 3
IMPORTING Parameters details for SWW_WI_EXECUTE_NEW
WI_ID - Work Item ID
Data type: SWWWIHEAD-WI_IDOptional: No
Call by Reference: No ( called with pass by value option)
WI_EXECUTION_TYPE - Execution Type of WI (eg. via Web, SAPforms)
Data type: RHWF_METH-CLASSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
WI_HEADER -
Data type: SWWWIHEADOptional: Yes
Call by Reference: No ( called with pass by value option)
DO_COMMIT - Indicator for Control of Commit Logic
Data type: SWWCOMMIT-COMMITFLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
MULTI_EXECUTION - Indicator Identifying Multi-Call
Data type: SWWCOMMIT-MULTIFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DEBUG_FLAG - Indicator Showing Whether Feedback to WFM Synchronous
Data type: SWWCOMMIT-SYNCFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_CALLBACK_ON_COMPLETION - Indicator Showing Whether Callback Called Upon Completion
Data type: SWWCOMMIT-COMPFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXECUTED_BY_USER - User Who Executed the WI
Data type: SY-UNAMEDefault: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXECUTED_BY_ADDRESS - Address That Executed the WI
Data type: SWWADDRKEYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CALLED_IN_BACKGROUND - Indicator Showing Whether FM Called In Background
Data type: SWWCOMMIT-DIALOGFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PRECONDITIONS_CHECKED - Indicator for Control of Status and Type Checks
Data type: SWWCOMMIT-CHECKFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SWW_WI_EXECUTE_NEW
RETURN - Return Codes from Object Method
Data type: SWOTRETURNOptional: No
Call by Reference: No ( called with pass by value option)
WI_RESULT - Return Codes from WIM
Data type: SWWWIRESOptional: No
Call by Reference: No ( called with pass by value option)
SWF_RETURN - Return Codes from Object Method
Data type: SWF_RETURNOptional: No
Call by Reference: No ( called with pass by value option)
EX_WIHEADER -
Data type: SWWWIHEADOptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for SWW_WI_EXECUTE_NEW
WI_CONTAINER_HANDLE - Container - Implementation of a 'Collection'
Data type: IF_SWF_CNT_CONTAINEROptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SWW_WI_EXECUTE_NEW
WI_CONTAINER - Work Item Container
Data type: SWCONTOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
EXECUTION_FAILED - Execution of work item failed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_STATUS - Execution Not Allowed in Current Status
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_TYPE - Method Not Allowed for this Type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SWW_WI_EXECUTE_NEW 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: | ||||
| lv_wi_id | TYPE SWWWIHEAD-WI_ID, " | |||
| lv_return | TYPE SWOTRETURN, " | |||
| lt_wi_container | TYPE STANDARD TABLE OF SWCONT, " | |||
| lv_execution_failed | TYPE SWCONT, " | |||
| lv_wi_container_handle | TYPE IF_SWF_CNT_CONTAINER, " | |||
| lv_wi_execution_type | TYPE RHWF_METH-CLASS, " SPACE | |||
| lv_wi_header | TYPE SWWWIHEAD, " | |||
| lv_do_commit | TYPE SWWCOMMIT-COMMITFLAG, " 'X' | |||
| lv_wi_result | TYPE SWWWIRES, " | |||
| lv_invalid_status | TYPE SWWWIRES, " | |||
| lv_swf_return | TYPE SWF_RETURN, " | |||
| lv_invalid_type | TYPE SWF_RETURN, " | |||
| lv_multi_execution | TYPE SWWCOMMIT-MULTIFLAG, " SPACE | |||
| lv_debug_flag | TYPE SWWCOMMIT-SYNCFLAG, " SPACE | |||
| lv_ex_wiheader | TYPE SWWWIHEAD, " | |||
| lv_no_callback_on_completion | TYPE SWWCOMMIT-COMPFLAG, " SPACE | |||
| lv_executed_by_user | TYPE SY-UNAME, " SY-UNAME | |||
| lv_executed_by_address | TYPE SWWADDRKEY, " SPACE | |||
| lv_called_in_background | TYPE SWWCOMMIT-DIALOGFLAG, " SPACE | |||
| lv_preconditions_checked | TYPE SWWCOMMIT-CHECKFLAG. " SPACE |
|   CALL FUNCTION 'SWW_WI_EXECUTE_NEW' " |
| EXPORTING | ||
| WI_ID | = lv_wi_id | |
| WI_EXECUTION_TYPE | = lv_wi_execution_type | |
| WI_HEADER | = lv_wi_header | |
| DO_COMMIT | = lv_do_commit | |
| MULTI_EXECUTION | = lv_multi_execution | |
| DEBUG_FLAG | = lv_debug_flag | |
| NO_CALLBACK_ON_COMPLETION | = lv_no_callback_on_completion | |
| EXECUTED_BY_USER | = lv_executed_by_user | |
| EXECUTED_BY_ADDRESS | = lv_executed_by_address | |
| CALLED_IN_BACKGROUND | = lv_called_in_background | |
| PRECONDITIONS_CHECKED | = lv_preconditions_checked | |
| IMPORTING | ||
| RETURN | = lv_return | |
| WI_RESULT | = lv_wi_result | |
| SWF_RETURN | = lv_swf_return | |
| EX_WIHEADER | = lv_ex_wiheader | |
| CHANGING | ||
| WI_CONTAINER_HANDLE | = lv_wi_container_handle | |
| TABLES | ||
| WI_CONTAINER | = lt_wi_container | |
| EXCEPTIONS | ||
| EXECUTION_FAILED = 1 | ||
| INVALID_STATUS = 2 | ||
| INVALID_TYPE = 3 | ||
| . " SWW_WI_EXECUTE_NEW | ||
ABAP code using 7.40 inline data declarations to call FM SWW_WI_EXECUTE_NEW
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_ID FROM SWWWIHEAD INTO @DATA(ld_wi_id). | ||||
| "SELECT single CLASS FROM RHWF_METH INTO @DATA(ld_wi_execution_type). | ||||
| DATA(ld_wi_execution_type) | = ' '. | |||
| "SELECT single COMMITFLAG FROM SWWCOMMIT INTO @DATA(ld_do_commit). | ||||
| DATA(ld_do_commit) | = 'X'. | |||
| "SELECT single MULTIFLAG FROM SWWCOMMIT INTO @DATA(ld_multi_execution). | ||||
| DATA(ld_multi_execution) | = ' '. | |||
| "SELECT single SYNCFLAG FROM SWWCOMMIT INTO @DATA(ld_debug_flag). | ||||
| DATA(ld_debug_flag) | = ' '. | |||
| "SELECT single COMPFLAG FROM SWWCOMMIT INTO @DATA(ld_no_callback_on_completion). | ||||
| DATA(ld_no_callback_on_completion) | = ' '. | |||
| "SELECT single UNAME FROM SY INTO @DATA(ld_executed_by_user). | ||||
| DATA(ld_executed_by_user) | = SY-UNAME. | |||
| DATA(ld_executed_by_address) | = ' '. | |||
| "SELECT single DIALOGFLAG FROM SWWCOMMIT INTO @DATA(ld_called_in_background). | ||||
| DATA(ld_called_in_background) | = ' '. | |||
| "SELECT single CHECKFLAG FROM SWWCOMMIT INTO @DATA(ld_preconditions_checked). | ||||
| DATA(ld_preconditions_checked) | = ' '. | |||
Search for further information about these or an SAP related objects