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

Function SWF_INSTANTIATE_TASK_GENERATE 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 'SWF_INSTANTIATE_TASK_GENERATE'".
EXPORTING
IM_SHORT = "
IM_STEXT = "
IM_WI_TEXT = "
IM_OBJTYPE = "
IMPORTING
EX_TASK = "Task abbreviation
EXCEPTIONS
METHOD_NOT_FOUND = 1 TASK_NOT_GENERATED = 2
IMPORTING Parameters details for SWF_INSTANTIATE_TASK_GENERATE
IM_SHORT -
Data type: HRS1000-SHORTOptional: No
Call by Reference: Yes
IM_STEXT -
Data type: HRS1000-STEXTOptional: No
Call by Reference: Yes
IM_WI_TEXT -
Data type: HRS1206-WITEXTOptional: No
Call by Reference: Yes
IM_OBJTYPE -
Data type: SWD_OTYPEOptional: No
Call by Reference: Yes
EXPORTING Parameters details for SWF_INSTANTIATE_TASK_GENERATE
EX_TASK - Task abbreviation
Data type: SWD_STEP_TOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
METHOD_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TASK_NOT_GENERATED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SWF_INSTANTIATE_TASK_GENERATE 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_ex_task | TYPE SWD_STEP_T, " | |||
| lv_im_short | TYPE HRS1000-SHORT, " | |||
| lv_method_not_found | TYPE HRS1000, " | |||
| lv_im_stext | TYPE HRS1000-STEXT, " | |||
| lv_task_not_generated | TYPE HRS1000, " | |||
| lv_im_wi_text | TYPE HRS1206-WITEXT, " | |||
| lv_im_objtype | TYPE SWD_OTYPE. " |
|   CALL FUNCTION 'SWF_INSTANTIATE_TASK_GENERATE' " |
| EXPORTING | ||
| IM_SHORT | = lv_im_short | |
| IM_STEXT | = lv_im_stext | |
| IM_WI_TEXT | = lv_im_wi_text | |
| IM_OBJTYPE | = lv_im_objtype | |
| IMPORTING | ||
| EX_TASK | = lv_ex_task | |
| EXCEPTIONS | ||
| METHOD_NOT_FOUND = 1 | ||
| TASK_NOT_GENERATED = 2 | ||
| . " SWF_INSTANTIATE_TASK_GENERATE | ||
ABAP code using 7.40 inline data declarations to call FM SWF_INSTANTIATE_TASK_GENERATE
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 SHORT FROM HRS1000 INTO @DATA(ld_im_short). | ||||
| "SELECT single STEXT FROM HRS1000 INTO @DATA(ld_im_stext). | ||||
| "SELECT single WITEXT FROM HRS1206 INTO @DATA(ld_im_wi_text). | ||||
Search for further information about these or an SAP related objects