SAP SWW_WI_CREATE_SIMPLE Function Module for
SWW_WI_CREATE_SIMPLE is a standard sww wi create simple 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 create simple FM, simply by entering the name SWW_WI_CREATE_SIMPLE into the relevant SAP transaction such as SE37 or SE38.
Function Group: SWR_DEPRECATED_RUNTIME
Program Name: SAPLSWR_DEPRECATED_RUNTIME
Main Program: SAPLSWR_DEPRECATED_RUNTIME
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SWW_WI_CREATE_SIMPLE 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_CREATE_SIMPLE'".
EXPORTING
* CREATOR = ' ' "WI Creator
* PRIORITY = SWFCO_NO_PRIO "Priority of WI
TASK = "Associated Task ID According to Task Catalog
* CALLED_IN_BACKGROUND = ' ' "Indicator Showing Whether FM Called in Background
* DEADLINE_DATA = ' ' "Deadline Monitoring Data
* NO_DEADLINE_PARAMETERS = ' ' "Indicator for Whether Deadline Data Was Passed
IMPORTING
WI_ID = "ID of WI Created
WI_HEADER = "Header Data of WI Created
CHANGING
* WI_CONTAINER_HANDLE = "Container - Implementation of a 'Collection'
TABLES
AGENTS = "Selected Agents for Work Item
* DEADLINE_AGENTS = "Agents For Latest End
* DESIRED_END_AGENTS = "Agents for Requested End
* LATEST_START_AGENTS = "Agents for Latest Start
* EXCLUDED_AGENTS = "Excluded Agents for Work Item
* NOTIFICATION_AGENTS = "Agents for End Notification
* SECONDARY_METHODS = "Object Methods To Be Called Additionally
* WI_CONTAINER = "Data Container of Work Item
EXCEPTIONS
ID_NOT_CREATED = 1 READ_FAILED = 2
IMPORTING Parameters details for SWW_WI_CREATE_SIMPLE
CREATOR - WI Creator
Data type: SWWWIHEAD-WI_CREATORDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PRIORITY - Priority of WI
Data type: SWWWIHEAD-WI_PRIODefault: SWFCO_NO_PRIO
Optional: Yes
Call by Reference: No ( called with pass by value option)
TASK - Associated Task ID According to Task Catalog
Data type: SWWWIHEAD-WI_RH_TASKOptional: No
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)
DEADLINE_DATA - Deadline Monitoring Data
Data type: SWWDEADDATDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_DEADLINE_PARAMETERS - Indicator for Whether Deadline Data Was Passed
Data type: SWWCOMMIT-DEADLCKFLGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SWW_WI_CREATE_SIMPLE
WI_ID - ID of WI Created
Data type: SWWWIHEAD-WI_IDOptional: No
Call by Reference: No ( called with pass by value option)
WI_HEADER - Header Data of WI Created
Data type: SWWWIHEADOptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for SWW_WI_CREATE_SIMPLE
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_CREATE_SIMPLE
AGENTS - Selected Agents for Work Item
Data type: SWHACTOROptional: No
Call by Reference: No ( called with pass by value option)
DEADLINE_AGENTS - Agents For Latest End
Data type: SWHACTOROptional: Yes
Call by Reference: Yes
DESIRED_END_AGENTS - Agents for Requested End
Data type: SWHACTOROptional: Yes
Call by Reference: Yes
LATEST_START_AGENTS - Agents for Latest Start
Data type: SWHACTOROptional: Yes
Call by Reference: Yes
EXCLUDED_AGENTS - Excluded Agents for Work Item
Data type: SWHACTOROptional: Yes
Call by Reference: No ( called with pass by value option)
NOTIFICATION_AGENTS - Agents for End Notification
Data type: SWHACTOROptional: Yes
Call by Reference: Yes
SECONDARY_METHODS - Object Methods To Be Called Additionally
Data type: SWWMETHODSOptional: Yes
Call by Reference: No ( called with pass by value option)
WI_CONTAINER - Data Container of Work Item
Data type: SWCONTOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
ID_NOT_CREATED - Work Item ID Cannot Be Created
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
READ_FAILED - Task Cannot Be Read
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SWW_WI_CREATE_SIMPLE 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, " | |||
| lt_agents | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lv_creator | TYPE SWWWIHEAD-WI_CREATOR, " SPACE | |||
| lv_id_not_created | TYPE SWWWIHEAD, " | |||
| lv_wi_container_handle | TYPE IF_SWF_CNT_CONTAINER, " | |||
| lv_priority | TYPE SWWWIHEAD-WI_PRIO, " SWFCO_NO_PRIO | |||
| lv_wi_header | TYPE SWWWIHEAD, " | |||
| lv_read_failed | TYPE SWWWIHEAD, " | |||
| lt_deadline_agents | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lv_task | TYPE SWWWIHEAD-WI_RH_TASK, " | |||
| lt_desired_end_agents | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lt_latest_start_agents | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lv_called_in_background | TYPE SWWCOMMIT-DIALOGFLAG, " SPACE | |||
| lv_deadline_data | TYPE SWWDEADDAT, " SPACE | |||
| lt_excluded_agents | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lt_notification_agents | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lv_no_deadline_parameters | TYPE SWWCOMMIT-DEADLCKFLG, " SPACE | |||
| lt_secondary_methods | TYPE STANDARD TABLE OF SWWMETHODS, " | |||
| lt_wi_container | TYPE STANDARD TABLE OF SWCONT. " |
|   CALL FUNCTION 'SWW_WI_CREATE_SIMPLE' " |
| EXPORTING | ||
| CREATOR | = lv_creator | |
| PRIORITY | = lv_priority | |
| TASK | = lv_task | |
| CALLED_IN_BACKGROUND | = lv_called_in_background | |
| DEADLINE_DATA | = lv_deadline_data | |
| NO_DEADLINE_PARAMETERS | = lv_no_deadline_parameters | |
| IMPORTING | ||
| WI_ID | = lv_wi_id | |
| WI_HEADER | = lv_wi_header | |
| CHANGING | ||
| WI_CONTAINER_HANDLE | = lv_wi_container_handle | |
| TABLES | ||
| AGENTS | = lt_agents | |
| DEADLINE_AGENTS | = lt_deadline_agents | |
| DESIRED_END_AGENTS | = lt_desired_end_agents | |
| LATEST_START_AGENTS | = lt_latest_start_agents | |
| EXCLUDED_AGENTS | = lt_excluded_agents | |
| NOTIFICATION_AGENTS | = lt_notification_agents | |
| SECONDARY_METHODS | = lt_secondary_methods | |
| WI_CONTAINER | = lt_wi_container | |
| EXCEPTIONS | ||
| ID_NOT_CREATED = 1 | ||
| READ_FAILED = 2 | ||
| . " SWW_WI_CREATE_SIMPLE | ||
ABAP code using 7.40 inline data declarations to call FM SWW_WI_CREATE_SIMPLE
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 WI_CREATOR FROM SWWWIHEAD INTO @DATA(ld_creator). | ||||
| DATA(ld_creator) | = ' '. | |||
| "SELECT single WI_PRIO FROM SWWWIHEAD INTO @DATA(ld_priority). | ||||
| DATA(ld_priority) | = SWFCO_NO_PRIO. | |||
| "SELECT single WI_RH_TASK FROM SWWWIHEAD INTO @DATA(ld_task). | ||||
| "SELECT single DIALOGFLAG FROM SWWCOMMIT INTO @DATA(ld_called_in_background). | ||||
| DATA(ld_called_in_background) | = ' '. | |||
| DATA(ld_deadline_data) | = ' '. | |||
| "SELECT single DEADLCKFLG FROM SWWCOMMIT INTO @DATA(ld_no_deadline_parameters). | ||||
| DATA(ld_no_deadline_parameters) | = ' '. | |||
Search for further information about these or an SAP related objects