<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1492172#M228854</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;#147;MTD Qty Shipped&amp;#148;: Get MENGE from MSEG where BWART(movement type)=&amp;#148;601&amp;#148; 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 [&amp;#147;ship-to number and MSEG-MATNR].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before the query you need to populate the r_date range.&lt;/P&gt;&lt;P&gt;concatenate pdate(4) pdate+4(2) '01' into r_date-low.&lt;/P&gt;&lt;P&gt;r_date-high = pdate.&lt;/P&gt;&lt;P&gt;r_date-sign = 'BT'&lt;/P&gt;&lt;P&gt;r_date-option = 'I'.&lt;/P&gt;&lt;P&gt;append r_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT mseg&lt;SUB&gt;MATNR SUM(mseg&lt;/SUB&gt;MENGE) into table itab&lt;/P&gt;&lt;P&gt;from mseg inner join mkpf on mseg&lt;SUB&gt;mblnr = mkpf&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;and mseg&lt;SUB&gt;mjahr = mkpf&lt;/SUB&gt;mjahr&lt;/P&gt;&lt;P&gt;where mkpf~budat in r_date&lt;/P&gt;&lt;P&gt;group by mseg~matnr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Sep 2006 16:42:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-05T16:42:53Z</dc:date>
    <item>
      <title>Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1492171#M228853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi friends,&lt;/P&gt;&lt;P&gt;Could u please send me the how to do this Query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#147;MTD Qty Shipped&amp;#148;: Get MENGE from MSEG where BWART(movement type)=&amp;#148;601&amp;#148; 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 [&amp;#147;ship-to number and MSEG-MATNR].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i already fetched ship-to number in one internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Divya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 16:25:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1492171#M228853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T16:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1492172#M228854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;#147;MTD Qty Shipped&amp;#148;: Get MENGE from MSEG where BWART(movement type)=&amp;#148;601&amp;#148; 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 [&amp;#147;ship-to number and MSEG-MATNR].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before the query you need to populate the r_date range.&lt;/P&gt;&lt;P&gt;concatenate pdate(4) pdate+4(2) '01' into r_date-low.&lt;/P&gt;&lt;P&gt;r_date-high = pdate.&lt;/P&gt;&lt;P&gt;r_date-sign = 'BT'&lt;/P&gt;&lt;P&gt;r_date-option = 'I'.&lt;/P&gt;&lt;P&gt;append r_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT mseg&lt;SUB&gt;MATNR SUM(mseg&lt;/SUB&gt;MENGE) into table itab&lt;/P&gt;&lt;P&gt;from mseg inner join mkpf on mseg&lt;SUB&gt;mblnr = mkpf&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;and mseg&lt;SUB&gt;mjahr = mkpf&lt;/SUB&gt;mjahr&lt;/P&gt;&lt;P&gt;where mkpf~budat in r_date&lt;/P&gt;&lt;P&gt;group by mseg~matnr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 16:42:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1492172#M228854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T16:42:53Z</dc:date>
    </item>
  </channel>
</rss>

