‎2006 Nov 29 8:13 PM
hi ,
I have to pass some 10 material numbers (MATNR) to a function module and i have to get plant details (werks ) of corresponding to the give set of material numbers.Pls give logic or code for this.
thanks in advance
‎2006 Nov 29 8:20 PM
Hi,
You can use BAPI FM BAPI_MATERIAL_GETLIST.
Thanks
ramakrishna
Update: I am sorry the above function module is not giving plant details.
You can use the below logic.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR TYPE MARA-MATNR,
END OF ITAB.
DATA: BEGIN OF T_MARC OCCURS 0,
MATNR TYPE MARA-MATNR,
WERKS TYPE MARC-WERKS,
END OF T_MARC.
If the above function module contains materials
IF NOT ITAB[] IS INITIAL.
SELECT MATNR WERKS INTO TABLE T_MARC
FROM MARC
FOR ALL ENTRIES IN ITAB
WHERE MATNR = ITAB-MATNR.
ENDIF.
Thanks
TRamakrishna
Message was edited by:
Ramakrishna Ramisetti