SAP SWUO_COPY_TEMPLATE_API Function Module for
SWUO_COPY_TEMPLATE_API is a standard swuo copy template api 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 swuo copy template api FM, simply by entering the name SWUO_COPY_TEMPLATE_API into the relevant SAP transaction such as SE37 or SE38.
Function Group: SWUO_OI
Program Name: SAPLSWUO_OI
Main Program: SAPLSWUO_OI
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SWUO_COPY_TEMPLATE_API 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 'SWUO_COPY_TEMPLATE_API'".
EXPORTING
* WF_ID_DEF = "ID of Workflow Definition
* WF_VERSION = "Version of workflow definition
OBJECT_ID = "
* READ_ONLY = ' ' "Display only
* OPEN_DOC = ' ' "
* PROMPT_USER = 'X' "
* DST_WF_ID_DEF = "
* DST_WF_VERSION = "
IMPORTING
PROPERTIES = "
EXCEPTIONS
OBJ_NOT_SPECIFIED = 1 OPEN_FAILED = 2 COPY_FAILED = 3
IMPORTING Parameters details for SWUO_COPY_TEMPLATE_API
WF_ID_DEF - ID of Workflow Definition
Data type: SWD_WFD_IDOptional: Yes
Call by Reference: No ( called with pass by value option)
WF_VERSION - Version of workflow definition
Data type: SWD_VERSIOOptional: Yes
Call by Reference: No ( called with pass by value option)
OBJECT_ID -
Data type: SDOKOBJECTOptional: No
Call by Reference: No ( called with pass by value option)
READ_ONLY - Display only
Data type: XFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OPEN_DOC -
Data type: XFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PROMPT_USER -
Data type: XFLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DST_WF_ID_DEF -
Data type: SWD_WFD_IDOptional: Yes
Call by Reference: Yes
DST_WF_VERSION -
Data type: SWD_VERSIOOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for SWUO_COPY_TEMPLATE_API
PROPERTIES -
Data type: SWUOPROPOptional: No
Call by Reference: Yes
EXCEPTIONS details
OBJ_NOT_SPECIFIED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OPEN_FAILED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
COPY_FAILED - Error during copying
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SWUO_COPY_TEMPLATE_API 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_wf_id_def | TYPE SWD_WFD_ID, " | |||
| lv_properties | TYPE SWUOPROP, " | |||
| lv_obj_not_specified | TYPE SWUOPROP, " | |||
| lv_wf_version | TYPE SWD_VERSIO, " | |||
| lv_open_failed | TYPE SWD_VERSIO, " | |||
| lv_object_id | TYPE SDOKOBJECT, " | |||
| lv_copy_failed | TYPE SDOKOBJECT, " | |||
| lv_read_only | TYPE XFLAG, " SPACE | |||
| lv_open_doc | TYPE XFLAG, " SPACE | |||
| lv_prompt_user | TYPE XFLAG, " 'X' | |||
| lv_dst_wf_id_def | TYPE SWD_WFD_ID, " | |||
| lv_dst_wf_version | TYPE SWD_VERSIO. " |
|   CALL FUNCTION 'SWUO_COPY_TEMPLATE_API' " |
| EXPORTING | ||
| WF_ID_DEF | = lv_wf_id_def | |
| WF_VERSION | = lv_wf_version | |
| OBJECT_ID | = lv_object_id | |
| READ_ONLY | = lv_read_only | |
| OPEN_DOC | = lv_open_doc | |
| PROMPT_USER | = lv_prompt_user | |
| DST_WF_ID_DEF | = lv_dst_wf_id_def | |
| DST_WF_VERSION | = lv_dst_wf_version | |
| IMPORTING | ||
| PROPERTIES | = lv_properties | |
| EXCEPTIONS | ||
| OBJ_NOT_SPECIFIED = 1 | ||
| OPEN_FAILED = 2 | ||
| COPY_FAILED = 3 | ||
| . " SWUO_COPY_TEMPLATE_API | ||
ABAP code using 7.40 inline data declarations to call FM SWUO_COPY_TEMPLATE_API
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.| DATA(ld_read_only) | = ' '. | |||
| DATA(ld_open_doc) | = ' '. | |||
| DATA(ld_prompt_user) | = 'X'. | |||
Search for further information about these or an SAP related objects