Thursday, June 19, 2008

SAP Stocks/Requirements List Function Module

SAP Stocks/Requirements List Function Module

To get a list of Stocks/Requirements in SAP, you can use the Function Module given below.

SAP ABAP Function Module to get Stocks/Requirements List.

MD_STOCK_REQUIREMENTS_LIST_API
______________________________________________________


The above mentioned SAP Function Module extracts data that is similar to transaction MD04 (Stocks/Requirement List).

Note: This function module is an RFC (Remote-Enabled Module) this makes it accessible from non-sap systems as well

Related Logical Database MSM

For Logical Database See Also:

Logical DataBase Programs
Logical Database Structure
__________________________________________________________________________________________________________

The Function Module
MD_STOCK_REQUIREMENTS_LIST_API takes the following inputs

PLSCN        Planning scenario in long-term planning
MATNR       Material
WERKS        Plant
BERID         MRP Area
ERGBZ        Selection rule
AFIBZ         Name of display filter
INPER         Internal period indicator
DISPLAY_LIST_MDPSX
DISPLAY_LIST_MDEZX
DISPLAY_LIST_MDSUX
____________________________________________________________________________________________________________

The following Parameters are exported.

Material number, Plant, Deletion Flag, Material description, Material type, Material group, Base unit of measure, Plant-Specific Material Status, MRP type, Procurement Type, Special procurement type, Mixed MRP indicator, Low-level code, Dependent requirements ind. for individual and coll. reqmts, Indicator for Requirements Grouping, MRP controller, Purchasing group, Indicator: MRP controller is buyer (deactivated), In-house production time, Processing time, Setup and teardown time, Interoperation time, Base quantity, Scheduling Margin Key for Floats, Planned delivery time in days, Goods receipt processing time in days, Total replenishment lead time (in workdays), Indicator: automatic fixing of planned orders, Lot size (materials planning), Fixed lot size, Minimum lot size, Maximum lot size, Rounding value for purchase order quantity, Maximum stock level, Assembly scrap in percent, Safety stock, Reorder point, Ordering costs, Storage costs indicator, Forecast indicator, Period indicator, Splitting Indicator, Discontinuation indicator, Effective-Out Date,, Follow-up material, Method for Selecting Alternative Bills of Material, Valuation class, Price control indicator, Moving average price/periodic unit price, Standard price, Price unit, Stock in transfer (plant to plant)

For more Details of the fields see the following

Structure
MT61D
MDPS
MDEZ
MDSU
Transparent Table
MDKP
______________________________________________________________________

See the functional code below.

REPORT ZEX_STOCKREPORT .

Parameter: p_matnr like MARC-MATNR,
           p_werks like MARC-WERKS.


DATA: int_mdpsx  TYPE TABLE OF mdps,
      int_mdezx  TYPE TABLE OF mdez,
      int_mdsux  TYPE TABLE OF mdsu,
      int_mdinx  TYPE TABLE OF mdin.

DATA: wa_mt61d TYPE mt61d,
      wa_mdezx TYPE mdez.

* Initial screen
CALL FUNCTION 'MD_STOCK_REQUIREMENTS_LIST_API'
  EXPORTING
    matnr   = p_matnr
    werks   = p_werks
  IMPORTING
    e_mt61d = wa_mt61d
  TABLES
    mdpsx   = int_mdpsx
    mdezx   = int_mdezx
    mdsux   = int_mdsux
  EXCEPTIONS
    OTHERS  = 1.


    if sy-subrc = 0.

    endif.


See Also:
SAP Availability Check BAPI/Function Module

No comments:

Post a Comment