SAP CP_CC_S_COPY_BY_TSK Function Module for NOTRANSL: Kopieren durch Plankopf









CP_CC_S_COPY_BY_TSK is a standard cp cc s copy by tsk SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Kopieren durch Plankopf 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 cp cc s copy by tsk FM, simply by entering the name CP_CC_S_COPY_BY_TSK into the relevant SAP transaction such as SE37 or SE38.

Function Group: CPCC
Program Name: SAPLCPCC
Main Program: SAPLCPCC
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CP_CC_S_COPY_BY_TSK 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 'CP_CC_S_COPY_BY_TSK'"NOTRANSL: Kopieren durch Plankopf
EXPORTING
* I_ECN_SOURCE = ' ' "Change Number
* I_PLNAL_TARGET = ' ' "
* I_PLANT_TARGET = ' ' "
* I_MATERIAL_ROOT_TARGET = "
* I_PLANT_ROOT_TARGET = "
* I_SALES_ORDER_ROOT_TARGET = "
* I_SALES_ORDER_ITEM_ROOT_TARGET = "
* I_MATERIAL_ROOT_SOURCE = "Material Number
* I_PLANT_ROOT_SOURCE = "Plant
* I_SALES_ORDER_ROOT_SOURCE = "Sales Document
* I_SALES_ORDER_ITEM_ROOT_SOURCE = "Sales document item
* I_KEY_DATE_SOURCE = "Date and Time, Current (Application Server) Date
* I_COPY_OBJECTS_BY_TSK = ' ' "
* I_FLG_CONSISTENCY_CHECK = 'X' "
* I_ITM_IDENT_MAPPING = "
* I_FLG_ECM_RECALCULATION = 'X' "
* I_ECN_S = ' ' "
I_KEY_DATE_S = "
I_PLNTY_SOURCE = "
I_PLNNR_SOURCE = "
I_PLNAL_SOURCE = "
I_PLNTY_TARGET = "
* I_PLNNR_TARGET = ' ' "

IMPORTING
E_PLNTY_TARGET = "
E_PLNNR_TARGET = "
E_PLNAL_TARGET = "
E_PLANT_TARGET = "
E_HANDLE_TARGET = "
E_ECM_DATA_ERROR_TYPE = "

EXCEPTIONS
PATH_SOURCE_INCOMPLETE = 1 PATH_TARGET_INCOMPLETE = 2 NO_VALID_SOURCE_TASK = 3 TASK_NOT_COPIED = 4 ECM_EVALUATION_NECESSARY = 5
.



IMPORTING Parameters details for CP_CC_S_COPY_BY_TSK

I_ECN_SOURCE - Change Number

Data type: TSK_CLASS_DATA-AENNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PLNAL_TARGET -

Data type: TSK_CLASS_DATA-PLNAL
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PLANT_TARGET -

Data type: TSK_CLASS_DATA-WERKS
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MATERIAL_ROOT_TARGET -

Data type: MTK_CLASS_DATA-MATNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PLANT_ROOT_TARGET -

Data type: MTK_CLASS_DATA-WERKS
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_SALES_ORDER_ROOT_TARGET -

Data type: MTK_CLASS_DATA-VBELN
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_SALES_ORDER_ITEM_ROOT_TARGET -

Data type: MTK_CLASS_DATA-POSNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MATERIAL_ROOT_SOURCE - Material Number

Data type: MTK_CLASS_DATA-MATNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PLANT_ROOT_SOURCE - Plant

Data type: MTK_CLASS_DATA-WERKS
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_SALES_ORDER_ROOT_SOURCE - Sales Document

Data type: MTK_CLASS_DATA-VBELN
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_SALES_ORDER_ITEM_ROOT_SOURCE - Sales document item

Data type: MTK_CLASS_DATA-POSNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KEY_DATE_SOURCE - Date and Time, Current (Application Server) Date

