Skip to Content
author's profile photo Former Member
Former Member

How to make top of page in alv to be printed.

hello expert:

i used following function to output alv.

but after been printed into spool, i cannot find the top of page.

how to set the print parameter to print the top of ALV.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = w_repid

i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'

is_layout = wa_layout

it_fieldcat = it_fieldcat

TABLES

t_outtab = it_comp

EXCEPTIONS

program_error = 1

OTHERS = 2.

thank you and best regards,

Kevin Gao

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2007 at 04:00 AM

    hi,

    Go throgh below link

    http://www.sapfans.com/forums/viewtopic.php?t=16629

    Rewards points if help full

    Regards

    Suresh.D

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2007 at 04:05 AM

    hi

    from the documentation:

    If function module REUSE_ALV_COMMENTARY_WRITE is not used in the form for I_CALLBACK_TOP_OF_PAGE, the form routine must be passed in parameter I_CALLBACK_HTML_TOP_OF_PAGE for the online mode. The form should then have the following format:

    form top_of_page using cl_dd type ref to cl_dd_document.

    In the form, you can, for example, use methods of class CL_DD_DOCUMENT to display text in HTML format.

    have u done this? or are you trying to print the top_of-page using REUSE_ALV_EVENTS_GET & REUSE_ALV_COMMENTARY_WRITE?

    if helpful, reward

    Sathish. R

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

      EXPORTING

      • I_INTERFACE_CHECK = ' '

      • I_BYPASSING_BUFFER =

      • I_BUFFER_ACTIVE = ' '

      I_CALLBACK_PROGRAM = SY-REPID

      • I_CALLBACK_PF_STATUS_SET = ' '

      • I_CALLBACK_USER_COMMAND = ' '

      • I_STRUCTURE_NAME =

      • IS_LAYOUT =

      IT_FIELDCAT = T_FIELDCAT

      • IT_EXCLUDING =

      • IT_SPECIAL_GROUPS =

      • IT_SORT =

      • IT_FILTER =

      • IS_SEL_HIDE =

      • I_DEFAULT = 'X'

      • I_SAVE = ' '

      • IS_VARIANT =

      IT_EVENTS = T_EVENTS

      • IT_EVENT_EXIT =

      • IS_PRINT =

      • IS_REPREP_ID =

      • I_SCREEN_START_COLUMN = 0

      • I_SCREEN_START_LINE = 0

      • I_SCREEN_END_COLUMN = 0

      • I_SCREEN_END_LINE = 0

      • IMPORTING

      • E_EXIT_CAUSED_BY_CALLER =

      • ES_EXIT_CAUSED_BY_USER =

      TABLES

      T_OUTTAB = T_OPEN_DEL

      EXCEPTIONS

      PROGRAM_ERROR = 1

      OTHERS = 2

      .

      IF SY-SUBRC NE 0.

      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF. " IF SY-SUBRC NE 0.

      ENDIF. " IF T_OPEN_DEL IS NOT INITIAL.

      ----


      • Form ADD_EVENTS

      ----


      • This subroutine to append events to ALV

      ----


      • No Parameter interface

      ----


      FORM ADD_EVENTS.

      CLEAR FS_EVENTS.

      FS_EVENTS-NAME = C_TOP_OF_PAGE.

      FS_EVENTS-FORM = C_TOP_OF_PAGE.

      APPEND FS_EVENTS TO T_EVENTS.

      CLEAR FS_EVENTS.

      FS_EVENTS-NAME = C_BEFORE_LINE_OUTPUT.

      FS_EVENTS-FORM = C_BEFORE_LINE_OUTPUT.

      APPEND FS_EVENTS TO T_EVENTS.

      CLEAR FS_EVENTS.

      FS_EVENTS-NAME = C_END_OF_LIST.

      FS_EVENTS-FORM = C_END_OF_LIST.

      APPEND FS_EVENTS TO T_EVENTS.

      ENDFORM. " ADD_EVENTS

      Append events to T_EVENTS, then call the event table in the function module,

      you will get top-of-page.

      Regards,

      Pavan P.

  • author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2007 at 06:18 AM

    hi

    please refer to my code

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_event
        EXCEPTIONS
          list_type_wrong = 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.
    
    
    * read contents of table it_event into work area
    
      READ TABLE it_event WITH KEY name = slis_ev_top_of_page
      INTO wa_event.
    
      IF sy-subrc EQ 0.
        MOVE 'ALV_TOP_OF_PAGE' TO wa_event-form.
        MODIFY it_event FROM wa_event INDEX sy-tabix.
      ENDIF.
    
    
    
    FORM alv_top_of_page.
      DATA:h_header TYPE slis_t_listheader,
            wa_header TYPE slis_listheader.
    
    * building the header of the list
    
      wa_header-typ = 'H'.
      CONCATENATE 'Purchase'
                  'Requisition'
      INTO wa_header-info SEPARATED BY space.
      APPEND wa_header TO h_header.
      CLEAR wa_header.
    
      wa_header-typ = 'S'.
      wa_header-key = 'Name:'.
      wa_header-info = TATA INFOTECH LIMITED'.
      APPEND wa_header TO h_header.
      CLEAR wa_header.
    
    
      wa_header-typ = 'S'.
      wa_header-key = 'Address:'.
      wa_header-info = 'IT PARK MUMBAI'.
      APPEND wa_header TO h_header.
      CLEAR wa_header.
    
    
      wa_header-typ = 'S'.
      wa_header-key = 'DATE:'.
      CONCATENATE sy-datum+6(2)'-'
                  sy-datum+4(2)'-'
                  sy-datum(4)
      INTO wa_header-info.
      APPEND wa_header TO h_header.
      CLEAR wa_header.
    
      wa_header-typ = 'S'.
      wa_header-key = 'TIME:'.
      CONCATENATE  sy-uzeit(2)':'
                   sy-uzeit+2(2)':'
                   sy-uzeit+4(2)
      INTO wa_header-info.
      APPEND wa_header TO h_header.
      CLEAR wa_header.
    
      wa_header-typ = 'S'.
      wa_header-key = 'Material Number:'.
      wa_header-info = p_matnr.
      APPEND wa_header TO h_header.
      CLEAR wa_header.
    
    
    
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = h_header
          i_logo             = 'INFOTECH'.
    
    ENDFORM.                    "ALV_TOP_OF_PAGE
    
    pass this it_events table to the ALV_GRID_DISPLAY FUNTION MODULE
    

    regards

    ravish

    <b>plz reward if useful</b>

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi kevin,

      I tried to loop the top of page data into ainternal table and then performed a write just before the alv list dispaly.But it creates two different spools one with the alv list and the other with the top of page data.

      even i m facing a similar problem..

      if u get any answer plz post it on this forum.

      Regards,

      NIky.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.