SAP BAPI_MATERIAL_STOCK_REQ_LIST Function Module for Material - Current Requirements/Stock List
BAPI_MATERIAL_STOCK_REQ_LIST is a standard bapi material stock req list SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Material - Current Requirements/Stock List 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 bapi material stock req list FM, simply by entering the name BAPI_MATERIAL_STOCK_REQ_LIST into the relevant SAP transaction such as SE37 or SE38.
Function Group: MRP1001
Program Name: SAPLMRP1001
Main Program: SAPLMRP1001
Appliation area:
Release date: 13-Feb-2004
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_MATERIAL_STOCK_REQ_LIST 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 'BAPI_MATERIAL_STOCK_REQ_LIST'"Material - Current Requirements/Stock List.
EXPORTING
MATERIAL = "Material Number
* GET_TOTAL_LINES = "Indicator: Determination of Period Totals Display
* IGNORE_BUFFER = "Indicator: Data Determination of Database (Not from Buffer)
* MATERIAL_EVG = "
* PLANT = "Plant
* MRP_AREA = "MRP Area
* PLAN_SCENARIO = "Planning Scenario of Long-Term Planning
* SELECTION_RULE = "Selection Rule
* DISPLAY_FILTER = "Name of Display Filter
* PERIOD_INDICATOR = "Internal Period Indicator
* GET_ITEM_DETAILS = "Indicator: Determination of Detail Display for MRP Elements
* GET_IND_LINES = 'X' "Indicator: Determination of Single-Line Display
IMPORTING
MRP_LIST = "MRP: MRP List
MRP_CONTROL_PARAM = "Material Requirements Planning: Control Parameters for Material
MRP_STOCK_DETAIL = "MRP: Statistics Fields for Stocks
RETURN = "Return Parameters
TABLES
* MRP_ITEMS = "MRP: MRP Document Item
* MRP_IND_LINES = "MRP: Single Lines of MRP Elements
* MRP_TOTAL_LINES = "MRP: Totals Line MRP Elements
* EXTENSIONOUT = "Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
IMPORTING Parameters details for BAPI_MATERIAL_STOCK_REQ_LIST
MATERIAL - Material Number
Data type: BAPI_MRP_MAT_PARAM-MATERIALOptional: No
Call by Reference: No ( called with pass by value option)
GET_TOTAL_LINES - Indicator: Determination of Period Totals Display
Data type: BAPI_MRP_LIST_PARAM-GET_TOTAL_LINESOptional: Yes
Call by Reference: No ( called with pass by value option)
IGNORE_BUFFER - Indicator: Data Determination of Database (Not from Buffer)
Data type: BAPI_MRP_LIST_PARAM-IGNORE_BUFFEROptional: Yes
Call by Reference: No ( called with pass by value option)
MATERIAL_EVG -
Data type: BAPIMGVMATNROptional: Yes
Call by Reference: No ( called with pass by value option)
PLANT - Plant
Data type: BAPI_MRP_MAT_PARAM-PLANTOptional: Yes
Call by Reference: No ( called with pass by value option)
MRP_AREA - MRP Area
Data type: BAPI_MRP_MAT_PARAM-MRP_AREAOptional: Yes
Call by Reference: No ( called with pass by value option)
PLAN_SCENARIO - Planning Scenario of Long-Term Planning
Data type: BAPI_MRP_MAT_PARAM-PLAN_SCENARIOOptional: Yes
Call by Reference: No ( called with pass by value option)
SELECTION_RULE - Selection Rule
Data type: BAPI_MRP_LIST_PARAM-SELECTION_RULEOptional: Yes
Call by Reference: No ( called with pass by value option)
DISPLAY_FILTER - Name of Display Filter
Data type: BAPI_MRP_LIST_PARAM-DISPLAY_FILTEROptional: Yes
Call by Reference: No ( called with pass by value option)
PERIOD_INDICATOR - Internal Period Indicator
Data type: BAPI_MRP_LIST_PARAM-PERIOD_INDICATOROptional: Yes
Call by Reference: No ( called with pass by value option)
GET_ITEM_DETAILS - Indicator: Determination of Detail Display for MRP Elements
Data type: BAPI_MRP_LIST_PARAM-GET_ITEM_DETAILSOptional: Yes
Call by Reference: No ( called with pass by value option)
GET_IND_LINES - Indicator: Determination of Single-Line Display
Data type: BAPI_MRP_LIST_PARAM-GET_IND_LINESDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_MATERIAL_STOCK_REQ_LIST
MRP_LIST - MRP: MRP List
Data type: BAPI_MRP_LISTOptional: No
Call by Reference: No ( called with pass by value option)
MRP_CONTROL_PARAM - Material Requirements Planning: Control Parameters for Material
Data type: BAPI_MRP_CONTROL_PARAMOptional: No
Call by Reference: No ( called with pass by value option)
MRP_STOCK_DETAIL - MRP: Statistics Fields for Stocks
Data type: BAPI_MRP_STOCK_DETAILOptional: No
Call by Reference: No ( called with pass by value option)
RETURN - Return Parameters
Data type: BAPIRET2Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_MATERIAL_STOCK_REQ_LIST
MRP_ITEMS - MRP: MRP Document Item
Data type: BAPI_MRP_ITEMSOptional: Yes
Call by Reference: Yes
MRP_IND_LINES - MRP: Single Lines of MRP Elements
Data type: BAPI_MRP_IND_LINESOptional: Yes
Call by Reference: Yes
MRP_TOTAL_LINES - MRP: Totals Line MRP Elements
Data type: BAPI_MRP_TOTAL_LINESOptional: Yes
Call by Reference: Yes
EXTENSIONOUT - Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
Data type: BAPIPAREXOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_MATERIAL_STOCK_REQ_LIST 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_material | TYPE BAPI_MRP_MAT_PARAM-MATERIAL, " | |||
| lv_mrp_list | TYPE BAPI_MRP_LIST, " | |||
| lt_mrp_items | TYPE STANDARD TABLE OF BAPI_MRP_ITEMS, " | |||
| lv_get_total_lines | TYPE BAPI_MRP_LIST_PARAM-GET_TOTAL_LINES, " | |||
| lv_ignore_buffer | TYPE BAPI_MRP_LIST_PARAM-IGNORE_BUFFER, " | |||
| lv_material_evg | TYPE BAPIMGVMATNR, " | |||
| lv_plant | TYPE BAPI_MRP_MAT_PARAM-PLANT, " | |||
| lt_mrp_ind_lines | TYPE STANDARD TABLE OF BAPI_MRP_IND_LINES, " | |||
| lv_mrp_control_param | TYPE BAPI_MRP_CONTROL_PARAM, " | |||
| lv_mrp_area | TYPE BAPI_MRP_MAT_PARAM-MRP_AREA, " | |||
| lt_mrp_total_lines | TYPE STANDARD TABLE OF BAPI_MRP_TOTAL_LINES, " | |||
| lv_mrp_stock_detail | TYPE BAPI_MRP_STOCK_DETAIL, " | |||
| lv_return | TYPE BAPIRET2, " | |||
| lt_extensionout | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
| lv_plan_scenario | TYPE BAPI_MRP_MAT_PARAM-PLAN_SCENARIO, " | |||
| lv_selection_rule | TYPE BAPI_MRP_LIST_PARAM-SELECTION_RULE, " | |||
| lv_display_filter | TYPE BAPI_MRP_LIST_PARAM-DISPLAY_FILTER, " | |||
| lv_period_indicator | TYPE BAPI_MRP_LIST_PARAM-PERIOD_INDICATOR, " | |||
| lv_get_item_details | TYPE BAPI_MRP_LIST_PARAM-GET_ITEM_DETAILS, " | |||
| lv_get_ind_lines | TYPE BAPI_MRP_LIST_PARAM-GET_IND_LINES. " 'X' |
|   CALL FUNCTION 'BAPI_MATERIAL_STOCK_REQ_LIST' "Material - Current Requirements/Stock List |
| EXPORTING | ||
| MATERIAL | = lv_material | |
| GET_TOTAL_LINES | = lv_get_total_lines | |
| IGNORE_BUFFER | = lv_ignore_buffer | |
| MATERIAL_EVG | = lv_material_evg | |
| PLANT | = lv_plant | |
| MRP_AREA | = lv_mrp_area | |
| PLAN_SCENARIO | = lv_plan_scenario | |
| SELECTION_RULE | = lv_selection_rule | |
| DISPLAY_FILTER | = lv_display_filter | |
| PERIOD_INDICATOR | = lv_period_indicator | |
| GET_ITEM_DETAILS | = lv_get_item_details | |
| GET_IND_LINES | = lv_get_ind_lines | |
| IMPORTING | ||
| MRP_LIST | = lv_mrp_list | |
| MRP_CONTROL_PARAM | = lv_mrp_control_param | |
| MRP_STOCK_DETAIL | = lv_mrp_stock_detail | |
| RETURN | = lv_return | |
| TABLES | ||
| MRP_ITEMS | = lt_mrp_items | |
| MRP_IND_LINES | = lt_mrp_ind_lines | |
| MRP_TOTAL_LINES | = lt_mrp_total_lines | |
| EXTENSIONOUT | = lt_extensionout | |
| . " BAPI_MATERIAL_STOCK_REQ_LIST | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_MATERIAL_STOCK_REQ_LIST
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 MATERIAL FROM BAPI_MRP_MAT_PARAM INTO @DATA(ld_material). | ||||
| "SELECT single GET_TOTAL_LINES FROM BAPI_MRP_LIST_PARAM INTO @DATA(ld_get_total_lines). | ||||
| "SELECT single IGNORE_BUFFER FROM BAPI_MRP_LIST_PARAM INTO @DATA(ld_ignore_buffer). | ||||
| "SELECT single PLANT FROM BAPI_MRP_MAT_PARAM INTO @DATA(ld_plant). | ||||
| "SELECT single MRP_AREA FROM BAPI_MRP_MAT_PARAM INTO @DATA(ld_mrp_area). | ||||
| "SELECT single PLAN_SCENARIO FROM BAPI_MRP_MAT_PARAM INTO @DATA(ld_plan_scenario). | ||||
| "SELECT single SELECTION_RULE FROM BAPI_MRP_LIST_PARAM INTO @DATA(ld_selection_rule). | ||||
| "SELECT single DISPLAY_FILTER FROM BAPI_MRP_LIST_PARAM INTO @DATA(ld_display_filter). | ||||
| "SELECT single PERIOD_INDICATOR FROM BAPI_MRP_LIST_PARAM INTO @DATA(ld_period_indicator). | ||||
| "SELECT single GET_ITEM_DETAILS FROM BAPI_MRP_LIST_PARAM INTO @DATA(ld_get_item_details). | ||||
| "SELECT single GET_IND_LINES FROM BAPI_MRP_LIST_PARAM INTO @DATA(ld_get_ind_lines). | ||||
| DATA(ld_get_ind_lines) | = 'X'. | |||
Search for further information about these or an SAP related objects