2006 Sep 05 5:25 PM
hi friends,
Could u please send me the how to do this Query
MTD Qty Shipped: Get MENGE from MSEG where BWART(movement type)=601 where MSEG-EBELNand [ MKPF-BUDAT within first day of the running month until the running date where MKPF-MBLNR=MSEG-MBLNR]. Do grouping based on [ship-to number and MSEG-MATNR].
i already fetched ship-to number in one internal table
Regards
Divya
2006 Sep 05 5:42 PM
MTD Qty Shipped: Get MENGE from MSEG where BWART(movement type)=601 where MSEG-EBELNand [ MKPF-BUDAT within first day of the running month until the running date where MKPF-MBLNR=MSEG-MBLNR]. Do grouping based on [ship-to number and MSEG-MATNR].
--
I am not clear about your filter on EBELN as well as Ship-To Number. but you can do the below to fetch the information from MSEG
Before the query you need to populate the r_date range.
concatenate pdate(4) pdate+4(2) '01' into r_date-low.
r_date-high = pdate.
r_date-sign = 'BT'
r_date-option = 'I'.
append r_date.
SELECT msegMATNR SUM(msegMENGE) into table itab
from mseg inner join mkpf on msegmblnr = mkpfmblnr
and msegmjahr = mkpfmjahr
where mkpf~budat in r_date
group by mseg~matnr.