SAP BM_OBJECT_COPY Function Module for Copy Object
BM_OBJECT_COPY is a standard bm object 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 Object 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 bm object copy FM, simply by entering the name BM_OBJECT_COPY into the relevant SAP transaction such as SE37 or SE38.
Function Group: SF01
Program Name: SAPLSF01
Main Program: SAPLSF01
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function BM_OBJECT_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 'BM_OBJECT_COPY'"Copy Object.
EXPORTING
I_OBJECT_TYPE_FROM = "Object Type
* I_INITIAL_SCREEN = 'X' "
* I_SCREEN = 'X' "
* I_POPUP = "
* I_STARTING_AT_X = "
* I_STARTING_AT_Y = "
I_OBJECT_ID_FROM = "Object key
* I_OBJECT_TYPE_TO = "Object Type
* I_OBJECT_ID_TO = "Object key
* I_LANGUAGE = SY-LANGU "Language
* I_LANGUAGE_CHECK = 'X' "
* I_DEVCLASS = "Development Class
* I_CICO_DIALOG = 'X' "
* I_CICO_REQNO = "Transfer Order Number
IMPORTING
E_OBJECT_ID = "Object Definition
E_OBJECT_TEXT = "Description
E_DEVCLASS = "Development class for Change and Transport Organizer
E_MESSAGES = "Messages
E_LANGUAGE_CHECK = "
E_ERROR_OCCURRED = "
CHANGING
* R_SPECIFIC_DATA = "Structure overview
EXCEPTIONS
CANCELLED = 1
IMPORTING Parameters details for BM_OBJECT_COPY
I_OBJECT_TYPE_FROM - Object Type
Data type: BMOBJECT-TYPEOptional: No
Call by Reference: No ( called with pass by value option)
I_INITIAL_SCREEN -
Data type: BMT_FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SCREEN -
Data type: BMT_FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_POPUP -
Data type: BMT_FLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
I_STARTING_AT_X -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
I_STARTING_AT_Y -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
I_OBJECT_ID_FROM - Object key
Data type: BMOBJECT-IDOptional: No
Call by Reference: No ( called with pass by value option)
I_OBJECT_TYPE_TO - Object Type
Data type: BMOBJECT-TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_OBJECT_ID_TO - Object key
Data type: BMOBJECT-IDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_LANGUAGE - Language
Data type: SY-LANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_LANGUAGE_CHECK -
Data type: BMT_FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DEVCLASS - Development Class
Data type: BMOBJECT-DEVCLASSOptional: Yes
Call by Reference: No ( called with pass by value option)
I_CICO_DIALOG -
Data type: BMT_FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CICO_REQNO - Transfer Order Number
Data type: RPYGSGF-CICO_REQNOOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BM_OBJECT_COPY
E_OBJECT_ID - Object Definition
Data type: BMOBJECT-IDOptional: No
Call by Reference: Yes
E_OBJECT_TEXT - Description
Data type: BMOBJECT-NAMEOptional: No
Call by Reference: Yes
E_DEVCLASS - Development class for Change and Transport Organizer
Data type: DEVCLASSOptional: No
Call by Reference: Yes
E_MESSAGES - Messages
Data type: BMMSGTABOptional: No
Call by Reference: Yes
E_LANGUAGE_CHECK -
Data type: BMT_FLAGOptional: No
Call by Reference: Yes
E_ERROR_OCCURRED -
Data type: BMT_FLAGOptional: No
Call by Reference: Yes
CHANGING Parameters details for BM_OBJECT_COPY
R_SPECIFIC_DATA - Structure overview
Data type: ANYOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CANCELLED - Copying cancelled
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for BM_OBJECT_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_cancelled | TYPE STRING, " | |||
| lv_e_object_id | TYPE BMOBJECT-ID, " | |||
| lv_r_specific_data | TYPE ANY, " | |||
| lv_i_object_type_from | TYPE BMOBJECT-TYPE, " | |||
| lv_i_initial_screen | TYPE BMT_FLAG, " 'X' | |||
| lv_i_screen | TYPE BMT_FLAG, " 'X' | |||
| lv_i_popup | TYPE BMT_FLAG, " | |||
| lv_i_starting_at_x | TYPE I, " | |||
| lv_i_starting_at_y | TYPE I, " | |||
| lv_e_object_text | TYPE BMOBJECT-NAME, " | |||
| lv_i_object_id_from | TYPE BMOBJECT-ID, " | |||
| lv_e_devclass | TYPE DEVCLASS, " | |||
| lv_i_object_type_to | TYPE BMOBJECT-TYPE, " | |||
| lv_e_messages | TYPE BMMSGTAB, " | |||
| lv_i_object_id_to | TYPE BMOBJECT-ID, " | |||
| lv_i_language | TYPE SY-LANGU, " SY-LANGU | |||
| lv_e_language_check | TYPE BMT_FLAG, " | |||
| lv_e_error_occurred | TYPE BMT_FLAG, " | |||
| lv_i_language_check | TYPE BMT_FLAG, " 'X' | |||
| lv_i_devclass | TYPE BMOBJECT-DEVCLASS, " | |||
| lv_i_cico_dialog | TYPE BMT_FLAG, " 'X' | |||
| lv_i_cico_reqno | TYPE RPYGSGF-CICO_REQNO. " |
|   CALL FUNCTION 'BM_OBJECT_COPY' "Copy Object |
| EXPORTING | ||
| I_OBJECT_TYPE_FROM | = lv_i_object_type_from | |
| I_INITIAL_SCREEN | = lv_i_initial_screen | |
| I_SCREEN | = lv_i_screen | |
| I_POPUP | = lv_i_popup | |
| I_STARTING_AT_X | = lv_i_starting_at_x | |
| I_STARTING_AT_Y | = lv_i_starting_at_y | |
| I_OBJECT_ID_FROM | = lv_i_object_id_from | |
| I_OBJECT_TYPE_TO | = lv_i_object_type_to | |
| I_OBJECT_ID_TO | = lv_i_object_id_to | |
| I_LANGUAGE | = lv_i_language | |
| I_LANGUAGE_CHECK | = lv_i_language_check | |
| I_DEVCLASS | = lv_i_devclass | |
| I_CICO_DIALOG | = lv_i_cico_dialog | |
| I_CICO_REQNO | = lv_i_cico_reqno | |
| IMPORTING | ||
| E_OBJECT_ID | = lv_e_object_id | |
| E_OBJECT_TEXT | = lv_e_object_text | |
| E_DEVCLASS | = lv_e_devclass | |
| E_MESSAGES | = lv_e_messages | |
| E_LANGUAGE_CHECK | = lv_e_language_check | |
| E_ERROR_OCCURRED | = lv_e_error_occurred | |
| CHANGING | ||
| R_SPECIFIC_DATA | = lv_r_specific_data | |
| EXCEPTIONS | ||
| CANCELLED = 1 | ||
| . " BM_OBJECT_COPY | ||
ABAP code using 7.40 inline data declarations to call FM BM_OBJECT_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 ID FROM BMOBJECT INTO @DATA(ld_e_object_id). | ||||
| "SELECT single TYPE FROM BMOBJECT INTO @DATA(ld_i_object_type_from). | ||||
| DATA(ld_i_initial_screen) | = 'X'. | |||
| DATA(ld_i_screen) | = 'X'. | |||
| "SELECT single NAME FROM BMOBJECT INTO @DATA(ld_e_object_text). | ||||
| "SELECT single ID FROM BMOBJECT INTO @DATA(ld_i_object_id_from). | ||||
| "SELECT single TYPE FROM BMOBJECT INTO @DATA(ld_i_object_type_to). | ||||
| "SELECT single ID FROM BMOBJECT INTO @DATA(ld_i_object_id_to). | ||||
| "SELECT single LANGU FROM SY INTO @DATA(ld_i_language). | ||||
| DATA(ld_i_language) | = SY-LANGU. | |||
| DATA(ld_i_language_check) | = 'X'. | |||
| "SELECT single DEVCLASS FROM BMOBJECT INTO @DATA(ld_i_devclass). | ||||
| DATA(ld_i_cico_dialog) | = 'X'. | |||
| "SELECT single CICO_REQNO FROM RPYGSGF INTO @DATA(ld_i_cico_reqno). | ||||
Search for further information about these or an SAP related objects