2006 Sep 06 11:22 AM
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.
2006 Sep 06 11: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 2000now grouping on field 'A' means result like this
A B C
dd abc 2000
ee kkk 3000Regards,
2006 Sep 06 11:29 AM
2006 Sep 06 11: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
2006 Sep 06 11: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
2006 Sep 06 11: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