Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

TABLE CONTROLS

Former Member
0 Likes
590

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 .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
567

at last.

sum.

write salary

endat.

5 REPLIES 5
Read only

Former Member
0 Likes
568

at last.

sum.

write salary

endat.

Read only

Former Member
0 Likes
567

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

Read only

Former Member
0 Likes
567

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

Read only

Former Member
0 Likes
567

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

Read only

Former Member
0 Likes
567

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