‎2006 Mar 03 8:03 AM
hello everybody.
I need help regarding one of my report for delivery.
in selection screen i have ranges for
1.date of delivery
2.delivery no
3.customer no
result what i am getting
MERCHANDISE CATEGORY 002
M-01 STORE CODE 3 STOCK NET VALUE
M-01 STORE CODE 5 STOCK NET VALUE
M-01 STORE CODE STOCK NET VALUE
here in out put i need not required to repeat this material no again and again rather i need to add the quantity that comes against a particular material no.
i cannot use collect since collect can be used only with key fields
that tables i am refering are likp and lips.
thanks in advance.
‎2006 Mar 03 8:12 AM
use query ike this ...
select matnr sum(menge) from dbtab into itab
where cond...
group by matnr.
append itab.
endselect.
Message was edited by: kishan negi
Message was edited by: kishan negi
‎2006 Mar 03 8:14 AM
Hi,
SORT itab BY matnr.
LOOP AT itab INTO wa.
MOVE wa TO wa2.
AT NEW matnr.
APPEND wa2 TO itab2.
CONTINUE.
ENDAT.
LOOP AT itab2 WHERE matnr = wa-matnr.
itab2-quantity = itab2-quantity + itab-quantity.
MODIFY itab2 TRANSPORTING quantity.
ENDLOOP.
ENDLOOP.
Regards,
Wenceslaus.
‎2006 Mar 03 8:18 AM
loop at itab.
AT NEW MATNR.
SUM. (THIS STATEMENTS SUMS THE NUMERIC)
ENDAT.
ENDLOOP.
‎2006 Mar 03 8:26 AM
Hi,
In your select querry,
take SUM(QTY)and use GROUP BY clause for MATNR .
Hope this helps.
Regards,
Shashank