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 Grid Display download Problem

Former Member
0 Kudos

Dear Friends ,

I am using ALV Grid Display in my report . I run this report in background after creation of spool request i want to download that into PDF .

In the PDF i want a header and footer in the page .

How to proceed in implement this ?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use FM CONVERT_OTFSPOOLJOB_2_PDF

Hope it helps,

-RJ

4 REPLIES 4

Former Member
0 Kudos

Use FM CONVERT_OTFSPOOLJOB_2_PDF

Hope it helps,

-RJ

0 Kudos

This is used for the Displaying into PDF .

But i want to add header and Footer . I think we have to work some wht with Function module

REUSE_ALV_GRID_DISPLAY but how this is the problem ?

0 Kudos

In the FM 'REUSE_ALV_GIRD_DISPLAY' for the top-of-page in the importing parameter I_CALLBACK_TOP_OF_PAGE use the reuse_commentary_write FM to fill the header data and for the footer you will have to use the events.


  FORM top_of_page.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
  EXPORTING
    it_list_commentary       = it_end
*   I_LOGO                   =
*   i_end_of_list_grid       = it_end
*   I_ALV_FORM               =
          .

ENDFORM.                    "end

FORM build_eventcat .

  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type     = 0
    IMPORTING
      et_events       = it_event
    EXCEPTIONS
      list_type_wrong = 1
      OTHERS          = 2.

  READ TABLE it_event INTO wa_event WITH KEY name = 'END_OF_LIST'.
  wa_event-form = 'END_OF_PAGE'.                          " Sub-routine that will be used to write
  MODIFY it_event FROM wa_event INDEX sy-tabix.           " Modify it_event
  CLEAR wa_event.

ENDFORM. " F_BUILD_EVENTCATCALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program          = sy-repid
      i_callback_top_of_page      = 'TOP_OF_PAGE'
      is_layout                   = g_t_alv_layout2
      it_fieldcat                 = g_t_fieldcat2[]
      it_events                   = it_event[]
    TABLES
      t_outtab                    = <fs_final_itab>.

Former Member
0 Kudos

Hi,

Use the PRINT_TOP_OF_PAGE & PRINT_END_OF_PAGE to print the data in the header and footer and check this should help you get the header and footer.