2010 Oct 25 7:17 AM
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
2010 Oct 25 7:23 AM
use sort...
then collect. instead of append..
then use condition break statements to sum up only the last variables
Thanks and regards
S.Janagar
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
2010 Oct 25 7:20 AM
Welcome to SCN.
Am afraid this is a basic question. Please search in SCN before posting.
Vikranth
2010 Oct 25 7:23 AM
use sort...
then collect. instead of append..
then use condition break statements to sum up only the last variables
Thanks and regards
S.Janagar
2010 Oct 25 7:45 AM