‎2010 Jul 21 2:06 PM
Hi All
We have been asked If we can extract from ERP a u201Cbaseu201D definition of Material Master. That is the customer would like to have an overview of standard the SAP material types and the mandatory fields that need to be populated (by type).
Is there anyone out there aware of how we could extract this information from ERP or if this information already exists somewhere?
Any suggestions would be greatly appreciated (but probably not rewarded)
Edited by: Rob Burbank on Jul 21, 2010 9:56 AM
‎2010 Jul 21 2:26 PM
Try this to get material master data
DATA clientdata TYPE bapi_mara_ga. " master data
DATA mat_descr TYPE TABLE OF bapi_makt_ga. " texts
DATA materialtext TYPE TABLE OF bapi_mltx_ga. " long texts
FORM read_material USING material
CHANGING message.
" get bapi result
DATA wa_return LIKE LINE OF return.
" division for logging
DATA div_src TYPE string.
" bapi for read material generic data
CALL FUNCTION 'BAPI_MATERIAL_GETALL'
EXPORTING
material = material
IMPORTING
clientdata = clientdata
TABLES
materialdescription = mat_descr
materialtext = materialtext
return = return.
ENDFORM.
‎2010 Jul 21 2:27 PM
Study the function above to get also plant dependent data and so on ..
If you want to extract all materials, you have to get all material code from MARA
SELECT matnr
FROM mara.Regards
Gabriele