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

ALV

Former Member
0 Likes
1,067

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
Read only

Former Member
0 Likes
1,041

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

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
Read only

Former Member
0 Likes
1,041
1. In fieldcatalog  for that field

     wA_fieldcat-do_sum = 'X'.

2. to display text

     wa_layout-totals_text = 'total'.
Read only

Former Member
0 Likes
1,042

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

Read only

Former Member
0 Likes
1,041

I wonder whats wrong with my answer?

Read only

0 Likes
1,041

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

Read only

0 Likes
1,041

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

Read only

0 Likes
1,041

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

Read only

0 Likes
1,041

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

Read only

gary_king2
Participant
0 Likes
1,041

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