Application Development and Automation 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: 
Read only

How to collapse data in internal table?

Former Member
0 Likes
1,057

Hi everyone,

I have an internal table which has 5 columns as follows:

123 bbb ccc 12 +

123 ccc bbb 3 +

123 bbb ccc 34 -

123 ccc bbb 34 +

223 ccc bbb 12 +

the above table needs to be collpased as follows, with commonfields compared in first 3 columns grouping the rows with all 3 values same and 4th column data added or subtracted depending on the sign in 5th column:

123 bbb ccc -22 ->(grouping 1st and 3rd row)

123 ccc bbb 37 ->(grouping 2nd and 4th row)

223 ccc bbb 12 -> (only 5th row.no grouping since it is a unique row)

Could you please suggest how I can do this?

thanks in advance.

-Shravya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
757

use sort...

then collect. instead of append..

then use condition break statements to sum up only the last variables

Thanks and regards

S.Janagar

3 REPLIES 3
Read only

Former Member
0 Likes
757

Welcome to SCN.

Am afraid this is a basic question. Please search in SCN before posting.

Vikranth

Read only

Former Member
0 Likes
758

use sort...

then collect. instead of append..

then use condition break statements to sum up only the last variables

Thanks and regards

S.Janagar

Read only

0 Likes
757

Use colect with condition.

Naheet