SAP DD_MCOB_COPY Function Module for Copy routine for class matchcode objects (MCOB)









DD_MCOB_COPY is a standard dd mcob 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 Copy routine for class matchcode objects (MCOB) 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 dd mcob copy FM, simply by entering the name DD_MCOB_COPY into the relevant SAP transaction such as SE37 or SE38.

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



Function DD_MCOB_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 'DD_MCOB_COPY'"Copy routine for class matchcode objects (MCOB)
EXPORTING
SRC_MCONAME = "
DST_MCONAME = "
* FORCE = ' ' "
* GET_STATE = 'M' "
* WITHTEXT = ' ' "
* LANGU = SY-LANGU "
* PRID = 0 "

EXCEPTIONS
ILLEGAL_STATE = 1 WRONG_DST_NAME = 2 DST_NAME_ALREADY_EXISTS = 3 SRC_NAME_NOT_EXISTS = 4 OP_FAILURE = 5
.



IMPORTING Parameters details for DD_MCOB_COPY

SRC_MCONAME -

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

DST_MCONAME -

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

FORCE -

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

GET_STATE -

Data type: DDREFSTRUC-STATE
Default: 'M'
Optional: Yes
Call by Reference: No ( called with pass by value option)

WITHTEXT -

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

LANGU -

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

PRID -

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

EXCEPTIONS details

ILLEGAL_STATE -

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

WRONG_DST_NAME -

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

DST_NAME_ALREADY_EXISTS -

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

SRC_NAME_NOT_EXISTS -

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

OP_FAILURE -

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

Copy and paste ABAP code example for DD_MCOB_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_src_mconame  TYPE DD20L-MCONAME, "   
lv_illegal_state  TYPE DD20L, "   
lv_dst_mconame  TYPE DD20L-MCONAME, "   
lv_wrong_dst_name  TYPE DD20L, "   
lv_force  TYPE DDREFSTRUC-STATE, "   ' '
lv_dst_name_already_exists  TYPE DDREFSTRUC, "   
lv_get_state  TYPE DDREFSTRUC-STATE, "   'M'
lv_src_name_not_exists  TYPE DDREFSTRUC, "   
lv_withtext  TYPE DDREFSTRUC-BOOL, "   ' '
lv_op_failure  TYPE DDREFSTRUC, "   
lv_langu  TYPE DDREFSTRUC, "   SY-LANGU
lv_prid  TYPE SY-TABIX. "   0

  CALL FUNCTION 'DD_MCOB_COPY'  "Copy routine for class matchcode objects (MCOB)
    EXPORTING
         SRC_MCONAME = lv_src_mconame
         DST_MCONAME = lv_dst_mconame
         FORCE = lv_force
         GET_STATE = lv_get_state
         WITHTEXT = lv_withtext
         LANGU = lv_langu
         PRID = lv_prid
    EXCEPTIONS
        ILLEGAL_STATE = 1
        WRONG_DST_NAME = 2
        DST_NAME_ALREADY_EXISTS = 3
        SRC_NAME_NOT_EXISTS = 4
        OP_FAILURE = 5
. " DD_MCOB_COPY




ABAP code using 7.40 inline data declarations to call FM DD_MCOB_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 MCONAME FROM DD20L INTO @DATA(ld_src_mconame).
 
 
"SELECT single MCONAME FROM DD20L INTO @DATA(ld_dst_mconame).
 
 
"SELECT single STATE FROM DDREFSTRUC INTO @DATA(ld_force).
DATA(ld_force) = ' '.
 
 
"SELECT single STATE FROM DDREFSTRUC INTO @DATA(ld_get_state).
DATA(ld_get_state) = 'M'.
 
 
"SELECT single BOOL FROM DDREFSTRUC INTO @DATA(ld_withtext).
DATA(ld_withtext) = ' '.
 
 
DATA(ld_langu) = SY-LANGU.
 
"SELECT single TABIX FROM SY INTO @DATA(ld_prid).
 


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!