Skip to Content
0
Former Member
Feb 23, 2006 at 04:34 AM

itab totals

14 Views

Hi experts,

I have itab(t_det) like this.

AUFNR   MBLNR       MENGE
4006149|0043996297  |1
4006149|0043996338  |1
4006150|0043996294  |1
4006150|0043996332  |1
4006150|0043996292  |1

If aufnr is same i want to add menge.

after addition i want t_det like this.

AUFNR   MBLNR       MENGE
4006149|0043996297  |2
4006150|0043996292  |3

so i have written code like this

  LOOP AT T_DET INTO G_DET.
    G_DET-MENGE = G_DET-MENGE + T_DET-MENGE.
    MODIFY T_DET FROM G_DET TRANSPORTING MENGE.
  ENDLOOP.

is it correct??

thanks

kaki