SAP BAPI_MATERIAL_PLANNING Function Module for Material - Single-Item Planning Single/Multilevel









BAPI_MATERIAL_PLANNING is a standard bapi material planning 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 - Single-Item Planning Single/Multilevel 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 planning FM, simply by entering the name BAPI_MATERIAL_PLANNING 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_PLANNING 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_PLANNING'"Material - Single-Item Planning Single/Multilevel
EXPORTING
MATERIAL = "Material Number
* PLANT = "Plant
* MRP_AREA = "MRP Area
* PLAN_SCENARIO = "Planning Scenario of Long-Term Planning
* MRP_PLAN_PARAM = "MRP: Planning Parameters
* MATERIAL_EVG = "

IMPORTING
MRP_STATISTIC = "MRP: Planning Statistics
RETURN = "Return Parameters

TABLES
* MRP_LISTS = "MRP: MRP List
* EXTENSIONOUT = "Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
.



IMPORTING Parameters details for BAPI_MATERIAL_PLANNING

MATERIAL - Material Number

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

PLANT - Plant

Data type: BAPI_MRP_MAT_PARAM-PLANT
Optional: Yes
Call by Reference: No ( called with pass by value option)

MRP_AREA - MRP Area

Data type: BAPI_MRP_MAT_PARAM-MRP_AREA
Optional: 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_SCENARIO
Optional: Yes
Call by Reference: No ( called with pass by value option)

MRP_PLAN_PARAM - MRP: Planning Parameters

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

MATERIAL_EVG -

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

EXPORTING Parameters details for BAPI_MATERIAL_PLANNING

MRP_STATISTIC - MRP: Planning Statistics

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

RETURN - Return Parameters

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

TABLES Parameters details for BAPI_MATERIAL_PLANNING

MRP_LISTS - MRP: MRP List

Data type: BAPI_MRP_LIST
Optional: Yes
Call by Reference: Yes

EXTENSIONOUT - Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT

Data type: BAPIPAREX
Optional: Yes
Call by Reference: Yes

Copy and paste ABAP code example for BAPI_MATERIAL_PLANNING 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, "   
lt_mrp_lists  TYPE STANDARD TABLE OF BAPI_MRP_LIST, "   
lv_mrp_statistic  TYPE BAPI_MRP_STATISTIC, "   
lv_plant  TYPE BAPI_MRP_MAT_PARAM-PLANT, "   
lv_return  TYPE BAPIRET2, "   
lt_extensionout  TYPE STANDARD TABLE OF BAPIPAREX, "   
lv_mrp_area  TYPE BAPI_MRP_MAT_PARAM-MRP_AREA, "   
lv_plan_scenario  TYPE BAPI_MRP_MAT_PARAM-PLAN_SCENARIO, "   
lv_mrp_plan_param  TYPE BAPI_MRP_PLAN_PARAM, "   
lv_material_evg  TYPE BAPIMGVMATNR. "   

  CALL FUNCTION 'BAPI_MATERIAL_PLANNING'  "Material - Single-Item Planning Single/Multilevel
    EXPORTING
         MATERIAL = lv_material
         PLANT = lv_plant
         MRP_AREA = lv_mrp_area
         PLAN_SCENARIO = lv_plan_scenario
         MRP_PLAN_PARAM = lv_mrp_plan_param
         MATERIAL_EVG = lv_material_evg
    IMPORTING
         MRP_STATISTIC = lv_mrp_statistic
         RETURN = lv_return
    TABLES
         MRP_LISTS = lt_mrp_lists
         EXTENSIONOUT = lt_extensionout
. " BAPI_MATERIAL_PLANNING




ABAP code using 7.40 inline data declarations to call FM BAPI_MATERIAL_PLANNING

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 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).
 
 
 


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!