05-06-2007 8:15 AM
Hi,
This is my requirement:
SELECT ALL FROM MARC INTO I_MARC BASED ON THE VENDOR THAT THE PERSON ENTERED on the selection screen.
BASED ON THE VENDORS MATERIAL, LOOK IN MARA AND SEE WHICH HAVE ZZtype1 = m
Thanks,
John
05-06-2007 8:21 AM
hi,
SELECT ALL FROM MARC INTO I_MARC where ernam in vendor.
here vendor is on selection screen.
2) BASED ON THE VENDORS MATERIAL, LOOK IN MARA AND SEE WHICH HAVE ZZtype1 = m
select * into iitab wher matnr in vmaterial and zztype1 = 'm'.
here vmaterial is an selcetion screen field
reward if useful
ravi
05-06-2007 8:25 AM
Hi
Vendor will not be there in MARC table or MARA table
So take the vendor and he supplied the materials from Purchase order item table and for them we fetch the data from MARC and MARA.
Data: itab like marc occurs 0 with header line,
itab2 like mara occurs 0 with header line,
begin of itab1 occurs 0,
lifnr like lfa1-lifnr,
matnr like mara-matnr,
werks like ekpo-werks,
end of itab1.
select-options s_lifnr for lfa1-lifnr.
select lifnr matnr werks from ekpo into table itab1 where lifnr in s_lifnr.
if not itab1[] is initial.
select * from marc into table itab for all entries in itab1
where matnr = itab1-matnr and werks = itab1-werks.
endif.
if not itab[] is intital.
select * from mara into table itab2 for all entries in itab
where matnr = itab-matnr and zztype1 = 'M'.
endif.
use the table Itab and Itab2 and display the data
Reward Points if useful
regards
Anji
05-07-2007 2:36 AM
try something like this:
*... get the material data via joins to the EINA vendor info records..
SELECT *
INTO CORRESPONDING FIELDS OF TABLE it_your_input
FROM eina
JOIN mara ON maramatnr = einamatnr
JOIN marc
ON marcmatnr = einamatnr
WHERE eina~lifnr IN s_lifnr
AND mara~lZZtype1 = m "or is it 'M'?
.