Application Development 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: 

Total in ALV

Murali_Shanmu
Active Contributor
0 Kudos

Hi

I have used to do_sum = 'X' option in the fieldCatalog for totalling the fields in the ALV. I am using the FM REUSE_ALV_GRID_DISPLAY. Now the total appears in the ALV. But i want the label "Total in Lakhs" to appear in the last row first column where the totals appear.(Yellow Line).

Can anyone Help.

1 ACCEPTED SOLUTION

former_member221770
Contributor
0 Kudos

Hi,

In the Layout Structure put you label in the "TOTALS_TEXT" field.

ie.

data: st_layout like slis_layout_alv.

st_layout-totals_text = 'Total in Lakhs'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING....

is_layout = st_layout...

Hope this helps.

Cheers,

Pat.

7 REPLIES 7

former_member221770
Contributor
0 Kudos

Hi,

In the Layout Structure put you label in the "TOTALS_TEXT" field.

ie.

data: st_layout like slis_layout_alv.

st_layout-totals_text = 'Total in Lakhs'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING....

is_layout = st_layout...

Hope this helps.

Cheers,

Pat.

Murali_Shanmu
Active Contributor
0 Kudos

Hi Patrick Yee

I am still not able to get it even after setting this in the Layout.

DATA: st_layout TYPE slis_layout_alv.

st_layout-totals_text = 'Total in Lakhs'.

st_layout-subtotals_text = 'A'.

st_layout-zebra = 'X'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_grid_title = text-001

is_layout = st_layout

it_fieldcat = fieldcat[]

TABLES

t_outtab = alv_tab[]

EXCEPTIONS

program_error = 1

OTHERS = 2.

Help !!!!

0 Kudos

Hi Shanmugham,

Humm it looks like the IS_LAYOYT-TOTALS_TEXT field is only working for FM 'REUSE_ALV_LIST_DISPLAY'. I don't seem to be able to get it to work for the 'REUSE_ALV_GRID DISPLAY' either. Can you use the ALV List FM instead?

Cheers,

Pat.

Former Member
0 Kudos

Hi,

Check whether the width of the column is enough to display the label "TOTAL IN LAKHS"

Thanks,

Ruthra.

0 Kudos

I even reduced the Text to as 'TOTAL'. Still it is not appearing. The size is quite sufficient to display 5 Char TOTAL.

Former Member
0 Kudos

Hi,

Try this option in the layout

ls_layout-colwidth_optimize = 'X'.

Colwidth_optimize (1) TYPE c: This parameter optimizes the length of the different columns in the output. The width of the different col. now depends on the max. Length of the data in the column.

Value set: SPACE, 'X'

'X' = <b>optimizes the column width so that all contents are displayed completely</b>

Kindly reward points if u find it useful.

Thanks,

Ruthra.

0 Kudos

Hi Ruthra

All columns are getting expanded as per the data. Thanks. But still total Text is not displaying.