SAP TR_COPY_COMM Function Module for









TR_COPY_COMM is a standard tr copy comm 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 tr copy comm FM, simply by entering the name TR_COPY_COMM into the relevant SAP transaction such as SE37 or SE38.

Function Group: STRI
Program Name: SAPLSTRI
Main Program: SAPLSTRI
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function TR_COPY_COMM 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 'TR_COPY_COMM'"
EXPORTING
* WI_DIALOG = 'X' "Flag, whether information messages sent
WI_TRKORR_FROM = "Initial correction number
WI_TRKORR_TO = "Target correction number
WI_WITHOUT_DOCUMENTATION = "Flag, documentation is not to be copied

EXCEPTIONS
DB_ACCESS_ERROR = 1 WRONG_CATEGORY = 10 OBJECT_NOT_PATCHABLE = 11 TRKORR_FROM_NOT_EXIST = 2 TRKORR_TO_IS_REPAIR = 3 TRKORR_TO_LOCKED = 4 TRKORR_TO_NOT_EXIST = 5 TRKORR_TO_RELEASED = 6 USER_NOT_OWNER = 7 NO_AUTHORIZATION = 8 WRONG_CLIENT = 9
.



IMPORTING Parameters details for TR_COPY_COMM

WI_DIALOG - Flag, whether information messages sent

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

WI_TRKORR_FROM - Initial correction number

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

WI_TRKORR_TO - Target correction number

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

WI_WITHOUT_DOCUMENTATION - Flag, documentation is not to be copied

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

EXCEPTIONS details

DB_ACCESS_ERROR - Database access error

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

WRONG_CATEGORY - Different category (source - target)

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

OBJECT_NOT_PATCHABLE -

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

TRKORR_FROM_NOT_EXIST - first correction does not exist

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

TRKORR_TO_IS_REPAIR - Target correction is repair

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

TRKORR_TO_LOCKED - Command file TRKORR_TO blocked, (SM12)

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

TRKORR_TO_NOT_EXIST - second correction does not exist

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

TRKORR_TO_RELEASED - second correction already released

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

USER_NOT_OWNER - User is not owner of first request

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

NO_AUTHORIZATION - No authorization for this function

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

WRONG_CLIENT - Different clients (source - target)

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

Copy and paste ABAP code example for TR_COPY_COMM 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_wi_dialog  TYPE TRPARI-W_DIALOG, "   'X'
lv_db_access_error  TYPE TRPARI, "   
lv_wrong_category  TYPE TRPARI, "   
lv_object_not_patchable  TYPE TRPARI, "   
lv_wi_trkorr_from  TYPE E070-TRKORR, "   
lv_trkorr_from_not_exist  TYPE E070, "   
lv_wi_trkorr_to  TYPE E070-TRKORR, "   
lv_trkorr_to_is_repair  TYPE E070, "   
lv_trkorr_to_locked  TYPE E070, "   
lv_wi_without_documentation  TYPE TRPARI-W_NO_DOCU, "   
lv_trkorr_to_not_exist  TYPE TRPARI, "   
lv_trkorr_to_released  TYPE TRPARI, "   
lv_user_not_owner  TYPE TRPARI, "   
lv_no_authorization  TYPE TRPARI, "   
lv_wrong_client  TYPE TRPARI. "   

  CALL FUNCTION 'TR_COPY_COMM'  "
    EXPORTING
         WI_DIALOG = lv_wi_dialog
         WI_TRKORR_FROM = lv_wi_trkorr_from
         WI_TRKORR_TO = lv_wi_trkorr_to
         WI_WITHOUT_DOCUMENTATION = lv_wi_without_documentation
    EXCEPTIONS
        DB_ACCESS_ERROR = 1
        WRONG_CATEGORY = 10
        OBJECT_NOT_PATCHABLE = 11
        TRKORR_FROM_NOT_EXIST = 2
        TRKORR_TO_IS_REPAIR = 3
        TRKORR_TO_LOCKED = 4
        TRKORR_TO_NOT_EXIST = 5
        TRKORR_TO_RELEASED = 6
        USER_NOT_OWNER = 7
        NO_AUTHORIZATION = 8
        WRONG_CLIENT = 9
. " TR_COPY_COMM




ABAP code using 7.40 inline data declarations to call FM TR_COPY_COMM

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 W_DIALOG FROM TRPARI INTO @DATA(ld_wi_dialog).
DATA(ld_wi_dialog) = 'X'.
 
 
 
 
"SELECT single TRKORR FROM E070 INTO @DATA(ld_wi_trkorr_from).
 
 
"SELECT single TRKORR FROM E070 INTO @DATA(ld_wi_trkorr_to).
 
 
 
"SELECT single W_NO_DOCU FROM TRPARI INTO @DATA(ld_wi_without_documentation).
 
 
 
 
 
 


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!