Adding values of an internal table

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Tania
Posts: 1
Joined: Thu Jan 28, 2010 12:52 am

Adding values of an internal table

Post by Tania » Sun Jan 31, 2010 12:11 am

Hello Experts,
Good Day,
I have an internal table in which i have to calculate the values of 1 column into another column based on another column. For example....

Code: Select all

COL1 COL2  COL3(sum of col2 based on col1)
120	1200	
120	2000	
120	1300	4500
121	1000	
121	2000	3000
122	3000	3000
Plz tell me..how can I do this.

Thanks,
Tania.

didier
Posts: 2409
Joined: Thu Apr 29, 2004 3:33 pm

Re: Adding values of an internal table

Post by didier » Sun Jan 31, 2010 4:36 am

I suppose you read the 'basic forum rules' when you accepted them during the registration ?

you're certainly not in the right subforum.

Didier

swright
Posts: 4467
Joined: Sun Oct 20, 2002 3:08 pm
Location: New Zealand

Re: Adding values of an internal table

Post by swright » Sun Jan 31, 2010 12:06 pm

How did you manage to fit all those columns internally?
Sandi
~~~~

Tuly kiwi. Image

Putting the Chur in Christchurch, bro!

thx4allthefish
Posts: 5694
Joined: Sat Oct 26, 2002 6:18 pm
Location: barolo barrel

Re: Adding values of an internal table

Post by thx4allthefish » Sun Jan 31, 2010 11:02 pm

moved from GD.
curiousorange wrote: I give up. Humanity isn't worth saving. Why is there never a Vogon Constructor Fleet around when you really need one?

Rich
Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool
Contact:

Re: Adding values of an internal table

Post by Rich » Mon Feb 01, 2010 2:40 am

swright wrote:How did you manage to fit all those columns internally?
tsk tsk. Stop taking advantage of (apparently) non-native english speaking people.

Use a second itab and the COLLECT statement.....
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com

binglogarth
Posts: 27
Joined: Mon Jun 16, 2008 2:11 pm

Re: Adding values of an internal table

Post by binglogarth » Sat Feb 20, 2010 8:50 pm

you should try BW to solve your problems...LOL

Gladiator
Posts: 797
Joined: Wed Dec 18, 2002 5:55 am
Location: Hyderabad, India

Re: Adding values of an internal table

Post by Gladiator » Sun Feb 21, 2010 9:30 pm

You can also use 'AT END OF col1' to get totals then use MODIFY to populate value in Col3.
Gladiator.

Post Reply