Skip to Content
0
Former Member
Jan 29, 2009 at 03:49 AM

Repetition of header in ALV output once excel download is selected

83 Views

Hi Experts,

I have alv report where I use FM as below

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = w_repid

i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

is_layout = l_layout

it_fieldcat = lt_fieldcat

it_sort = l_sort

i_save = 'X'

TABLES

t_outtab = itab

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.

and top of page as below

FORM top-of-page.

* Title

w_header-typ = 'H'.

w_header-info = text-033.

APPEND w_header TO t_header.

CLEAR w_header.

* Report Name

w_header-typ = 'S'.

w_header-key = text-034.

w_header-info = sy-repid.

APPEND w_header TO t_header.

CLEAR w_header.

* Date

w_header-typ = 'S'.

w_header-key = text-035.

CONCATENATE sy-datum6(2) '.'+

sy-datum4(2) '.'+

sy-datum(4) INTO w_header-info.

APPEND w_header TO t_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = t_header.

ENDFORM. "top-of-page

Its displaying well in output, but when I select excel download, the header is getting printed 4 times in the alv output and in the excel download it is printing twice. Please advise how to keep the header once. Note : I am not using any paging concept, simple header at the top.

Please advise.

Regards,

Kiran.