SAP RS_COPY_PROGRAM Function Module for Copy Program Objects in Development Environment System
RS_COPY_PROGRAM is a standard rs copy program SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Copy Program Objects in Development Environment System 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 rs copy program FM, simply by entering the name RS_COPY_PROGRAM into the relevant SAP transaction such as SE37 or SE38.
Function Group: SEU2
Program Name: SAPLSEU2
Main Program: SAPLSEU2
Appliation area: S
Release date: 27-May-1999
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RS_COPY_PROGRAM 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 'RS_COPY_PROGRAM'"Copy Program Objects in Development Environment System.
EXPORTING
* CORRNUMBER = ' ' "Correction Number if SUPPRESS_POPUP is Mandatory
* WITH_CUA = ' ' "Menu Will be Copied by Default
* WITH_DOCUMENTATION = ' ' "Documentation Will be Copied by Default
* WITH_DYNPRO = ' ' "Screens Will be Copied by Default
* WITH_INCLUDES = ' ' "Includes Will Be Copied - Defined by User
* WITH_TEXTPOOL = 'X' "Text Pool Will be Copied by Default
* WITH_VARIANTS = ' ' "Variants Will be Copied by User
* GENERATED = ' ' "Generated Program
* SKIP_PROGRESS_IND = ' ' "Suppress Progress Indicator
* LOCK_HANDLE = "
* DEVCLASS = ' ' "Development Class if SUPPRESS_POPUP is Mandatory
* PROGRAM = "Target Program (30 Bytes)
SOURCE_PROGRAM = "Source Program (30 Bytes)
* SUPPRESS_CHECKS = ' ' "Suppress Authorization Checks
* SUPPRESS_COMMIT = ' ' "internal use only!!!!!!!!!!!!!!!!!!!!!!!
* SUPPRESS_NORM_CHECK = ' ' "Internal use only
* SUPPRESS_POPUP = ' ' "Suppress Dialog
* SUPPRESS_SCREEN = ' ' "Internal use only
IMPORTING
CORRNUMBER = "Correction Number if SUPPRESS_POPUP is Mandatory
DEVCLASS = "Development Class if SUPPRESS_POPUP is Mandatory
PROGRAM = "Target Program (30 Bytes)
EXCEPTIONS
ENQUEUE_LOCK = 1 OBJECT_NOT_FOUND = 2 PERMISSION_FAILURE = 3 REJECT_COPY = 4
IMPORTING Parameters details for RS_COPY_PROGRAM
CORRNUMBER - Correction Number if SUPPRESS_POPUP is Mandatory
Data type: E071-TRKORRDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
WITH_CUA - Menu Will be Copied by Default
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
WITH_DOCUMENTATION - Documentation Will be Copied by Default
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
WITH_DYNPRO - Screens Will be Copied by Default
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
WITH_INCLUDES - Includes Will Be Copied - Defined by User
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
WITH_TEXTPOOL - Text Pool Will be Copied by Default
Data type: SY-INPUTDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
WITH_VARIANTS - Variants Will be Copied by User
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
GENERATED - Generated Program
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SKIP_PROGRESS_IND - Suppress Progress Indicator
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOCK_HANDLE -
Data type: IF_ADT_LOCK_HANDLEOptional: Yes
Call by Reference: Yes
DEVCLASS - Development Class if SUPPRESS_POPUP is Mandatory
Data type: TDEVC-DEVCLASSDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
PROGRAM - Target Program (30 Bytes)
Data type: SY-REPIDOptional: Yes
Call by Reference: No ( called with pass by value option)
SOURCE_PROGRAM - Source Program (30 Bytes)
Data type: SY-REPIDOptional: No
Call by Reference: No ( called with pass by value option)
SUPPRESS_CHECKS - Suppress Authorization Checks
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUPPRESS_COMMIT - internal use only!!!!!!!!!!!!!!!!!!!!!!!
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUPPRESS_NORM_CHECK - Internal use only
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUPPRESS_POPUP - Suppress Dialog
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUPPRESS_SCREEN - Internal use only
Data type: SY-INPUTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RS_COPY_PROGRAM
CORRNUMBER - Correction Number if SUPPRESS_POPUP is Mandatory
Data type: E071-TRKORROptional: No
Call by Reference: No ( called with pass by value option)
DEVCLASS - Development Class if SUPPRESS_POPUP is Mandatory
Data type: TDEVC-DEVCLASSOptional: No
Call by Reference: No ( called with pass by value option)
PROGRAM - Target Program (30 Bytes)
Data type: SY-REPIDOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ENQUEUE_LOCK - Copy Aborted Because SAP Locks Exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT_NOT_FOUND - Object Not Found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PERMISSION_FAILURE - Insert Unsuccessful
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
REJECT_COPY - Reject Copy Because of Norm Errors or Internal Error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RS_COPY_PROGRAM 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_corrnumber | TYPE E071-TRKORR, " | |||
| lv_corrnumber | TYPE E071-TRKORR, " ' ' | |||
| lv_enqueue_lock | TYPE E071, " | |||
| lv_with_cua | TYPE SY-INPUT, " ' ' | |||
| lv_with_documentation | TYPE SY-INPUT, " ' ' | |||
| lv_with_dynpro | TYPE SY-INPUT, " ' ' | |||
| lv_with_includes | TYPE SY-INPUT, " ' ' | |||
| lv_with_textpool | TYPE SY-INPUT, " 'X' | |||
| lv_with_variants | TYPE SY-INPUT, " ' ' | |||
| lv_generated | TYPE SY-INPUT, " ' ' | |||
| lv_skip_progress_ind | TYPE SY-INPUT, " ' ' | |||
| lv_lock_handle | TYPE IF_ADT_LOCK_HANDLE, " | |||
| lv_devclass | TYPE TDEVC-DEVCLASS, " | |||
| lv_devclass | TYPE TDEVC-DEVCLASS, " ' ' | |||
| lv_object_not_found | TYPE TDEVC, " | |||
| lv_program | TYPE SY-REPID, " | |||
| lv_program | TYPE SY-REPID, " | |||
| lv_permission_failure | TYPE SY, " | |||
| lv_reject_copy | TYPE SY, " | |||
| lv_source_program | TYPE SY-REPID, " | |||
| lv_suppress_checks | TYPE SY-INPUT, " ' ' | |||
| lv_suppress_commit | TYPE SY-INPUT, " ' ' | |||
| lv_suppress_norm_check | TYPE SY-INPUT, " ' ' | |||
| lv_suppress_popup | TYPE SY-INPUT, " ' ' | |||
| lv_suppress_screen | TYPE SY-INPUT. " ' ' |
|   CALL FUNCTION 'RS_COPY_PROGRAM' "Copy Program Objects in Development Environment System |
| EXPORTING | ||
| CORRNUMBER | = lv_corrnumber | |
| WITH_CUA | = lv_with_cua | |
| WITH_DOCUMENTATION | = lv_with_documentation | |
| WITH_DYNPRO | = lv_with_dynpro | |
| WITH_INCLUDES | = lv_with_includes | |
| WITH_TEXTPOOL | = lv_with_textpool | |
| WITH_VARIANTS | = lv_with_variants | |
| GENERATED | = lv_generated | |
| SKIP_PROGRESS_IND | = lv_skip_progress_ind | |
| LOCK_HANDLE | = lv_lock_handle | |
| DEVCLASS | = lv_devclass | |
| PROGRAM | = lv_program | |
| SOURCE_PROGRAM | = lv_source_program | |
| SUPPRESS_CHECKS | = lv_suppress_checks | |
| SUPPRESS_COMMIT | = lv_suppress_commit | |
| SUPPRESS_NORM_CHECK | = lv_suppress_norm_check | |
| SUPPRESS_POPUP | = lv_suppress_popup | |
| SUPPRESS_SCREEN | = lv_suppress_screen | |
| IMPORTING | ||
| CORRNUMBER | = lv_corrnumber | |
| DEVCLASS | = lv_devclass | |
| PROGRAM | = lv_program | |
| EXCEPTIONS | ||
| ENQUEUE_LOCK = 1 | ||
| OBJECT_NOT_FOUND = 2 | ||
| PERMISSION_FAILURE = 3 | ||
| REJECT_COPY = 4 | ||
| . " RS_COPY_PROGRAM | ||
ABAP code using 7.40 inline data declarations to call FM RS_COPY_PROGRAM
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 TRKORR FROM E071 INTO @DATA(ld_corrnumber). | ||||
| "SELECT single TRKORR FROM E071 INTO @DATA(ld_corrnumber). | ||||
| DATA(ld_corrnumber) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_with_cua). | ||||
| DATA(ld_with_cua) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_with_documentation). | ||||
| DATA(ld_with_documentation) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_with_dynpro). | ||||
| DATA(ld_with_dynpro) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_with_includes). | ||||
| DATA(ld_with_includes) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_with_textpool). | ||||
| DATA(ld_with_textpool) | = 'X'. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_with_variants). | ||||
| DATA(ld_with_variants) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_generated). | ||||
| DATA(ld_generated) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_skip_progress_ind). | ||||
| DATA(ld_skip_progress_ind) | = ' '. | |||
| "SELECT single DEVCLASS FROM TDEVC INTO @DATA(ld_devclass). | ||||
| "SELECT single DEVCLASS FROM TDEVC INTO @DATA(ld_devclass). | ||||
| DATA(ld_devclass) | = ' '. | |||
| "SELECT single REPID FROM SY INTO @DATA(ld_program). | ||||
| "SELECT single REPID FROM SY INTO @DATA(ld_program). | ||||
| "SELECT single REPID FROM SY INTO @DATA(ld_source_program). | ||||
| "SELECT single INPUT FROM SY INTO @DATA(ld_suppress_checks). | ||||
| DATA(ld_suppress_checks) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_suppress_commit). | ||||
| DATA(ld_suppress_commit) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_suppress_norm_check). | ||||
| DATA(ld_suppress_norm_check) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_suppress_popup). | ||||
| DATA(ld_suppress_popup) | = ' '. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_suppress_screen). | ||||
| DATA(ld_suppress_screen) | = ' '. | |||
Search for further information about these or an SAP related objects