Application Development 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: 

help on material master

Former Member
0 Kudos

Hi guys i want to write the code for this. can somebody help me.

Select all entries from table MARD for selection criteria

Select corresponding record from table MARC

Select corresponding record from table MARA

check that the industry sector MARA-MBRSH is the value for mechanical engineering.

select material description from table MAKT where the language = SY-LANGU.

store all valid records in an internal table .

Thanks in Advance.

Edited by: Rishik on Jun 18, 2008 7:24 AM

6 REPLIES 6

former_member202474
Contributor
0 Kudos

Hi,

U can use the select statements in the follwing way:

select * from mard into table itab1 where condition.

select * from marc into table itab2 for all entries in itab1 where condition.

select * from mara into table itab3 for all entries in itab2 where condition.

loop at itab3 into wa3 where mbrsh = value.

select material descr from table makt into corresponding fields of table i_mat_details where

lang = sy-lang.

endloop.

u can also use joins.

***Reward if useful ***

Regards,

Ruby.

0 Kudos

Thank U so much

Former Member
0 Kudos

Hi,

Select * from MARD into table it_mard.

if it_mard is not initial.

select * from MARC into table it_marc

for all entries in it_mard

where matnr = it_mard-matnr.

endif.

if it_marc is not initial.

select * from mara

into table it_mara

for all entries in it_marc where

matnr = it_marc-matnr

and MBRSH = 'M'.

endif.

if it_mara is not initial.

select maktx from makt

into table it_makt

for all entries in it_mara

where matnr = it_mara-matnr

and SPRAS = 'E'.

endif.

Loop at it_mard into wa_mard.

move-corresponding wa_mard to wa_final.

Read it_marc..........

move-corresponding------

Read it_mara..........

move-corresponding------

Read it_makt..........

move-corresponding------

append wa_final to it_final.

endloop.

Declare the structures of internal tables properly.

Former Member
0 Kudos

Hi

you can use a join on MARA ,MAKT MARC and MARD based on selection criteria ,if selection criteria is plant and storage location or just plant

select afield bfield1 cfield2 dfield3

from marc as a inner join mara as b

on bmatnr = amatnr

inner join makt as c

on cmatnr = bmatnr and

c~langu = sy-langu

into table itab

where a~werks in s_werks

and b~MBRSH = mechnical enginnering.

Please reward if useful.

0 Kudos

Thank u

Former Member
0 Kudos

Another Simple report that you couldn't try writing on your own? Good Luck faking your way through your Job.