Skip to Content
0
Former Member
Dec 09, 2009 at 08:44 PM

Sum not working for table fields

135 Views

Hi,

I have an internal table that contains over 10 fields.

One of those fields is the activity type. I have several activity types, sorted descending.

Each record with an activity type also contains a field with a currency.

As such, for all unique activity types in my table, I am trying to sum the currency.

However, the following code isn't working. No sum is being created for unique the unique combination of activity types:

  SORT I_COST1 BY LSTAR DESCENDING.

I_COST2[] = I_COST1[].
  LOOP AT I_COST2.

    AT END OF LSTAR.

      SUM.

    ENDAT.

  ENDLOOP.

What am I doing wrong. Please help.