‎2007 Feb 27 12:46 PM
HI,
i have material no , material group , plant in the selection screen
i have retrive the data based on the plant.
pls send me the select statement.
thanks and regards
Nagendra.
‎2007 Feb 28 11:17 AM
tables: Mara,
marc.
types : begin of ty_plant,
matnr type mara-matnr,
matkl type mara-matkl,
werks type marc-werks,
end of ty_plant.
data: it_plant type standard table of ty_plant,
wa_plant type ty_plant.
select-options: s_werks for marc-werks memory id pla.
start-of-selection.
select mara~matnr
mara~matkl
marc~werks
into table it_plant
from mara
inner join marc
on maramatnr = marcmatnr
where werks in s_werks.
if not it_plant[] is initial.
sort it_plant by matnr.
loop at it_plant into wa_plant.
write:/1 wa_plant-matnr,
20 wa_plant-matkl,
30 wa_plant-werks.
endloop.
append wa_plant to it_plant.
clear wa_plant.
endif.
‎2007 Feb 27 12:48 PM
DATA: Begin of itab,
matnr LIEK mara-matnr,
matkl LIEK mara-matkl,
werks LIKE marc-werks,
END of itab.
SELECT a~matnr a~matkl b~werks
FROM mara a inner join marc as b
ON a~matnr = b~matnr
INTO TABLE itab
WHERE b~werks IN s_werks.Hope this will solve.
Reward if this helps.
‎2007 Feb 27 2:09 PM
data: begin of itab occurs 0,
matnr LIKe mara-matnr,
matkl LIKe mara-matkl,
werks LIKE marc-werks,
end of itab .
select mara~matnr
mara~matkl
marc~werks
from mara inner join marc
on maramatnr = marcmatnr
into table itab
where mara~matnr in s_matnr
and mara~matkl in s_matkl.
‎2007 Feb 28 5:37 AM
hi,
tables : mara,marc.
DATA: Begin of itab,
matnr type mara-matnr,
matkl type mara-matkl,
werks typr marc-werks,
END of itab.
select-options:s_werks for marc-werks.
SELECT amatnr amatkl b~werks
FROM mara a inner join marc as b
ON amatnr = bmatnr
INTO TABLE itab
WHERE b~werks IN s_werks.
loop at itab.
write 😕 itab-matnr,
itab-matkl,
itab-werks.
endloop.
if helpful award points.
sri
‎2007 Feb 28 11:14 AM
Hi nagendra,
Select PLANT form Dbtable where plant eq P_plant(selection screen parametr for theplant).
ifsy-subrc eq 0.
select FIELD1 FIELD2 from DBTable where .....
else.
Message E1000(ZAKHA) with Plant doesnt availble..
Regards,
KIShore.
‎2007 Feb 28 11:17 AM
tables: Mara,
marc.
types : begin of ty_plant,
matnr type mara-matnr,
matkl type mara-matkl,
werks type marc-werks,
end of ty_plant.
data: it_plant type standard table of ty_plant,
wa_plant type ty_plant.
select-options: s_werks for marc-werks memory id pla.
start-of-selection.
select mara~matnr
mara~matkl
marc~werks
into table it_plant
from mara
inner join marc
on maramatnr = marcmatnr
where werks in s_werks.
if not it_plant[] is initial.
sort it_plant by matnr.
loop at it_plant into wa_plant.
write:/1 wa_plant-matnr,
20 wa_plant-matkl,
30 wa_plant-werks.
endloop.
append wa_plant to it_plant.
clear wa_plant.
endif.
‎2007 Mar 05 4:35 PM
Hi,
Use any of the query suggested above but the data should be selected first from MARC table as MARC has index on Material and Plant combination. Hence the query will definately run faster as any way you have plants with you.
select - - - - - -
FROM MARC inner join MARA
where werks in s_werks." -
primary index
hope this helps.
Regards,
Shahu
regards,
Shahu
‎2007 Mar 07 3:59 AM
nagendra,
DATA: Begin of i_mara,
matnr LIEK mara-matnr,
matkl LIEK mara-matkl,
werks LIKE marc-werks,
END of itab.
SELECT amatnr amatkl b~werks
FROM mara a inner join marc as b
ON amatnr = bmatnr
INTO TABLE i_mara
WHERE b~werks IN s_werks.
Pls. reward for all useful ans.
‎2007 Mar 07 11:21 AM
Hi Nag,
TYPES: Begin of ts_itab,
matnr LIEK mara-matnr,
matkl LIEK mara-matkl,
werks LIKE marc-werks,
END of ts_itab,
tt_itab type standard table of ts_itab.
DATA: WA TYPE TS_ITAB,
ITAB TYPE TT_ITAB.
SELECT amatnr amatkl b~werks
INTO TABLE itab
FROM mara AS a inner join marc AS b
ON amatnr = bmatnr
WHERE b~werks IN s_werks
LOOP AT ITAB INTO WA.
WRITE:/ WA-MATNR,
WA-MATKL,
WA-WERKS,
ENDLOOP.
Pls Reward if Helpful...
Mahe