MD05:
call function 'BAPI_MATERIAL_MRP_LIST'
exporting
material = it_sub_matnr-matnr
plant = it_sub_matnr-werks
get_item_details = 'X'
get_ind_lines = ' '
tables
mrp_items = it_mrp_items.
MD04:
CALL FUNCTION 'MD_STOCK_REQUIREMENTS_LIST_API'
EXPORTING
matnr = gt_matnr-matnr
werks = p_werks
TABLES
mdpsx = lt_mdps
mdezx = lt_mdez
mdsux = lt_mdsu
EXCEPTIONS
material_plant_not_found = 1
plant_not_found = 2
OTHERS = 3.