Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

abt function module

Former Member
0 Likes
328

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

1 REPLY 1
Read only

venkata_ramisetti
Active Contributor
0 Likes
298

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