‎2007 Mar 05 12:57 PM
Dear All,
I am displaying data through table controls, these are three fields
which i am displaying.
empno empname salary
e1 en1 s1
e2 en2 s2
e3 en3 s3
total s
where
s = s1 + s2 + s3.
i need total of the salary should be displayed in the tablecontrol at end .
‎2007 Mar 05 1:01 PM
‎2007 Mar 05 1:01 PM
‎2007 Mar 05 1:01 PM
If itab is your internal table, then once you have the data ready in the internal table,
do like this:
loop at itab.
at last.
sum.
append itab.
clear itab.
endat.
endloop.
Regards,
Ravi
‎2007 Mar 05 1:02 PM
Hi,
Before displaying the records of Internal Table on the table control, using the Control evenets( at New PERNR...) calculate the sum into a variable in the program and pass that variable on to the end of the Table control (screen).
Regards,
Anji
‎2007 Mar 05 1:09 PM
Hi,
check the sample code.
LOOP AT T.
AT FIRST.
SUM.
WRITE: /4 'Grand Total:',
20 T-SALES, 40 T-DISCOUNT.
ULINE. SKIP.
ENDAT.
Regards,
Sruthi
‎2007 Mar 05 1:26 PM
Hi,
I think this code is similar to ur requirement.. see if it works for.
DATA: sflight_tab TYPE SORTED TABLE OF sflight
WITH UNIQUE KEY carrid connid fldate,
sflight_wa LIKE LINE OF sflight_tab.
SELECT *
FROM sflight
INTO TABLE sflight_tab.
LOOP AT sflight_tab INTO sflight_wa.
AT NEW connid.
WRITE: / sflight_wa-carrid,
sflight_wa-connid.
ULINE.
ENDAT.
WRITE: / sflight_wa-fldate,
sflight_wa-seatsocc.
AT END OF connid.
SUM.
ULINE.
WRITE: / 'Sum',
sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
SKIP.
ENDAT.
AT END OF carrid.
SUM.
ULINE.
WRITE: / 'Carrier Sum',
sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
NEW-PAGE.
ENDAT.
AT LAST.
SUM.
WRITE: / 'Overall Sum',
sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
ENDAT.
ENDLOOP.
regards,
srinivas