07-31-2008 12:21 PM
Hi,
We have an ALV program in which settings have been made for a page break on the first column of the output. When I take a print out, I get the output in multiple pages, which is what I need.
However, when we transport the same program to our consolidated
system and try to print, these page breaks disappear.
Is there some other setting which determines the page breaks. Like,
some print settings, etc.
Any help in this would be greatly appreciated.
(I am using the 'REUSE_ALV_GRID_DISPLAY' fm and passing the first columns name in the 'it_sort' table. Also, in the layout, I am saving this column name in the 'Sort Order')
Please let me know if more details are needed.
Regard,
Sudeep
07-31-2008 12:58 PM
You need to populate the sort table and send it to ALV function.
if you specify group = '*' then it will display in each page and print also for each sort combination.
wa_sort-group = '*'.
REPORT ztest_alv.
TYPE-POOLS: slis.
DATA: BEGIN OF it_flight OCCURS 0,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fcat like line of it_fieldcat,
layout TYPE slis_layout_alv.
data: IT_SORT TYPE SLIS_T_SORTINFO_ALV,
wa_sort like line of it_sort.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'IT_FLIGHT'
i_inclname = sy-repid
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
SELECT carrid
connid
fldate
seatsmax
seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
UP TO 20 ROWS.
.
wa_fcat-do_sum = 'X'.
modify it_fieldcat from wa_fcat TRANSPORTING do_sum
where fieldname = 'SEATSOCC' .
wa_sort-fieldname = 'CARRID'.
wa_sort-group = '*'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
wa_sort-fieldname = 'CONNID'.
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' "<- replace list with Grid also
EXPORTING
i_callback_program = sy-repid
is_layout = layout
it_fieldcat = it_fieldcat
it_sort = it_sort
TABLES
t_outtab = it_flight
EXCEPTIONS
program_error = 1.
Regards
Vijay Babu Dudla
07-31-2008 12:58 PM
You need to populate the sort table and send it to ALV function.
if you specify group = '*' then it will display in each page and print also for each sort combination.
wa_sort-group = '*'.
REPORT ztest_alv.
TYPE-POOLS: slis.
DATA: BEGIN OF it_flight OCCURS 0,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fcat like line of it_fieldcat,
layout TYPE slis_layout_alv.
data: IT_SORT TYPE SLIS_T_SORTINFO_ALV,
wa_sort like line of it_sort.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'IT_FLIGHT'
i_inclname = sy-repid
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
SELECT carrid
connid
fldate
seatsmax
seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
UP TO 20 ROWS.
.
wa_fcat-do_sum = 'X'.
modify it_fieldcat from wa_fcat TRANSPORTING do_sum
where fieldname = 'SEATSOCC' .
wa_sort-fieldname = 'CARRID'.
wa_sort-group = '*'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
wa_sort-fieldname = 'CONNID'.
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' "<- replace list with Grid also
EXPORTING
i_callback_program = sy-repid
is_layout = layout
it_fieldcat = it_fieldcat
it_sort = it_sort
TABLES
t_outtab = it_flight
EXCEPTIONS
program_error = 1.
Regards
Vijay Babu Dudla
07-31-2008 1:12 PM
Thanks for your reply.
But, I've already entered the settings when creating the ALV Grid
output. I'm setting the following values when entering the sort details:
wa_sortinfo-fieldname = 'W_CENTER'.
wa_sortinfo-up = 'X'.
wa_sortinfo-subtot = 'X'.
wa_sortinfo-group = '*'.
APPEND wa_sortinfo TO g_sortinfo.
However, I am still not getting the page breaks.
Please note: The same program gives the page breaks in another system.