Skip to Content
0
Former Member
Dec 26, 2007 at 06:51 AM

ALV footer not displayed

51 Views

Hi Experts,

My code for header is working well . For footer, the event end_of_list is called but nothing is displayed.

Please help me in this regard.

I am generous in granting points.

Below sample code is for your reference:

&----


*& Form BUILD_EVENTS

&----


  • text

----


FORM build_events .

data: ls_event type slis_alv_event.

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = it_events[].

read table it_events with key name = slis_ev_end_of_page

into ls_event.

if sy-subrc = 0.

move 'END_OF_PAGE' to ls_event-form.

append ls_event to it_events.

endif.

read table it_events with key name = slis_ev_end_of_list

into ls_event.

if sy-subrc = 0.

move 'END_OF_LIST' to ls_event-form.

append ls_event to it_events.

endif.

ENDFORM. " BUILD_EVENTS

&----


*& Form build_layout

&----


  • text

----


FORM build_layout.

gd_layout-no_input = 'X'.

gd_layout-colwidth_optimize = 'X'.

gd_layout-info_fieldname = 'LINE_COLOR'.

ENDFORM. " build_layout

&----


*& Form build_print_params

&----


  • text

----


FORM build_print_params.

gd_prntparams-reserve_lines = '3'. "Lines reserved for footer

gd_prntparams-no_coverpage = 'X'.

ENDFORM. " build_print_params

&----


*& Form top-of-page

&----


  • text

----


FORM top-of-page.

**ALV Header declarations

DATA: it_header TYPE slis_t_listheader,

wa_header TYPE slis_listheader,

t_line LIKE wa_header-info.

wa_header-typ = 'H'.

wa_header-info = text-030.

APPEND wa_header TO it_header.

CLEAR wa_header.

wa_header-typ = 'S'.

wa_header-info = text-031.

APPEND wa_header TO it_header.

CLEAR wa_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

i_logo = 'ALVLOGO2'

it_list_commentary = it_header.

ENDFORM. " top-of-page

&----


*& Form display_alv_report

&----


  • text

----


FORM display_alv_report.

gd_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = gd_repid

is_layout = gd_layout

i_callback_top_of_page = 'TOP-OF-PAGE'

is_print = gd_prntparams

it_fieldcat = fieldcatalog[]

it_events = it_events[]

TABLES

t_outtab = it_out

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " DISPLAY_ALV_REPORT

&----


*& Form END_OF_PAGE

&----


form END_OF_PAGE.

data: listwidth type i,

ld_pagepos(10) type c,

ld_page(10) type c.

break-point.

write: sy-uline(50).

skip.

write:/40 'Page:', sy-pagno .

endform.

&----


*& Form END_OF_LIST

&----


form END_OF_LIST.

data: listwidth type i,

ld_pagepos(10) type c,

ld_page(10) type c.

break-point.

skip.

write:/40 'Page:', sy-pagno .

endform.