2008 Aug 03 11:18 PM
Hi,
I have an ALV report that is sorted by vendor, then by material number. There are subtotals for each vendor/material combination.
After each new vendor, a page break occurs.
All is well and good, except that the grand totals are always being displayed on a new page, even though there is still room on the previous page.
Is it possible to stop the page-break before the grand totals?
Here is the code that I use to set the sorting and page breaks.
FORM f_set_alv_sorting .
* Page break by vendor
gs_sort-spos = '01'.
gs_sort-fieldname = 'LIFNR'.
gs_sort-tabname = 'GT_OUTPUT'.
gs_sort-up = 'X'.
gs_sort-group = '*'.
gs_sort-subtot = 'X'.
APPEND gs_sort TO gt_sort.
CLEAR gs_sort.
* subtotal by vendor/material
gs_sort-spos = '02'.
gs_sort-fieldname = 'MATNR'.
gs_sort-tabname = 'GT_OUTPUT'.
gs_sort-up = 'X'.
gs_sort-subtot = 'X'.
APPEND gs_sort TO gt_sort.
ENDFORM. " f_set_alv_sorting
Any suggestions would be appreciated.
Thanks!
2008 Aug 04 3:50 AM
May be it is a standard behaviour, i never tested the Print using Page break option.
are you giving any LINE-COUNT in Report statement , check it once.
Instead you can print the totals in the beginning it self.
layout-totals_before_items = 'X'.
Using that you can print the totals in the beginning .