Data type: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_COPY_OBJECTS_BY_TSK -

Data type: COPY_BY_TSK
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FLG_CONSISTENCY_CHECK -

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_ITM_IDENT_MAPPING -

Data type: CSCL_ITM_MAPPING_ID_XT_TB_TYPE
Optional: Yes
Call by Reference: Yes

I_FLG_ECM_RECALCULATION -

Data type: C
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_ECN_S -

Data type: TSK_CLASS_DATA-AENNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KEY_DATE_S -

Data type: SY-DATUM
Optional: No
Call by Reference: No ( called with pass by value option)

I_PLNTY_SOURCE -

Data type: TSK_CLASS_DATA-PLNTY
Optional: No
Call by Reference: No ( called with pass by value option)

I_PLNNR_SOURCE -

Data type: TSK_CLASS_DATA-PLNNR
Optional: No
Call by Reference: No ( called with pass by value option)

I_PLNAL_SOURCE -

Data type: TSK_CLASS_DATA-PLNAL
Optional: No
Call by Reference: No ( called with pass by value option)

I_PLNTY_TARGET -

Data type: TSK_CLASS_DATA-PLNTY
Optional: No
Call by Reference: No ( called with pass by value option)

I_PLNNR_TARGET -

Data type: TSK_CLASS_DATA-PLNNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CP_CC_S_COPY_BY_TSK

E_PLNTY_TARGET -

Data type: TSK_CLASS_DATA-PLNTY
Optional: No
Call by Reference: No ( called with pass by value option)

E_PLNNR_TARGET -

Data type: TSK_CLASS_DATA-PLNNR
Optional: No
Call by Reference: No ( called with pass by value option)

E_PLNAL_TARGET -

Data type: TSK_CLASS_DATA-PLNAL
Optional: No
Call by Reference: No ( called with pass by value option)

E_PLANT_TARGET -

Data type: TSK_CLASS_DATA-WERKS
Optional: No
Call by Reference: No ( called with pass by value option)

E_HANDLE_TARGET -

Data type: TSK_CLASS_DATA-HANDLE
Optional: No
Call by Reference: No ( called with pass by value option)

E_ECM_DATA_ERROR_TYPE -

Data type: CPCC_MESSAGE_TYPE
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

PATH_SOURCE_INCOMPLETE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PATH_TARGET_INCOMPLETE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_VALID_SOURCE_TASK -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

