SAP SWU_WF_TASK_DISPATCH Function Module for
SWU_WF_TASK_DISPATCH is a standard swu wf task dispatch 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 swu wf task dispatch FM, simply by entering the name SWU_WF_TASK_DISPATCH into the relevant SAP transaction such as SE37 or SE38.
Function Group: SWU4
Program Name: SAPLSWU4
Main Program: SAPLSWU4
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SWU_WF_TASK_DISPATCH 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 'SWU_WF_TASK_DISPATCH'".
EXPORTING
* TITLE_STRING = "Title of dialog box for agent selection
* TASK_ID = "
* MULTIPLE_SELECTION = ' ' "Several agents can be selected
* LIST_SORTABLE = ' ' "
* DISPLAY = ' ' "Display Only
IMPORTING
SEL_OBJECT = "Selected Object
TABLES
ORG_OBJ_TAB = "
* NAME_TAB = "
* SEL_OBJECT_LIST = "
* EXCLUDED_AGENTS = "Excluded Agents
EXCEPTIONS
NO_OBJECT_SELECTED = 1 BACKGROUND_TASK = 2 OPERATION_CANCELLED_BY_USER = 3
IMPORTING Parameters details for SWU_WF_TASK_DISPATCH
TITLE_STRING - Title of dialog box for agent selection
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
TASK_ID -
Data type: SWWWLHEAD-WI_RH_TASKOptional: Yes
Call by Reference: No ( called with pass by value option)
MULTIPLE_SELECTION - Several agents can be selected
Data type: SY-INPUTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LIST_SORTABLE -
Data type: SY-INPUTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DISPLAY - Display Only
Data type: SY-INPUTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SWU_WF_TASK_DISPATCH
SEL_OBJECT - Selected Object
Data type: SWHACTOROptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SWU_WF_TASK_DISPATCH
ORG_OBJ_TAB -
Data type: SWHACTOROptional: No
Call by Reference: No ( called with pass by value option)
NAME_TAB -
Data type: RHOBJ_NAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
SEL_OBJECT_LIST -
Data type: SWHACTOROptional: Yes
Call by Reference: No ( called with pass by value option)
EXCLUDED_AGENTS - Excluded Agents
Data type: SWHACTOROptional: Yes
Call by Reference: Yes
EXCEPTIONS details
NO_OBJECT_SELECTED - No object selected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
BACKGROUND_TASK -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OPERATION_CANCELLED_BY_USER -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SWU_WF_TASK_DISPATCH 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_sel_object | TYPE SWHACTOR, " | |||
| lt_org_obj_tab | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lv_title_string | TYPE C, " | |||
| lv_no_object_selected | TYPE C, " | |||
| lv_task_id | TYPE SWWWLHEAD-WI_RH_TASK, " | |||
| lt_name_tab | TYPE STANDARD TABLE OF RHOBJ_NAME, " | |||
| lv_background_task | TYPE RHOBJ_NAME, " | |||
| lt_sel_object_list | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lv_multiple_selection | TYPE SY-INPUT, " SPACE | |||
| lv_operation_cancelled_by_user | TYPE SY, " | |||
| lv_list_sortable | TYPE SY-INPUT, " SPACE | |||
| lt_excluded_agents | TYPE STANDARD TABLE OF SWHACTOR, " | |||
| lv_display | TYPE SY-INPUT. " SPACE |
|   CALL FUNCTION 'SWU_WF_TASK_DISPATCH' " |
| EXPORTING | ||
| TITLE_STRING | = lv_title_string | |
| TASK_ID | = lv_task_id | |
| MULTIPLE_SELECTION | = lv_multiple_selection | |
| LIST_SORTABLE | = lv_list_sortable | |
| DISPLAY | = lv_display | |
| IMPORTING | ||
| SEL_OBJECT | = lv_sel_object | |
| TABLES | ||
| ORG_OBJ_TAB | = lt_org_obj_tab | |
| NAME_TAB | = lt_name_tab | |
| SEL_OBJECT_LIST | = lt_sel_object_list | |
| EXCLUDED_AGENTS | = lt_excluded_agents | |
| EXCEPTIONS | ||
| NO_OBJECT_SELECTED = 1 | ||
| BACKGROUND_TASK = 2 | ||
| OPERATION_CANCELLED_BY_USER = 3 | ||
| . " SWU_WF_TASK_DISPATCH | ||
ABAP code using 7.40 inline data declarations to call FM SWU_WF_TASK_DISPATCH
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_RH_TASK FROM SWWWLHEAD INTO @DATA(ld_task_id). | ||||
| "SELECT single INPUT FROM SY INTO @DATA(ld_multiple_selection). | ||||
| DATA(ld_multiple_selection) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_list_sortable). | ||||
| DATA(ld_list_sortable) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_display). | ||||
| DATA(ld_display) | = ' '. | |||
Search for further information about these or an SAP related objects