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

Function module for Material

Former Member
0 Likes
321

Hi,

I have an text table /bic/tmaterial and an internal table ITAB.

In a function module, i need to get the material numbers of /bic/tmaterial which are not present in ITAB-material(material is a field in internal table ITAB) and for those material no's i need to make an entry in the structure ZSTRUCTURE(which also contains a material no field).

Help me in the code to make the above functionality possible.

Please help as soon as possible

Thanks & Regards,

Pra

Edited by: Alvaro Tejada Galindo on Apr 9, 2008 12:08 PM

1 REPLY 1
Read only

Former Member
0 Likes
291

With out more information, this code will get you started.


DATA:
  BEGIN OF mat_rec,
    matnr TYPE matnr,
  END OF mat_rec,
  it_tab     LIKE STANDARD TABLE OF mat_rec,
  zsturcture LIKE STANDARD TABLE OF mat_rec,
  it_file    LIKE STANDARD TABLE OF mat_rec.

"" read your file into it_file.

zsturcture = it_tab.
LOOP AT it_file INTO mat_rec.
  APPEND mat_rec TO zsturcture.
ENDLOOP.

SORT zsturcture.
DELETE ADJACENT DUPLICATES FROM zsturcture.