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: 

how can we create report footer ?

Former Member
0 Kudos

can any one send me the coding for report fotter and header

7 REPLIES 7

dani_mn
Active Contributor
0 Kudos

HI,

use the events.

TOP-OF-PAGE.

END-OF-PAGE.

Regards,

Former Member
0 Kudos

for footer when you do in first line itself

Report Z_HR_R_SST NO STANDARD PAGE HEADING LINES 255(3)..

footer 3 lines of space will be allocated....

check the syntax..but this is the way u have to use in first line if u ant footer

Former Member
0 Kudos

Hi

If you want header and footer for each and every page, you can do as follows:

TOP-OF-PAGE.

write the details which you want in header.

END-OF-PAGE.

write the details which you want in footer.

Regards

Surya.

Former Member
0 Kudos

Hi..

if you want the footer in the specified lines.. you ve to include

eg:

tables vbap.

data it_vbap type table of vbap with header line.

select-options: s_vbeln for vbap-vbeln.

start-of-selection.

select * from vbap into table it_vbap where vbeln in s_vbeln.

end-of-selection.

loop at it_vbap.

write:/ it_vbap-vbeln, it_vbap-matnr, it_vbap-netwr.

endloop.

*this event will trigger footer in the list. also depends on the line count.

end-of-page.

write: 'end of list'.

Former Member
0 Kudos

Hi..

if you want the footer in the specified lines.. you ve to include

eg:

REPORT ZMAT_TEST line-count 10(2)

tables vbap.

data it_vbap type table of vbap with header line.

select-options: s_vbeln for vbap-vbeln.

start-of-selection.

select * from vbap into table it_vbap where vbeln in s_vbeln.

end-of-selection.

loop at it_vbap.

write:/ it_vbap-vbeln, it_vbap-matnr, it_vbap-netwr.

endloop.

*this event will trigger footer in the list. also depends on the line count.

end-of-page.

write: 'end of list'.

former_member199581
Active Participant
0 Kudos

If you use ALV List/Grid you can create beautiful Header/Footer texts using the FM REUSE_ALV_COMMENTARY_WRITE:

Chk out this code:

[your code]

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = va_repid

i_callback_pf_status_set = va_pf_form_name

i_callback_user_command = va_uc_form_name

i_callback_top_of_page = 'TOP_OF_PAGE'

is_layout = st_layo

it_fieldcat = lt_fcat[]

it_events = lt_events[]

TABLES

t_outtab = lt_int_tab[]

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.

[other code]

FORM top_of_page.

"The name of the form is passed by parameter "i_callback_top_of_page" of FM REUSE_ALV_GRID_DISPLAY."

DATA: lt_header TYPE slis_t_listheader,

wa_header TYPE slis_listheader,

i_lines TYPE i,

n_lines(5) TYPE n,

lt_footer TYPE slis_t_listheader.

wa_header-typ = 'H'.

wa_header-info = text-i00.

APPEND wa_header TO lt_header. CLEAR wa_header.

wa_header-typ = 'S'.

DESCRIBE TABLE lt_pernr_tab LINES i_lines.

WRITE i_lines TO n_lines NO-ZERO.

wa_header-key = 'C.I.D Elaborati: '.

wa_header-info = n_lines.

APPEND wa_header TO lt_header. CLEAR wa_header.

IF NOT error_tab[] IS INITIAL.

wa_header-typ = 'A'.

wa_header-info = text-i01.

APPEND wa_header TO lt_header. CLEAR wa_header.

ENDIF.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = lt_header[]

i_end_of_list_grid = lt_footer[].

ENDFORM.

Former Member
0 Kudos

Hi

If you want header and footer for each and every page, you can do as follows:

reserve space for footer...

TOP-OF-PAGE.

write the details which you want in header.

END-OF-PAGE.

write the details which you want in footer.

ex:

... LINE-COUNT n(m)

Effect

Creates a report list with n lines per page, of which m lines are reserved for the END-OF-PAGE processing. If you omit the "(m)", the default value 0 applies. The system field SY-LINCT contains the current number of lines per page for generating lists.

If the LINE-COUNT specification is missing, the number of lines per page is calculated dynamically from the number of lines actually output on this page. Here, a page break no longer occurs automatically, (internal limit: 60,000 lines) but must be specified explicitly with NEW-PAGE, and the system field SY-LINCT is set to 0. (NEW-PAGE ... LINE-COUNT)

Note

The LINE-COUNT must not be enclosed in quotation marks.

Further information about using LINE-COUNT.

Examples

REPORT ZREPNAME LINE-COUNT 65.

The page has 65 lines.

REPORT ZREPNAME LINE-COUNT 65(8).

The page has 65 lines, of which the last 8 are only used by END-OF-PAGE.

Ramesh.