For extracting SAP PLANTS for a given MATERIAL the following function module can be used.
SAP ABAP FUNCTION MODULE for extracting all PLANTS in which the MATERIAL is maintained.
MATERIAL_READ_PLANTS
________________________________________
Material Number
All the PLANTS in which the above MATERIAL is maintained are extracted by the above mentioned function Module.The fileds extracted are as follows.
MANDT CLIENT
MATNR Material Number
WERKS Plant
PSTAT Maintenance status
______________________________________________________
MATNR Material Number
WERKS Plant
PSTAT Maintenance status
______________________________________________________
Find the code below.
REPORT ZEX_PLANTDETAILS .
parameter: p_matnr like mara-matnr.
data: int_plants TYPE TABLE OF MARC_WERK.
CALL FUNCTION 'MATERIAL_READ_PLANTS'
EXPORTING
MATNR = p_matnr
TABLES
PLANTS = int_plants.
If sy-subrc = 0.
endif.
parameter: p_matnr like mara-matnr.
data: int_plants TYPE TABLE OF MARC_WERK.
CALL FUNCTION 'MATERIAL_READ_PLANTS'
EXPORTING
MATNR = p_matnr
TABLES
PLANTS = int_plants.
If sy-subrc = 0.
endif.
No comments:
Post a Comment