Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV footer not displayed

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

0 Kudos

Hi Tanaya

There is no 'REUSE_ALV_COMMENTARY_WRITE' FM ' for your end of list code.

You need to fill slis_t_listheader table for footer as well as write statement has no effect in GRID disaplay.

when calling FM 'REUSE_ALV_COMMENTARY_WRITE' in end of list set parameter I_END_OF_LIST_GRID = 'X'.

Regards

Nimesh S. Patel

4 REPLIES 4

0 Kudos

Hi Tanaya

There is no 'REUSE_ALV_COMMENTARY_WRITE' FM ' for your end of list code.

You need to fill slis_t_listheader table for footer as well as write statement has no effect in GRID disaplay.

when calling FM 'REUSE_ALV_COMMENTARY_WRITE' in end of list set parameter I_END_OF_LIST_GRID = 'X'.

Regards

Nimesh S. Patel

0 Kudos

Hi,

I had tried with 'REUSE_ALV_COMMENTARY_WRITE'.

But still i am not getting the footer.

This is the sample used:

&----


*& Form end_of_list

&----


DATA: it_footer TYPE slis_t_listheader,

wa_footer TYPE slis_listheader.

BREAK-POINT.

wa_footer-typ = 'S'.

wa_footer-info = 'Tanaya'(051).

APPEND wa_footer TO it_footer.

wa_footer-typ = 'H'.

wa_footer-info = 'Tanaya'.

APPEND wa_footer TO it_footer.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_footer.

i_end_of_list_grid = 'X'.

0 Kudos

Hi Tanaya,

I hope your break-point is calling at this stage.

Would you pls change your code like below -

wa_footer-typ = 'S'.

wa_footer-info = 'Tanaya'.

APPEND wa_footer TO it_footer.

wa_footer-typ = 'H'.

wa_footer-info = 'Tanaya'.

APPEND wa_footer TO it_footer.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_footer.

i_end_of_list_grid = 'X'.

Regards

Nimesh S. Patel

Edited by: Nimesh Patel on Dec 26, 2007 8:44 AM

Former Member
0 Kudos

hi

good

go through this link and change your code accordingly.

http://www.saptechies.com/test-alv-display-with-header-footer/

thanks

mrutyun^