SAP MC_PG_GET_COPA Function Module for NOTRANSL: Uebernahme eines Plans aus dem CO/PA
MC_PG_GET_COPA is a standard mc pg get copa 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: Uebernahme eines Plans aus dem CO/PA 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 mc pg get copa FM, simply by entering the name MC_PG_GET_COPA into the relevant SAP transaction such as SE37 or SE38.
Function Group: MCP2
Program Name: SAPLMCP2
Main Program: SAPLMCP2
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MC_PG_GET_COPA 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 'MC_PG_GET_COPA'"NOTRANSL: Uebernahme eines Plans aus dem CO/PA.
EXPORTING
I_BISDAT = "
I_WERKS = "
I_ERKRS = "
I_MATFNAM = "
I_MNGFNAM = "
* I_TEST = ' ' "Character Field of Length 1
I_VERSI = "
I_VETXT = "Version Text
I_VONDAT = "
I_VRSIO = "
TABLES
ICEPL8 = "
EXCEPTIONS
NO_MATERIAL_FOUND = 1
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_SAPLMCP2_008 User Exit: Processing Header Data in a Purchase Order from an IDoc
EXIT_SAPLMCP2_009 User Exit: Processing Item Data in a Purchase Order from an IDoc
IMPORTING Parameters details for MC_PG_GET_COPA
I_BISDAT -
Data type: CEPL7-BISDATOptional: No
Call by Reference: No ( called with pass by value option)
I_WERKS -
Data type: CEPL7-WERKSOptional: No
Call by Reference: No ( called with pass by value option)
I_ERKRS -
Data type: CEPL7-ERKRSOptional: No
Call by Reference: No ( called with pass by value option)
I_MATFNAM -
Data type: CEPL7-MATFNAMOptional: No
Call by Reference: No ( called with pass by value option)
I_MNGFNAM -
Data type: CEPL7-MNGFNAMOptional: No
Call by Reference: No ( called with pass by value option)
I_TEST - Character Field of Length 1
Data type: CHAR01Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_VERSI -
Data type: CEPL7-VERSIOptional: No
Call by Reference: No ( called with pass by value option)
I_VETXT - Version Text
Data type: CEPL7-VETXTOptional: No
Call by Reference: No ( called with pass by value option)
I_VONDAT -
Data type: CEPL7-VONDATOptional: No
Call by Reference: No ( called with pass by value option)
I_VRSIO -
Data type: CEPL7-VRSIOOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for MC_PG_GET_COPA
ICEPL8 -
Data type: CEPL8Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_MATERIAL_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MC_PG_GET_COPA 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: | ||||
| lt_icepl8 | TYPE STANDARD TABLE OF CEPL8, " | |||
| lv_i_bisdat | TYPE CEPL7-BISDAT, " | |||
| lv_no_material_found | TYPE CEPL7, " | |||
| lv_i_werks | TYPE CEPL7-WERKS, " | |||
| lv_i_erkrs | TYPE CEPL7-ERKRS, " | |||
| lv_i_matfnam | TYPE CEPL7-MATFNAM, " | |||
| lv_i_mngfnam | TYPE CEPL7-MNGFNAM, " | |||
| lv_i_test | TYPE CHAR01, " SPACE | |||
| lv_i_versi | TYPE CEPL7-VERSI, " | |||
| lv_i_vetxt | TYPE CEPL7-VETXT, " | |||
| lv_i_vondat | TYPE CEPL7-VONDAT, " | |||
| lv_i_vrsio | TYPE CEPL7-VRSIO. " |
|   CALL FUNCTION 'MC_PG_GET_COPA' "NOTRANSL: Uebernahme eines Plans aus dem CO/PA |
| EXPORTING | ||
| I_BISDAT | = lv_i_bisdat | |
| I_WERKS | = lv_i_werks | |
| I_ERKRS | = lv_i_erkrs | |
| I_MATFNAM | = lv_i_matfnam | |
| I_MNGFNAM | = lv_i_mngfnam | |
| I_TEST | = lv_i_test | |
| I_VERSI | = lv_i_versi | |
| I_VETXT | = lv_i_vetxt | |
| I_VONDAT | = lv_i_vondat | |
| I_VRSIO | = lv_i_vrsio | |
| TABLES | ||
| ICEPL8 | = lt_icepl8 | |
| EXCEPTIONS | ||
| NO_MATERIAL_FOUND = 1 | ||
| . " MC_PG_GET_COPA | ||
ABAP code using 7.40 inline data declarations to call FM MC_PG_GET_COPA
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 BISDAT FROM CEPL7 INTO @DATA(ld_i_bisdat). | ||||
| "SELECT single WERKS FROM CEPL7 INTO @DATA(ld_i_werks). | ||||
| "SELECT single ERKRS FROM CEPL7 INTO @DATA(ld_i_erkrs). | ||||
| "SELECT single MATFNAM FROM CEPL7 INTO @DATA(ld_i_matfnam). | ||||
| "SELECT single MNGFNAM FROM CEPL7 INTO @DATA(ld_i_mngfnam). | ||||
| DATA(ld_i_test) | = ' '. | |||
| "SELECT single VERSI FROM CEPL7 INTO @DATA(ld_i_versi). | ||||
| "SELECT single VETXT FROM CEPL7 INTO @DATA(ld_i_vetxt). | ||||
| "SELECT single VONDAT FROM CEPL7 INTO @DATA(ld_i_vondat). | ||||
| "SELECT single VRSIO FROM CEPL7 INTO @DATA(ld_i_vrsio). | ||||
Search for further information about these or an SAP related objects