SAP MCP_READ_VALUES Function Module for NOTRANSL: Aggregation der Planwerte über Produktgruppenhierarchie
MCP_READ_VALUES is a standard mcp read values 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: Aggregation der Planwerte über Produktgruppenhierarchie 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 mcp read values FM, simply by entering the name MCP_READ_VALUES 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 MCP_READ_VALUES 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 'MCP_READ_VALUES'"NOTRANSL: Aggregation der Planwerte über Produktgruppenhierarchie.
EXPORTING
* IDATUB = SY-DATUM "'To' date for product group disaggregation
* IDATUV = SY-DATUM "'From' date for product group disaggregation
* IFABKL = ' ' "Product group plant
I_GSTRU = "
I_PLOBO = "
* I_VRSIO = '000' "
SAV_KENNZAHL = "
TABLES
IVBTAB = "Table of product group consumption
EXCEPTIONS
CALENDER_NOT_COMPLETE = 1 DATE_INVALID_FOR_WEEK_CALC = 2 FACTORY_CAL_READ_NOT_POSSIBLE = 3 INFOSTRUCTURE_NOT_FOUND = 4 PG_STRUCTURE_NOT_POSSIBLE = 5 PLANTCODE_NOT_IN_T001W = 6
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 MCP_READ_VALUES
IDATUB - 'To' date for product group disaggregation
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
IDATUV - 'From' date for product group disaggregation
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
IFABKL - Product group plant
Data type: T001W-FABKLDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_GSTRU -
Data type: TMC4-GSTRUOptional: No
Call by Reference: No ( called with pass by value option)
I_PLOBO -
Data type: PGAN-PLOBOOptional: No
Call by Reference: No ( called with pass by value option)
I_VRSIO -
Data type: P445X-VRSIODefault: '000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SAV_KENNZAHL -
Data type: IKEYF-FIELDNAMEOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for MCP_READ_VALUES
IVBTAB - Table of product group consumption
Data type: VBTABOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CALENDER_NOT_COMPLETE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DATE_INVALID_FOR_WEEK_CALC - Invalid date for week calculation
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FACTORY_CAL_READ_NOT_POSSIBLE - Error Reading Factory Calendar
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INFOSTRUCTURE_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PG_STRUCTURE_NOT_POSSIBLE - Error reading product group structure
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PLANTCODE_NOT_IN_T001W - No entry for plant in table 001W
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MCP_READ_VALUES 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_idatub | TYPE SY-DATUM, " SY-DATUM | |||
| lt_ivbtab | TYPE STANDARD TABLE OF VBTAB, " | |||
| lv_calender_not_complete | TYPE VBTAB, " | |||
| lv_idatuv | TYPE SY-DATUM, " SY-DATUM | |||
| lv_date_invalid_for_week_calc | TYPE SY, " | |||
| lv_ifabkl | TYPE T001W-FABKL, " SPACE | |||
| lv_factory_cal_read_not_possible | TYPE T001W, " | |||
| lv_i_gstru | TYPE TMC4-GSTRU, " | |||
| lv_infostructure_not_found | TYPE TMC4, " | |||
| lv_i_plobo | TYPE PGAN-PLOBO, " | |||
| lv_pg_structure_not_possible | TYPE PGAN, " | |||
| lv_i_vrsio | TYPE P445X-VRSIO, " '000' | |||
| lv_plantcode_not_in_t001w | TYPE P445X, " | |||
| lv_sav_kennzahl | TYPE IKEYF-FIELDNAME. " |
|   CALL FUNCTION 'MCP_READ_VALUES' "NOTRANSL: Aggregation der Planwerte über Produktgruppenhierarchie |
| EXPORTING | ||
| IDATUB | = lv_idatub | |
| IDATUV | = lv_idatuv | |
| IFABKL | = lv_ifabkl | |
| I_GSTRU | = lv_i_gstru | |
| I_PLOBO | = lv_i_plobo | |
| I_VRSIO | = lv_i_vrsio | |
| SAV_KENNZAHL | = lv_sav_kennzahl | |
| TABLES | ||
| IVBTAB | = lt_ivbtab | |
| EXCEPTIONS | ||
| CALENDER_NOT_COMPLETE = 1 | ||
| DATE_INVALID_FOR_WEEK_CALC = 2 | ||
| FACTORY_CAL_READ_NOT_POSSIBLE = 3 | ||
| INFOSTRUCTURE_NOT_FOUND = 4 | ||
| PG_STRUCTURE_NOT_POSSIBLE = 5 | ||
| PLANTCODE_NOT_IN_T001W = 6 | ||
| . " MCP_READ_VALUES | ||
ABAP code using 7.40 inline data declarations to call FM MCP_READ_VALUES
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 DATUM FROM SY INTO @DATA(ld_idatub). | ||||
| DATA(ld_idatub) | = SY-DATUM. | |||
| "SELECT single DATUM FROM SY INTO @DATA(ld_idatuv). | ||||
| DATA(ld_idatuv) | = SY-DATUM. | |||
| "SELECT single FABKL FROM T001W INTO @DATA(ld_ifabkl). | ||||
| DATA(ld_ifabkl) | = ' '. | |||
| "SELECT single GSTRU FROM TMC4 INTO @DATA(ld_i_gstru). | ||||
| "SELECT single PLOBO FROM PGAN INTO @DATA(ld_i_plobo). | ||||
| "SELECT single VRSIO FROM P445X INTO @DATA(ld_i_vrsio). | ||||
| DATA(ld_i_vrsio) | = '000'. | |||
| "SELECT single FIELDNAME FROM IKEYF INTO @DATA(ld_sav_kennzahl). | ||||
Search for further information about these or an SAP related objects