SAP CTMV_FEATURE_COPY Function Module for
CTMV_FEATURE_COPY is a standard ctmv feature copy 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 ctmv feature copy FM, simply by entering the name CTMV_FEATURE_COPY into the relevant SAP transaction such as SE37 or SE38.
Function Group: CTMV
Program Name: SAPLCTMV
Main Program: SAPLCTMV
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CTMV_FEATURE_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 'CTMV_FEATURE_COPY'".
EXPORTING
* FEATURE_NAME = ' ' "Feature name
FEATURE_TO_COPY = "Internal number of the feature to
* KEY_DATE = SY-DATUM "Valid-from date of source characteristic
* KEY_DATE_NEW_FEATURE = "Valid-from date of new characteristic
* CHANGE_NUMBER = "Change Number
* CHANGE_NUMBER_COPY = "
IMPORTING
NEW_FEATURE = "Internal number of the feature to
EXCEPTIONS
ENQUEUE_ERROR = 1 FEATURE_NOT_FOUND = 2 INVALID_FEATURE_NAME = 3 MISSING_FEATURE_NAME = 4
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLCTMV_001 User Exit for Characteristics: Current Data Before Saving Characteristic
IMPORTING Parameters details for CTMV_FEATURE_COPY
FEATURE_NAME - Feature name
Data type: CABN-ATNAMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FEATURE_TO_COPY - Internal number of the feature to
Data type: CABN-ATINNOptional: No
Call by Reference: No ( called with pass by value option)
KEY_DATE - Valid-from date of source characteristic
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
KEY_DATE_NEW_FEATURE - Valid-from date of new characteristic
Data type: SY-DATUMOptional: Yes
Call by Reference: No ( called with pass by value option)
CHANGE_NUMBER - Change Number
Data type: CABN-AENNROptional: Yes
Call by Reference: No ( called with pass by value option)
CHANGE_NUMBER_COPY -
Data type: CABN-AENNROptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CTMV_FEATURE_COPY
NEW_FEATURE - Internal number of the feature to
Data type: CABN-ATINNOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ENQUEUE_ERROR - internal error in lock indicator m
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FEATURE_NOT_FOUND - Feature to be copied not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_FEATURE_NAME - Feature name already exists
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MISSING_FEATURE_NAME - Feature name not specified
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CTMV_FEATURE_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_new_feature | TYPE CABN-ATINN, " | |||
| lv_feature_name | TYPE CABN-ATNAM, " SPACE | |||
| lv_enqueue_error | TYPE CABN, " | |||
| lv_feature_to_copy | TYPE CABN-ATINN, " | |||
| lv_feature_not_found | TYPE CABN, " | |||
| lv_key_date | TYPE SY-DATUM, " SY-DATUM | |||
| lv_invalid_feature_name | TYPE SY, " | |||
| lv_key_date_new_feature | TYPE SY-DATUM, " | |||
| lv_missing_feature_name | TYPE SY, " | |||
| lv_change_number | TYPE CABN-AENNR, " | |||
| lv_change_number_copy | TYPE CABN-AENNR. " |
|   CALL FUNCTION 'CTMV_FEATURE_COPY' " |
| EXPORTING | ||
| FEATURE_NAME | = lv_feature_name | |
| FEATURE_TO_COPY | = lv_feature_to_copy | |
| KEY_DATE | = lv_key_date | |
| KEY_DATE_NEW_FEATURE | = lv_key_date_new_feature | |
| CHANGE_NUMBER | = lv_change_number | |
| CHANGE_NUMBER_COPY | = lv_change_number_copy | |
| IMPORTING | ||
| NEW_FEATURE | = lv_new_feature | |
| EXCEPTIONS | ||
| ENQUEUE_ERROR = 1 | ||
| FEATURE_NOT_FOUND = 2 | ||
| INVALID_FEATURE_NAME = 3 | ||
| MISSING_FEATURE_NAME = 4 | ||
| . " CTMV_FEATURE_COPY | ||
ABAP code using 7.40 inline data declarations to call FM CTMV_FEATURE_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.| "SELECT single ATINN FROM CABN INTO @DATA(ld_new_feature). | ||||
| "SELECT single ATNAM FROM CABN INTO @DATA(ld_feature_name). | ||||
| DATA(ld_feature_name) | = ' '. | |||
| "SELECT single ATINN FROM CABN INTO @DATA(ld_feature_to_copy). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_key_date). | ||||
| DATA(ld_key_date) | = SY-DATUM. | |||
| "SELECT single DATUM FROM SY INTO @DATA(ld_key_date_new_feature). | ||||
| "SELECT single AENNR FROM CABN INTO @DATA(ld_change_number). | ||||
| "SELECT single AENNR FROM CABN INTO @DATA(ld_change_number_copy). | ||||
Search for further information about these or an SAP related objects