SAP DDUT_OBJECT_COPY Function Module for DD:Copy Object
DDUT_OBJECT_COPY is a standard ddut object copy SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for DD:Copy Object processing and below is the pattern details for this FM, 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 ddut object copy FM, simply by entering the name DDUT_OBJECT_COPY into the relevant SAP transaction such as SE37 or SE38.
Function Group: SDTO
Program Name: SAPLSDTO
Main Program:
Appliation area: S
Release date: 30-Apr-1999
Mode(Normal, Remote etc): Normal Function Module
Update:

Function DDUT_OBJECT_COPY 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 'DDUT_OBJECT_COPY'"DD:Copy Object.
EXPORTING
TYPE = "Type of ABAP Dictionary Object to be Copied
SRC_NAME = "Name of ABAP Dictionary Object to be Copied
* SRC_ID = ' ' "Identifier of ABAP Dictionary Object to be Copied
DST_NAME = "Name to which to Copy
* DST_ID = ' ' "Identifier to which to Copy
* STATE = 'A' "Read status of object to be copied
* WITH_SUBOBJECTS = 'X' "Should Component Objects also be Copied
* WITH_DOCU = 'X' "Should Documentation of Object also be Copied
EXCEPTIONS
ILLEGAL_INPUT = 1 SRC_NOT_FOUND = 2 COPY_FAILURE = 3 COPY_REFUSED = 4
IMPORTING Parameters details for DDUT_OBJECT_COPY
TYPE - Type of ABAP Dictionary Object to be Copied
Data type: DDOBJTYPOptional: No
Call by Reference: No ( called with pass by value option)
SRC_NAME - Name of ABAP Dictionary Object to be Copied
Data type: DDOBJNAMEOptional: No
Call by Reference: No ( called with pass by value option)
SRC_ID - Identifier of ABAP Dictionary Object to be Copied
Data type: DDOBJECTIDDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
DST_NAME - Name to which to Copy
Data type: DDOBJNAMEOptional: No
Call by Reference: No ( called with pass by value option)
DST_ID - Identifier to which to Copy
Data type: DDOBJECTIDDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
STATE - Read status of object to be copied
Data type: DDOBJSTATEDefault: 'A'
Optional: Yes
Call by Reference: No ( called with pass by value option)
WITH_SUBOBJECTS - Should Component Objects also be Copied
Data type: DDBOOL_DDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
WITH_DOCU - Should Documentation of Object also be Copied
Data type: DDBOOL_DDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ILLEGAL_INPUT - Illegal Value of an Input Parameter
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SRC_NOT_FOUND - Object to be copied does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
COPY_FAILURE - Error while Copying (ROLLBACK Recommended)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
COPY_REFUSED - Copy not Allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for DDUT_OBJECT_COPY 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_type | TYPE DDOBJTYP, " | |||
| lv_illegal_input | TYPE DDOBJTYP, " | |||
| lv_src_name | TYPE DDOBJNAME, " | |||
| lv_src_not_found | TYPE DDOBJNAME, " | |||
| lv_src_id | TYPE DDOBJECTID, " ' ' | |||
| lv_copy_failure | TYPE DDOBJECTID, " | |||
| lv_dst_name | TYPE DDOBJNAME, " | |||
| lv_copy_refused | TYPE DDOBJNAME, " | |||
| lv_dst_id | TYPE DDOBJECTID, " ' ' | |||
| lv_state | TYPE DDOBJSTATE, " 'A' | |||
| lv_with_subobjects | TYPE DDBOOL_D, " 'X' | |||
| lv_with_docu | TYPE DDBOOL_D. " 'X' |
|   CALL FUNCTION 'DDUT_OBJECT_COPY' "DD:Copy Object |
| EXPORTING | ||
| TYPE | = lv_type | |
| SRC_NAME | = lv_src_name | |
| SRC_ID | = lv_src_id | |
| DST_NAME | = lv_dst_name | |
| DST_ID | = lv_dst_id | |
| STATE | = lv_state | |
| WITH_SUBOBJECTS | = lv_with_subobjects | |
| WITH_DOCU | = lv_with_docu | |
| EXCEPTIONS | ||
| ILLEGAL_INPUT = 1 | ||
| SRC_NOT_FOUND = 2 | ||
| COPY_FAILURE = 3 | ||
| COPY_REFUSED = 4 | ||
| . " DDUT_OBJECT_COPY | ||
ABAP code using 7.40 inline data declarations to call FM DDUT_OBJECT_COPY
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_src_id) | = ' '. | |||
| DATA(ld_dst_id) | = ' '. | |||
| DATA(ld_state) | = 'A'. | |||
| DATA(ld_with_subobjects) | = 'X'. | |||
| DATA(ld_with_docu) | = 'X'. | |||
Search for further information about these or an SAP related objects