Application Development and Automation 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: 
Read only

Query

Former Member
0 Likes
265

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

1 REPLY 1
Read only

Former Member
0 Likes
236

“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.