Skip to Content
0
Former Member
Oct 29, 2007 at 10:59 AM

I need a code of ALV ( LISTor Block ALV) with End of page

8 Views

Hi Guys,

Can you give a working program on LIST ALV or BLOCK ALV which prints the page hader and page footer by passing the forms names (heade & footer) to the alv events of top-of page and end of page or something similar to that. In my case I have been able to print the page header but the footer is not printing.

refresh t_field.
clear t_field.
refresh t_events.                   

add_catalog:
'EBELP' 'Pos' '5' '' '1' 'N' '2',
'EMATN' 'Vores Varenummer' '18' '' '2' 'C' '18',
'IDNLF' 'Deres Varenummer' '35' '' '3' 'C' '35',
'MENGE' 'Antal' '17' '' '4' 'D' '17',
'MEINS' 'BME' '3' '' '5' 'C' '3',
'EINDT' 'Leveringsdato' '10' '' '6' 'C' '10',
'WARES' 'Val.' '5' '' '7' 'C' '5',
'NETPR' 'Pris per BME' '14' '' '8' 'D' '14',
'NETWR' 'Nettoværdi' '16' '' '9' 'D' '16',
'TXZ01' 'Betegnelse' '40' '' '10' 'C' '40'.

*--build table for events.
*x_events-form = 'PRINT_PAGE_HEADER'.
*x_events-name = slis_ev_top_of_list.
*append x_events to t_events.

x_events-form = 'PRINT_PAGE_HEADER'.
x_events-name = slis_ev_top_of_page.
append x_events to t_events.

x_events-form = 'PRINT_PAGE_FOOTER'.
x_events-name = slis_ev_end_of_page.
append x_events to t_events.


gv_repid = sy-repid.

call function 'REUSE_ALV_BLOCK_LIST_INIT'
exporting
  i_callback_program = gv_repid.

call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
 is_layout = x_layout
 it_fieldcat = t_field
 i_tabname = 'GIT_FINAL'
 it_events = t_events
 it_sort = t_sort
tables
 t_outtab = git_final
exceptions
 program_error = 1
 maximum_of_appends_reached = 2
 others = 3.

if sy-subrc <> 0.
* error message
endif.

call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
* exporting
* is_print = x_print_layout
exceptions
 program_error = 1
 others = 2.

if sy-subrc <> 0.
* error message
endif.

This is ALV part of my code which is not printing the footer by executing the footer subroutine. However header is printing.

Please help.

Reward point guaranteed.

Regards,

Anid

Message was edited by:

Anid

Message was edited by:

Anid