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: 

ALV

Former Member
0 Kudos

Hello All,

Can anybody explain how to display Grand Total of a field directly <b>(not by selecting a column and clicking on Total button)</b> when i execute a report.

And how i can i display a text for a field which i calculated the total.

Thanks and Regards

Madhavi

Message was edited by:

madhavi p

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi madhavi,

DATA: S_LAYOUT TYPE SLIS_LAYOUT_ALV.

For Text:

s_layout-totals_text = 'TOTALS:'.

DATA: IT_FLDCAT TYPE STANDARD TABLE OF

SLIS_FIELDCAT_ALV WITH HEADER LINE.

it_fldcat-fieldname = 'KWMENG'.

it_fldcat-tabname = 'ITAB'.

it_fldcat-seltext_m = 'QUANTITY'.

it_fldcat-outputlen = 15.

it_fldcat-do_sum = 'X'.

APPEND it_fldcat.

regards,

priya.

Message was edited by:

Priya

8 REPLIES 8

Former Member
0 Kudos
1. In fieldcatalog  for that field

     wA_fieldcat-do_sum = 'X'.

2. to display text

     wa_layout-totals_text = 'total'.

Former Member
0 Kudos

hi madhavi,

DATA: S_LAYOUT TYPE SLIS_LAYOUT_ALV.

For Text:

s_layout-totals_text = 'TOTALS:'.

DATA: IT_FLDCAT TYPE STANDARD TABLE OF

SLIS_FIELDCAT_ALV WITH HEADER LINE.

it_fldcat-fieldname = 'KWMENG'.

it_fldcat-tabname = 'ITAB'.

it_fldcat-seltext_m = 'QUANTITY'.

it_fldcat-outputlen = 15.

it_fldcat-do_sum = 'X'.

APPEND it_fldcat.

regards,

priya.

Message was edited by:

Priya

Former Member
0 Kudos

I wonder whats wrong with my answer?

0 Kudos

Hi..

I am able to change the fieldnames and displaying the total. But i have to get

the totals text at the bottom of the list like

TOTAL = 1000.

regards

Madhavi

0 Kudos

Yes i had mentioned that <b>wa_layout-totals_text = 'total'.</b>

0 Kudos

This is not the correct way of assigning points. 6+6 for my 2 answers is too much

0 Kudos

Hi..

Sorry for that...

I am still not getting it. Could you please elobarate where and How exactly i have to use it.

regards

Madhavi

gary_king2
Participant
0 Kudos

If I were you I would have looked at the many examples of ALV available.

Take a look at the package 'SLIS' for tonnes of examples...of which a fair few use totals.

Dr Sidewalk