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

summing like fields in a table

Former Member
0 Likes
646

I have an interanl talbe which I want summarize data by 2 fields. !st by confirmation number then by reason code. I trid using AT NEW but it would not allow me to use 2 fields.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
632

Use AT NEW with the second field of the internal table only. It will also break at the first field.

Rob

I have an interanl talbe which I want summarize data by 2 fields. !st by confirmation number then by reason code. I trid using AT NEW but it would not allow me to use 2 fields.

5 REPLIES 5
Read only

Former Member
0 Likes
633

Use AT NEW with the second field of the internal table only. It will also break at the first field.

Rob

Read only

0 Likes
632

How will it know to break at the 1st if I don't define it?

Read only

0 Likes
632

Check the help for AT NEW. In part, it says:

The control level structure with internal tables is static. It corresponds exactly to the sequence of columns in the internal table (from left to right).

Rob

Read only

0 Likes
632

Oh I see. I have several columns in between that i would not want it to sum by. Do you have another suggestion then instead of AT NEW

Read only

0 Likes
632

I never use AT NEW or ON CHANGE OF. I find it easier to just keep track of it myself (using old_val and new_val or something like that). This way, I don't have to worry about the structure of the internal table - just the sorting.

Rob