09-29-2008 8:08 AM
HI ALL,
i have a prob in displaying the records
im fetching resords from MARDH table. the records which r there in my criteria has the follw . strct.
matnr plant stl loc. stock
001 xxx aa 15
001 xxx bb 5
i m getting these values but in internal table i just wat the values like tis,
matnr plant stock
001 xxx 20
i dont have ny thing to do with sto. loc.
plzz help me out..
thanxx
09-29-2008 8:11 AM
After getting the whole data into internal table sumup the stock by means of MATNR.
09-29-2008 8:46 AM
the reply send by Mr . Ajay was..
After getting the whole data into internal table sumup the stock by means of MATNR
can u tell me how can i do this..?
thanxxx
Edited by: NILESH SHELKE on Sep 29, 2008 9:46 AM
09-29-2008 8:11 AM
Hi,
Just avoid writing it with write statment.
Write: WA-A1,
WA-A2,
WA-A3.
in case of ALV dont include the field in the fieldcat.
santhosh
09-29-2008 8:12 AM
HI,
use AT NEW option for material and plant and do
sum based on it for ur stock.
09-29-2008 8:18 AM
its not just a matter of displying the data i want the filtered data in the internal table with stock added...
can u tel me in details how to add sum by the beans of MATNR..? as replied above..
09-29-2008 8:22 AM
Hi,
After fetching the data, loop at internal table and use COLLECT statement.
See F1 help for Collect.
Regards
Karthik D
09-30-2008 8:29 PM
>
> its not just a matter of displying the data i want the filtered data in the internal table with stock added...
> can u tel me in details how to add sum by the beans of MATNR..? as replied above..
You will get what you ask for.
regards,
Advait
09-29-2008 8:25 AM
Hi,
First of all donot retrieve the "slt. loc" field, while you are populating the internal table. Then use COLLECT statment, it will solve your query. For help check technical help of COLLECT statement.
Thank you.
09-29-2008 8:52 AM
Hi,
1. Define the key to your internal table as matnr
2. Loop at the internal table after data selection and
3. use the collect statement to collect the data in another intarnal table of the same structure.
regards,
Advait
09-29-2008 9:06 AM
I M writing in the simple words that,
i dont want the repeated data in the internal table itself just the unique matnr plant and the sum of stock for those matnr and plant.
so why to loop the internal table and to make it complicated...?????
09-29-2008 9:22 AM
Hi NILESH SHELKE,
We can do like this,
SELECT MATNR WERKS LGORT SUM( LABST ) FROM MARDH
INTO TABLE GT_SUM GROUP BY MATNR WERKS LGORT.
Regards,
R.Nagarajan.
09-29-2008 10:07 AM
>
> I M writing in the simple words that,
> i dont want the repeated data in the internal table itself just the unique matnr plant and the sum of stock for those matnr and plant.
> so why to loop the internal table and to make it complicated...?????
What is so complicated about doing a simple loop? The key word in that post and in a number of the others above is COLLECT, which is the standard way of summing values from an internal table via a loop; you then append the summary data to another itab.
09-29-2008 10:41 AM
but it will be more easy if we have got the complete data as we required rather than collecting it & then rearranging or formatting it.
now if we have got the complete data in our internal table we can directly disply it...
07-22-2009 12:32 PM