MD_STOCK_REQUIREMENTS_LIST_API the MRP Element of MD04

Source: Internet
Author: User

"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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.