TASK_NOT_COPIED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ECM_EVALUATION_NECESSARY -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for CP_CC_S_COPY_BY_TSK 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_i_ecn_source  TYPE TSK_CLASS_DATA-AENNR, "   SPACE
lv_e_plnty_target  TYPE TSK_CLASS_DATA-PLNTY, "   
lv_path_source_incomplete  TYPE TSK_CLASS_DATA, "   
lv_i_plnal_target  TYPE TSK_CLASS_DATA-PLNAL, "   SPACE
lv_i_plant_target  TYPE TSK_CLASS_DATA-WERKS, "   SPACE
lv_i_material_root_target  TYPE MTK_CLASS_DATA-MATNR, "   
lv_i_plant_root_target  TYPE MTK_CLASS_DATA-WERKS, "   
lv_i_sales_order_root_target  TYPE MTK_CLASS_DATA-VBELN, "   
lv_i_sales_order_item_root_target  TYPE MTK_CLASS_DATA-POSNR, "   
lv_i_material_root_source  TYPE MTK_CLASS_DATA-MATNR, "   
lv_i_plant_root_source  TYPE MTK_CLASS_DATA-WERKS, "   
lv_i_sales_order_root_source  TYPE MTK_CLASS_DATA-VBELN, "   
lv_i_sales_order_item_root_source  TYPE MTK_CLASS_DATA-POSNR, "   
lv_e_plnnr_target  TYPE TSK_CLASS_DATA-PLNNR, "   
lv_i_key_date_source  TYPE SY-DATUM, "   
lv_path_target_incomplete  TYPE SY, "   
lv_i_copy_objects_by_tsk  TYPE COPY_BY_TSK, "   SPACE
lv_i_flg_consistency_check  TYPE COPY_BY_TSK, "   'X'
lv_i_itm_ident_mapping  TYPE CSCL_ITM_MAPPING_ID_XT_TB_TYPE, "   
lv_i_flg_ecm_recalculation  TYPE C, "   'X'
lv_i_ecn_s  TYPE TSK_CLASS_DATA-AENNR, "   SPACE
lv_e_plnal_target  TYPE TSK_CLASS_DATA-PLNAL, "   
lv_no_valid_source_task  TYPE TSK_CLASS_DATA, "   
lv_i_key_date_s  TYPE SY-DATUM, "   
lv_e_plant_target  TYPE TSK_CLASS_DATA-WERKS, "   
lv_task_not_copied  TYPE TSK_CLASS_DATA, "   
lv_i_plnty_source  TYPE TSK_CLASS_DATA-PLNTY, "   
lv_e_handle_target  TYPE TSK_CLASS_DATA-HANDLE, "   
lv_ecm_evaluation_necessary  TYPE TSK_CLASS_DATA, "   
lv_i_plnnr_source  TYPE TSK_CLASS_DATA-PLNNR, "   
lv_e_ecm_data_error_type  TYPE CPCC_MESSAGE_TYPE, "   
lv_i_plnal_source  TYPE TSK_CLASS_DATA-PLNAL, "   
lv_i_plnty_target  TYPE TSK_CLASS_DATA-PLNTY, "   
lv_i_plnnr_target  TYPE TSK_CLASS_DATA-PLNNR. "   SPACE

  CALL FUNCTION 'CP_CC_S_COPY_BY_TSK'  "NOTRANSL: Kopieren durch Plankopf
    EXPORTING
         I_ECN_SOURCE = lv_i_ecn_source
         I_PLNAL_TARGET = lv_i_plnal_target
         I_PLANT_TARGET = lv_i_plant_target
         I_MATERIAL_ROOT_TARGET = lv_i_material_root_target
         I_PLANT_ROOT_TARGET = lv_i_plant_root_target
         I_SALES_ORDER_ROOT_TARGET = lv_i_sales_order_root_target
         I_SALES_ORDER_ITEM_ROOT_TARGET = lv_i_sales_order_item_root_target
         I_MATERIAL_ROOT_SOURCE = lv_i_material_root_source
         I_PLANT_ROOT_SOURCE = lv_i_plant_root_source
         I_SALES_ORDER_ROOT_SOURCE = lv_i_sales_order_root_source
         I_SALES_ORDER_ITEM_ROOT_SOURCE = lv_i_sales_order_item_root_source
         I_KEY_DATE_SOURCE = lv_i_key_date_source
         I_COPY_OBJECTS_BY_TSK = lv_i_copy_objects_by_tsk
         I_FLG_CONSISTENCY_CHECK = lv_i_flg_consistency_check
         I_ITM_IDENT_MAPPING = lv_i_itm_ident_mapping
         I_FLG_ECM_RECALCULATION = lv_i_flg_ecm_recalculation
         I_ECN_S = lv_i_ecn_s
         I_KEY_DATE_S = lv_i_key_date_s
         I_PLNTY_SOURCE = lv_i_plnty_source
         I_PLNNR_SOURCE = lv_i_plnnr_source
         I_PLNAL_SOURCE = lv_i_plnal_source
         I_PLNTY_TARGET = lv_i_plnty_target
         I_PLNNR_TARGET = lv_i_plnnr_target
    IMPORTING
         E_PLNTY_TARGET = lv_e_plnty_target
         E_PLNNR_TARGET = lv_e_plnnr_target
         E_PLNAL_TARGET = lv_e_plnal_target
         E_PLANT_TARGET = lv_e_plant_target
         E_HANDLE_TARGET = lv_e_handle_target
         E_ECM_DATA_ERROR_TYPE = lv_e_ecm_data_error_type
    EXCEPTIONS
        PATH_SOURCE_INCOMPLETE = 1
        PATH_TARGET_INCOMPLETE = 2
        NO_VALID_SOURCE_TASK = 3
        TASK_NOT_COPIED = 4
        ECM_EVALUATION_NECESSARY = 5
