06-16-2009 10:10 AM
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
06-16-2009 10:16 AM
Instead of that you can move the SUM into a variable and then write at the end after writing all the records.
06-16-2009 10:22 AM
Hi,
Before displaying the summation move the sum value in to a variable of character data type before this check for the condition NE '0' this should solve your problem.
Regards,
Murthy.
06-16-2009 11:06 AM