Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Display single value

Former Member
0 Kudos

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

14 REPLIES 14

Former Member
0 Kudos

After getting the whole data into internal table sumup the stock by means of MATNR.

0 Kudos

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

Former Member
0 Kudos

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

GauthamV
Active Contributor
0 Kudos

HI,

use AT NEW option for material and plant and do

sum based on it for ur stock.

Former Member
0 Kudos

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..

Former Member
0 Kudos

Hi,

After fetching the data, loop at internal table and use COLLECT statement.

See F1 help for Collect.

Regards

Karthik D

Former Member
0 Kudos

>

> 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

former_member755502
Participant
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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...?????

0 Kudos

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.

0 Kudos

>

> 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.

0 Kudos

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...

Former Member
0 Kudos

ok