PP Function module RFC Used the same way in S/4HANA

MD_STOCK_REQUIREMENTS_LIST_API Read Stock/Requirements List

Returns the stock/requirements list of a material in a plant (the data behind MD04): MRP elements, stock totals and MRP header data. It is used in custom availability, shortage and coverage reports. Call it per material and plant, read MDPSX for the elements, and handle MATERIAL_PLANT_NOT_FOUND when the material is not planned in that plant.

Function group
M61X
Remote-enabled (RFC)
Yes
Type
Function module

Importing parameters

ParameterTypeDescriptionRequired
MATNRMARC-MATNRMaterial numberYes
WERKSMARC-WERKSPlantYes
BERIDMDLV-BERIDMRP area—
PLSCNPLSC-PLSCNLong-term planning scenario—
NOBUFCHAR1Do not use the buffer—

Exporting parameters

ParameterTypeDescription
E_MT61DMT61DMaterial MRP data
E_MDKPMDKPMRP document header
E_CM61MCM61MMRP control data at material level
E_MDSTAMDSTAStock totals
E_ERGBZSFILT-ERGBZSelection rule used

Tables parameters

ParameterTypeDescriptionRequired
MDPSXMDPSMRP elements (items)—
MDEZXMDEZIndividual lines of the list—
MDSUXMDSUPeriod totals—

Exceptions

  • MATERIAL_PLANT_NOT_FOUND — Material not found in the plant
  • PLANT_NOT_FOUND — Plant not found

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'MD_STOCK_REQUIREMENTS_LIST_API'
  EXPORTING
    matnr = lv_matnr
    werks = lv_werks
  IMPORTING
    e_mt61d = lv_e_mt61d
    e_mdkp = lv_e_mdkp
    e_cm61m = lv_e_cm61m
    e_mdsta = lv_e_mdsta
    e_ergbz = lv_e_ergbz
  TABLES
    mdpsx = lt_mdpsx
    mdezx = lt_mdezx
    mdsux = lt_mdsux
  EXCEPTIONS
    material_plant_not_found = 1
    plant_not_found = 2
    OTHERS = 3.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report