‎2009 Feb 04 1:38 PM
Hi,
i develop report for annexure base on customer, material and posting date.
i have used mseg, mkpf, afpo, makt , kna1,resb, lips tables.
my customer and material fields in mseg table and posting date fields in mkpf then how i match data between two tables.
my Code.
select * from mseg into corresponding fields of table it_mseg where kunnr = cust
and matnr = mat and bwart = '501'.
loop at it_mseg.
endloop.
SELECT * FROM MKPF as a JOIN mseg as b ON amblnr = bmblnr and amjahr = bmjahr
into corresponding fields of table it_mseg
WHERE Budat = DATE .
loop at it_mkpf.
endloop.
Thanks in Advance.
Sam.
‎2009 Feb 04 1:44 PM
Hi,
You can directly put the MBLNR into both MSEG and MKPF.
Regards,
Vivek
‎2009 Feb 04 1:49 PM
Hi
Try this
SELECT * FROM MKPF as a INNER JOIN mseg as b ON a~mblnr = b~mblnr and a~mjahr = b~mjahr
into corresponding fields of table it_mseg_mkpf
WHERE a~budat = date
AND b~matnr = mat
AND b~bwart = '501'.
loop at it_mkpf.
endloop.
Pushpraj
‎2009 Feb 04 1:54 PM
Hi sam,
U can use two types of select statements..
Try this...
Select mblnr matnr kunnr from mseg into table itab where
If itab is not initial.
Select budat from mkpf into jtab for all entries in itab where mblnr = itab-mblnr and budat = date..
endif.
or
Select amatnr akunnr bbudat from mseg as a innerjoin mkpf as b on amblnr = b~mblnr into table itab where budat = date.