. " CP_CC_S_COPY_BY_TSK




ABAP code using 7.40 inline data declarations to call FM CP_CC_S_COPY_BY_TSK

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 AENNR FROM TSK_CLASS_DATA INTO @DATA(ld_i_ecn_source).
DATA(ld_i_ecn_source) = ' '.
 
"SELECT single PLNTY FROM TSK_CLASS_DATA INTO @DATA(ld_e_plnty_target).
 
 
"SELECT single PLNAL FROM TSK_CLASS_DATA INTO @DATA(ld_i_plnal_target).
DATA(ld_i_plnal_target) = ' '.
 
"SELECT single WERKS FROM TSK_CLASS_DATA INTO @DATA(ld_i_plant_target).
DATA(ld_i_plant_target) = ' '.
 
"SELECT single MATNR FROM MTK_CLASS_DATA INTO @DATA(ld_i_material_root_target).
 
"SELECT single WERKS FROM MTK_CLASS_DATA INTO @DATA(ld_i_plant_root_target).
 
"SELECT single VBELN FROM MTK_CLASS_DATA INTO @DATA(ld_i_sales_order_root_target).
 
"SELECT single POSNR FROM MTK_CLASS_DATA INTO @DATA(ld_i_sales_order_item_root_target).
 
"SELECT single MATNR FROM MTK_CLASS_DATA INTO @DATA(ld_i_material_root_source).
 
"SELECT single WERKS FROM MTK_CLASS_DATA INTO @DATA(ld_i_plant_root_source).
 
"SELECT single VBELN FROM MTK_CLASS_DATA INTO @DATA(ld_i_sales_order_root_source).
 
"SELECT single POSNR FROM MTK_CLASS_DATA INTO @DATA(ld_i_sales_order_item_root_source).
 
"SELECT single PLNNR FROM TSK_CLASS_DATA INTO @DATA(ld_e_plnnr_target).
 
"SELECT single DATUM FROM SY INTO @DATA(ld_i_key_date_source).
 
 
DATA(ld_i_copy_objects_by_tsk) = ' '.
 
DATA(ld_i_flg_consistency_check) = 'X'.
 
 
DATA(ld_i_flg_ecm_recalculation) = 'X'.
 
"SELECT single AENNR FROM TSK_CLASS_DATA INTO @DATA(ld_i_ecn_s).
DATA(ld_i_ecn_s) = ' '.
 
"SELECT single PLNAL FROM TSK_CLASS_DATA INTO @DATA(ld_e_plnal_target).
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_i_key_date_s).
 
"SELECT single WERKS FROM TSK_CLASS_DATA INTO @DATA(ld_e_plant_target).
 
 
"SELECT single PLNTY FROM TSK_CLASS_DATA INTO @DATA(ld_i_plnty_source).
 
"SELECT single HANDLE FROM TSK_CLASS_DATA INTO @DATA(ld_e_handle_target).
 
 
"SELECT single PLNNR FROM TSK_CLASS_DATA INTO @DATA(ld_i_plnnr_source).
 
 
"SELECT single PLNAL FROM TSK_CLASS_DATA INTO @DATA(ld_i_plnal_source).
 
"SELECT single PLNTY FROM TSK_CLASS_DATA INTO @DATA(ld_i_plnty_target).
 
"SELECT single PLNNR FROM TSK_CLASS_DATA INTO @DATA(ld_i_plnnr_target).
DATA(ld_i_plnnr_target) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!