"Turn http://lz357502668.blog.163.com/blog/static/16496743201231941718527/"
?MD_STOCK_REQUIREMENTS_LIST_API The MRP Element of MD04
MD_STOCK_REQUIREMENTS_LIST_API Take MD04 MRP Elemen
Call FUNCTION ' Md_stock_requirements_list_api '
Exporting
MATNR = W_marc-matnr
Werks = P_werks
TABLES
MDPSX = TAB_MRP
MDEZX = TAB_MRP1
Mdsux = Tab_mrp2
EXCEPTIONS
Material_plant_not_found = 1
Plant_not_found = 2
OTHERS = 3.
This function mainly input the item number and factory that need to inquire
Md_pegging_nodialog Traceability Requirements
Call FUNCTION ' Md_stock_requirements_list_api '
Exporting
MATNR = W_marc-matnr
Werks = P_werks
TABLES
MDPSX = TAB_MRP
MDEZX = TAB_MRP1
Mdsux = Tab_mrp2
EXCEPTIONS
Material_plant_not_found = 1
Plant_not_found = 2
OTHERS = 3.
LOOP at TAB_MRP to Mrp_line WHERE (delkz = ' FE ' OR delkz = ' be ') and Umdat <> ' 00000000 '.
IF mrp_line-delkz = ' FE '. "If the production order is DEL12 the production order number is stored
tab_out-del12 = mrp_line-del12.
ELSE. "If the purchase order is DELNR there is a PO number
tab_out-del12 = Mrp_line-delnr.
ENDIF.
Tab_out-baart = Mrp_line-baart.
Tab_out-matnr = W_marc-matnr.
TAB_OUT-MAKTX = W_marc-maktx.
TAB_OUT-MNG01 = mrp_line-mng01.
Tab_out-umdat = Mrp_line-umdat.
Call FUNCTION ' Md_pegging_nodialog '
Exporting
Edelet = mrp_line-delet "Schedule Number rule
Edelkz = MRP_LINE-DELKZ "MRP Element
EDELNR = tab_out-del12 "MRP element number PO Number so number PR number
Edelps = mrp_line-delps "project number
EPLSCN = 000
EMATNR = W_MARC-MATNR "Item number
Ewerks = P_werks "Factory
TABLES
* EMDPSX =
IMDRQX = T_MDRQ
EXCEPTIONS
Error = 1
No_requirements_found = 2
Order_not_found = 3
OTHERS = 4.
The specific delkz is what the MRP element is, then consider which field (DEL12 or DELNR) is the input field for Md_pegging_nodialog Edelkz.
MD_STOCK_REQUIREMENTS_LIST_API the MRP Element of MD04