Skip to Content
author's profile photo Former Member
Former Member

grouping

hi friends,

in the below given description what is the meaning of <b>grouping</b> and could u plz suggest the code for this description.

“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-pseudo no. 5” and MSEG-MATNR].

regards,

siri.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Sep 06, 2006 at 10:28 AM

    HI,

    Grouping means subtotals.

    Addition of related records.

    like we have following records,

    A     B     C
    dd   abc    1000
    dd   abc    1000
    ee   kkk    1000
    ee   kkk    2000

    now grouping on field 'A' means result like this

    A     B    C
    dd   abc  2000
    ee   kkk  3000

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2006 at 10:29 AM

    hi,

    Data should be selected based on ship-to number and mseg-matnr. we should make use of group by.

    Check this thread to get information about group by.

    Here is a clear explanation of group by with an example

    group-by-clause-and-having-clause-in-select

    Regards,

    Sailaja.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2006 at 10:31 AM

    check the logic what i given for ur prev.post after that do like this

    grouing means Summation @ there level

    like

    MATNR MENGE

    1000 10kgs

    1000 20Kgs

    and MTD will be like this

    1000 30Kgs.

    Regards

    Prabhu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2006 at 10:38 AM

    You can try the following code:

    DATA: W_FIRSTDAY LIKE SY-DATUM,

    W_MENGE LIKE MSEG-MENGE.

    CONCATENATE SY-DATUM(6) '01' INTO W_FIRSTDAY.

    TABLES: MKPF, MSEG.

    SELECT SUM( MENGE ) INTO W_MENGE FROM MKPF INNER JOIN

    MSEG ON MKPFMBLNR = MSEGMBLNR

    WHERE BWART = '601' AND

    BUDAT >= W_FIRSTDAY AND

    BUDAT <= SY-DATUM

    GROUP BY KUNNR.

    *move w_menge to....

    ENDSELECT.

    Regards.

    p.s. this code does not include all the conditions like EBELN etc..but it may give u some idea

    Message was edited by: Akriti

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2006 at 10:40 AM

    In the context of your requirement it is basically wanting you to calculate the Month to Date Shipped qty for the ship-to number and material combination.

    Regards

    Anurag

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.