SAP MPR1_READ_ARTICLES Function Module for Function Module to read Articles with external Forecast









MPR1_READ_ARTICLES is a standard mpr1 read articles SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Function Module to read Articles with external Forecast 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 mpr1 read articles FM, simply by entering the name MPR1_READ_ARTICLES into the relevant SAP transaction such as SE37 or SE38.

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



Function MPR1_READ_ARTICLES 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 'MPR1_READ_ARTICLES'"Function Module to read Articles with external Forecast
EXPORTING
I_PARAMETER = "
I_FABKL = "
I_WERKS = "

TABLES
T_ARTICLES = "
T_MESSAGES = "
R_MATNR = "

EXCEPTIONS
ERROR_FOUND = 1 NO_ARTICLES_FOUND = 2
.




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_SAPLMPR1_001 User Exit for Importing Forecast Values on a Customer-Specific Basis
EXIT_SAPLMPR1_002 Filter for Materials That Do Not Have To Be Forecast Externally

IMPORTING Parameters details for MPR1_READ_ARTICLES

I_PARAMETER -

Data type: SMPR1001
Optional: No
Call by Reference: Yes

I_FABKL -

Data type: T001W-FABKL
Optional: No
Call by Reference: Yes

I_WERKS -

Data type: T001W-WERKS
Optional: No
Call by Reference: Yes

TABLES Parameters details for MPR1_READ_ARTICLES

T_ARTICLES -

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

T_MESSAGES -

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

R_MATNR -

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

EXCEPTIONS details

ERROR_FOUND -

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

NO_ARTICLES_FOUND -

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

Copy and paste ABAP code example for MPR1_READ_ARTICLES 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_t_articles  TYPE STANDARD TABLE OF MPR1T_T_ARTICLES, "   
lv_error_found  TYPE MPR1T_T_ARTICLES, "   
lv_i_parameter  TYPE SMPR1001, "   
lv_i_fabkl  TYPE T001W-FABKL, "   
lt_t_messages  TYPE STANDARD TABLE OF MPR1T_T_MESSAGES, "   
lv_no_articles_found  TYPE MPR1T_T_MESSAGES, "   
lv_i_werks  TYPE T001W-WERKS, "   
lt_r_matnr  TYPE STANDARD TABLE OF T001W. "   

  CALL FUNCTION 'MPR1_READ_ARTICLES'  "Function Module to read Articles with external Forecast
    EXPORTING
         I_PARAMETER = lv_i_parameter
         I_FABKL = lv_i_fabkl
         I_WERKS = lv_i_werks
    TABLES
         T_ARTICLES = lt_t_articles
         T_MESSAGES = lt_t_messages
         R_MATNR = lt_r_matnr
    EXCEPTIONS
        ERROR_FOUND = 1
        NO_ARTICLES_FOUND = 2
. " MPR1_READ_ARTICLES




ABAP code using 7.40 inline data declarations to call FM MPR1_READ_ARTICLES

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 FABKL FROM T001W INTO @DATA(ld_i_fabkl).
 
 
 
"SELECT single WERKS FROM T001W INTO @DATA(ld_i_werks).
 
 


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!