Skip to Content
0
Former Member
Jun 16, 2009 at 09:10 AM

sum row in internal table

11 Views

Hallo,

How can I insert a summation row in a internal Table. I have inserted one but due to the type there are

also other fields in this row. I have cleared them but they have default value 0. And this value appears

in summation row. But I want that only field show value and other should be empty. I write the code perhaps somebody have an idea

SELECT carrid FROM spfli INTO CORRESPONDING FIELDS OF TABLE lt_one.

SELECT * FROM spfli INTO TABLE lt_two.

READ TABLE lt_one INDEX 1 INTO ls_one.

carr_id = ls_one-carrid.

LOOP AT lt_one INTO ls_one.

IF ls_one-carrid = carr_id.

READ TABLE lt_two INTO ls_two INDEX sy-tabix.

ls_summe-distance = ls_summe-distance + ls_two-distance.

APPEND ls_two TO lt_3.

ENDIF.

ENDLOOP.

ls_two-distance = ls_summe-distance.

free: ls_two-carrid,

ls_two-connid,

ls_two-countryfr,

ls_two-cityfrom,

ls_two-airpfrom,

ls_two-countryto,

ls_two-cityto,

ls_two-airpto,

ls_two-FLTIME,

ls_two-DEPTIME,

ls_two-arrtime,

ls_two-fltype,

ls_two-period.

*ls_two-mandt = ''.

*ls_two-fltime = ''.

*ls_two-deptime = ''.

*ls_two-arrtime = 'Summenzeile'.

APPEND ls_two TO lt_3.

regards

rana