02-28-2007 2:36 PM
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
02-28-2007 2:42 PM
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
02-28-2007 2:42 PM
1. In fieldcatalog for that field
wA_fieldcat-do_sum = 'X'.
2. to display text
wa_layout-totals_text = 'total'.
02-28-2007 2:42 PM
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
02-28-2007 3:13 PM
02-28-2007 3:18 PM
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
02-28-2007 3:23 PM
02-28-2007 3:27 PM
This is not the correct way of assigning points. 6+6 for my 2 answers is too much
02-28-2007 3:31 PM
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
02-28-2007 4:07 PM
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